[ 
https://issues.apache.org/jira/browse/PDFBOX-3411?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tilman Hausherr updated PDFBOX-3411:
------------------------------------
    Component/s: PDModel

> Incorrect embedding of non-subset fonts.
> ----------------------------------------
>
>                 Key: PDFBOX-3411
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3411
>             Project: PDFBox
>          Issue Type: Bug
>          Components: PDModel
>    Affects Versions: 2.0.0, 2.0.2, 2.0.3, 2.1.0
>            Reporter: Dan Fickling
>             Fix For: 2.0.3, 2.1.0
>
>
> The following code produces a broken PDF.
> {code}
> final String DIR = "/Users/user/Documents/pdf/";
> PDDocument doc = new PDDocument();
> PDPage pg = new PDPage();
> PDPageContentStream con = new PDPageContentStream(doc, pg);
> con.beginText();
> // Working fine when below is true, not when it is false.
> con.setFont(PDType0Font.load(doc, new FileInputStream(DIR + 
> "NotoSans-Regular.ttf"), false), 16);
> con.setTextMatrix(Matrix.getTranslateInstance(50, 600));
> con.showText("Hello World");
> con.endText();
> con.close();
> doc.addPage(pg);
> doc.save(new File(DIR + "out.pdf"));
> doc.close();
> {code}
> As mentioned in the code, it works fine when the subset is true. I've tried 
> it with a few fonts. The referenced font is downloadable from here:
> https://www.google.com/fonts#UsePlace:use/Collection:Noto+Sans
> Behavior in Chrome: Shows random characters.
> Behavior in Mac Preview: Shows selectable whitespace.
> Behavior in Acrobat Reader: Shows message on open (Cannot find or create the 
> font 'NotoSans'. Some characters may not display or print correctly). Shows 
> dots instead of characters.
> Behavior in Safari: Same as preview.
> Tested with 2.0.0 and 2.0.2.
> Why does this matter? We need a complete font to embed to use in text acro 
> form fields.
> Thanks.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to