You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tiruppathi Rajan Gunaseelan (JIRA)" <ji...@apache.org> on 2016/03/18 07:46:33 UTC

[jira] [Created] (PDFBOX-3277) Unable to write Chinese characters into PDF

Tiruppathi Rajan Gunaseelan created PDFBOX-3277:
---------------------------------------------------

             Summary: Unable to write Chinese characters into PDF
                 Key: PDFBOX-3277
                 URL: https://issues.apache.org/jira/browse/PDFBOX-3277
             Project: PDFBox
          Issue Type: Bug
          Components: PDModel, Writing
    Affects Versions: 2.0.0
         Environment: Windows, JDK7
            Reporter: Tiruppathi Rajan Gunaseelan



Please refer to the JIRA 

https://issues.apache.org/jira/browse/PDFBOX-1705

I am unable to write Chinese content into a PDF using EmbeddedFonts.java from JIRA 1705. Later I found way to fix it by feeding in the "arialuni.ttf" instead of LiberationSans-Regular.ttf from the example. I had confirmed the Chinese PDF generation by writing a hardcoded Chinese data in my example. 

Later I had extended this piece of logic to write the desired PDF in my application but got into "java.lang.IllegalArgumentException: U+008A is not available in this font's encoding: WinAnsiEncoding". Please advise.

1. From my application, i call an external Webservice and that returns the Chinese + English content in response as a String,
2. I read this response string using UTF-8 as the Charset and unmarshal it to Java bean using JAXRB.
3. To the contentStream.drawString() i passed the string calling the getter method on the pojo which has Chinese data stored in a String variable. Here's where i am getting the above exception. Please help me to fix this.
I am using PDFBox version 2.0.0.-RC3. Your help is much appreciated.

Also the generated PDF file is on MBs, i believe this huge size is because of the feed of arialuni.ttf which is of size 23 MB.Is there a way we can reduce the size of the output PDF file. Do we have an alternate to arialuni.ttf? Please advise.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org