Tilman Hausherr created PDFBOX-4152:

             Summary: Glyphs don't appear properly in form with embedded type1 
font with DictionaryEncoding
                 Key: PDFBOX-4152
                 URL: https://issues.apache.org/jira/browse/PDFBOX-4152
             Project: PDFBox
          Issue Type: Bug
          Components: AcroForm
    Affects Versions: 2.0.8
            Reporter: Tilman Hausherr
         Attachments: PDFBOX-1084-mod-after.pdf, PDFBOX-1084-mod-before.pdf

I'm trying to reproduce a problem mentioned in the user mailing list 
("International characters only show correctly when form field is selected") 
with a confidential file that isn't shared. We know from screenshots is that it 
is a type 1 font with DictionaryEncoding. The only file I found is the one from 

The original file was changed with this code so that all text fields have an 
embedded font with DictionaryEncoding that isn't used in the original form:
        try (PDDocument doc = PDDocument.load(new File("PDFBOX-1084.pdf")))
            PDAcroForm acroForm = doc.getDocumentCatalog().getAcroForm();
            for (PDField field : acroForm.getFieldTree())
                if (field instanceof  PDTextField )
                    PDTextField tf = (PDTextField) field;
                    String da = tf.getDefaultAppearance();
                    if (da.startsWith("/HeBo"))
                        tf.setDefaultAppearance("/HelveticaNeue-Italic" + 
On the modified file, this code was run:
acroForm.getField("f1_09(0)").setValue("Stanisław äöüÄÖÜß");
PDFBox shows the field content but the ł is hard to see. Adobe Reader doesn't 
show the ł, and when clicking on the field, it shows the ł but not the german 
umlauts. Amusingly, if I copy & paste the mess that I get, it's umlauts again.

This message was sent by Atlassian JIRA

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

Reply via email to