Satishpethani92 / alivepdf

Automatically exported from code.google.com/p/alivepdf
0 stars 0 forks source link

Cannot create PDFs created using UnicodePDF #298

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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 ninja.ar...@gmail.com on 20 Jan 2011 at 2:55

Attachments:

GoogleCodeExporter commented 8 years ago
try pdf.setFont( new ArialUnicodeMS(CidInfo.CHINESE_SIMPLIFIED) );

Original comment by jeff_j...@126.com on 21 Jan 2011 at 3:25