You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2017/11/07 17:17:00 UTC
[jira] [Updated] (PDFBOX-3997) Cannot encode strings with of
surrogate pairs
[ https://issues.apache.org/jira/browse/PDFBOX-3997?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Tilman Hausherr updated PDFBOX-3997:
------------------------------------
Attachment: heli.pdf
> Cannot encode strings with of surrogate pairs
> ---------------------------------------------
>
> Key: PDFBOX-3997
> URL: https://issues.apache.org/jira/browse/PDFBOX-3997
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.8
> Reporter: Tilman Hausherr
> Assignee: Tilman Hausherr
> Fix For: 2.0.9, 3.0.0
>
> Attachments: NotoEmoji-Regular.ttf, heli.pdf
>
>
> This code doesn't work:
> {code:java}
> try (PDDocument doc = new PDDocument())
> {
> PDPage page = new PDPage();
> doc.addPage(page);
> try (PDPageContentStream cs = new PDPageContentStream(doc, page))
> {
> PDFont font = PDType0Font.load(doc, new File("NotoEmoji-Regular.ttf"));
> cs.setFont(font, 50);
> cs.beginText();
> cs.newLineAtOffset(100, 700);
> cs.showText("\uD83D\uDE81");
> cs.endText();
> }
> doc.save("heli.pdf");
> }
> {code}
> It throws an exception
> {quote}
> IllegalArgumentException: No glyph for U+1F681 in font NotoEmoji
> {quote}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: dev-help@pdfbox.apache.org