Pdf export, charset(or Font settings?) not correct

Posted by: youka94 on 8 September 2017, 4:54 am EST

  • Posted 8 September 2017, 4:54 am EST

    Hi, i met with a problem on exporting to pdf, the document can not display using correct font. Is there any properties can be set in pdf export to correct it, or it's a bug?

    OS Environment: Windows XP Simplified Chinese

    Spread 4 Version used: Trial Version, downloaded yesterday. 

    Project: SpreadWinDemoVb shipped with the installation.

    Steps:

    1_ Run the sample program "printing to pdf",print to a pdf document, and open it.

    2_ Adobe PDF Reader(Either V5 or V7) will show a "checking for update" window.... then prompts "Adobe Reader has found the components langpkg/Japn: and it's size is 9.73MB, do you want to process the download of this components?"

    in fact the font name is "Simsun" and it is a standard font for Windows Chinese Version .

     

    ps: I just installed an eval of fpspread for winform4. last time i use spread 6 (ActiveX version) it was serveral years ago... the NET version seems so powerful compared to the old ActiveX version.

  • Posted 8 September 2017, 4:54 am EST

    Hello Youka,

    I tried to run the sample and I do not see any prompt while opening the generated PDF file.

    The error message that you are getting denotes that Acrobat Reader is trying to install some missing component. Are you able to view the pdf file if you select "No" to download the component?

    It seems to me that the pdf file is getting generated successfully. If that is the case you may try viewing the pdf using some other pdf reader. If it works then you may contact Adobe support to konw how to disable the prompt that you are getting.

    I hope it helps.

    Regards,

  • Posted 8 September 2017, 4:54 am EST

    Thank you for replying. I think the problem is that in some version of Windows XP (default using far-east charset), the export information is not correct.

    We can not force a Chinese user to show correct pdf export by downloading Japanese font......

    May you can change your Windows [control panel]-[regional settings] to Chinese and have another try, or try the following.

    To reproduce the bug:

     in spreadwinDemoVB, modify PDFExport.vb, add a line:

            Private Sub button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles btnExport.Click

                1)  fpSpread1.Font = New Font("Arial", 9) //this is ok

                2)  fpSpread1.Font = New Font("simsun", 9) //this is not OK,for it's using gb2312 charset but after exporting , the pdf uses Japanese charset. note that 'simsun'  in chinese (??) it is the default font that will be used in .NET winForms running in Windows Chinese version

                3) fpSpread1.Font = New Font("PMingLiU", 9) //Traditional chinese used in Windows Traditional Chinese version //not OK too, will download Japanese font which is actually not necesssary.

     

     

  • Posted 8 September 2017, 4:54 am EST

    Hello,

    I have tetsed the reported issue using the steps as outlined by you, however I was not able to replicate the said issue at my side. I am not getting an pop message as described by you. If I use the 3 approaches mentioned by you, it just opens the Spread contents in a pdf file. Also I do not have any option to set the regional settings to either chinese or Japanese. I do not see them as available option

    Thanks

  • Posted 8 September 2017, 4:54 am EST

    maybe this issure will not occur in English version of windows.

    I found the problem at line 158 to 163 in the exported pdf source.

    /DescendantFonts [8 0 R]

    /Type /Font

    /Subtype /Type0

    /Name /F1

    /BaseFont /SimSun

    /Encoding /UniJIS-UCS2-H

    line 187

    /Ordering (Japan1)

    where as it should be like this ,compared to other pdf documents.

    line 158 to 163

    /Type /Font

    /Subtype /Type0

    /Name /F0

    /BaseFont /SimSun

    /Encoding /GBK-EUC-H

    >>

    endobj

    line 187:/Ordering(GB1)

     

  • Posted 8 September 2017, 4:54 am EST

    Hello,

    I was able to reproduce the issue and have reported this as a bug (#25977) for the development team to fix for the next maintenance release. The problem happens if there is a Chinese charset(such as Simsun) used in the Spread, PDF library will  judge the charset by checking the encoding of the characters with the sequence of Japanese, Chinese GB,… Because the encoding range of Chinese and Japanese are overlapped, PDF library misjudged the charset as Japanese.

  • Posted 23 February 2018, 8:23 am EST

    You should just try out ZETPDF.com and make your life easier!

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels