AlivePDF icon indicating copy to clipboard operation
AlivePDF copied to clipboard

Cannot create PDFs created using UnicodePDF

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

What steps will reproduce the problem?
1. Create a UnicodePDF
2. Add text (even English, even core font)
3. Try to open resultant PDF in Adobe Reader

What is the expected output? What do you see instead?
Expected to see text written

Actual: Adobe Reader failed to read file, with error "There was an error 
opening this document.  There was an error reading this document (114)"

What version of the product are you using? On what operating system?
0.1.5RC 

Please provide any additional information below.
I wrote a test Flex program to create PDFs in several different ways.  In all 
cases where I create it from a PDF object it creates a valid PDF, and in all 
cases where I create it from a UnicodePDF object it creates a PDF that Adobe 
Reader can't open.

I also tried doing this as an AIR app with the same results.

Full code attached, but here's the meaty part:

Works:
private function saveEnPDF():void {
  var pdf:PDF = new PDF( Orientation.PORTRAIT, Unit.MM, Size.LEGAL );
  pdf.addPage();
  var fontEn:IFont = new CoreFont ( FontFamily.HELVETICA_BOLD );
  pdf.setFont(fontEn);
  pdf.textStyle( new RGBColor(0x990000), 1 );
  pdf.writeText( 12, getMessageEn());
  downloadPDF(pdf,"AlivePDFPrototypeEnPDF.pdf");
}

Does not work:
private function saveEnUnicodePDF():void {
  var pdf:UnicodePDF = new UnicodePDF( Orientation.PORTRAIT, Unit.MM, Size.LEGAL );
  pdf.addPage();
  var fontEn:IFont = new CoreFont ( FontFamily.HELVETICA_BOLD );
  pdf.setFont(fontEn);
  pdf.textStyle( new RGBColor(0x990000), 1 );
  pdf.writeText( 12, getMessageEn());
  downloadPDF(pdf,"AlivePDFPrototypeEnUnicode.pdf");
}



Original issue reported on code.google.com by [email protected] on 20 Jan 2011 at 2:55

Attachments:

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter

try pdf.setFont( new ArialUnicodeMS(CidInfo.CHINESE_SIMPLIFIED) );

Original comment by [email protected] on 21 Jan 2011 at 3:25

GoogleCodeExporter avatar Oct 22 '15 18:10 GoogleCodeExporter