Problems writing some Chinese characters to PDF with wPDF 3

  • I am having problems writing some Chinese characters to a PDF using wPDF 3.62.0.1. I wrote a small program to read text from a file and write it to the PDF. The code structure is arcane, because it mimics the structure of the actual application: I know that it could be written in a less convoluted manner.

    Please download http://www.jonbondy.com/wPDF-Chinese.ZIP to see the following files:

    Chinese Text.txt: contains the Chinese text that is used to create the PDF;

    PdfTest.dpr, pas, and dfm: the test program itself

    Test.pdf: the output of the test program

    Test Chinese PDF.PNG: this shows the Chinese Text.txt file and the Test.pdf file, on a computer that has the Chinese character set installed. If you look carefully, you will see 4 blue boxes on the PDF that highlight the four characters that are displaying as "?" rather than correctly. If you look at the Notepad image, you will see the correct underlying text.

    Is this a known bug? Is there a workaround or fix?

    Thank you!

    Jon

  • Thank you for your quick attention!

    When you say "does not work" do you mean "does not compile" or "runs but does not behave the same"?

    We tried CID mode, and it changed nothing. I will look in to glyph mode.

  • Using wpTextAsGlyphs, for Chinese reports, our PDFS are increasing from 450KB to 7700KB, almost a factor of 16! Is there any way around this?

    We are also seeing cosmetic anomalies in the reports (see the two screen shots, below). Is this a known bug? Has it been fixed?


    In addition, below please find URLs for four PDF files. They are in pairs, one pair for Linearity, and one pair for Simple Precision (SP). Each PDF was generated either with Glyphs or without Glyphs. I have annotated each PDF to indicate the places where cosmetic defects can be seen. I wonder if the sizes (heights and widths) of the various strings are being computed incorrectly within the PDF Canvas, since the code to generate each does not change. Incorrect string heights and widths might explain the incorrect positioning of strings on the PDF Canvas: