pdfbox-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tilman Hausherr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (PDFBOX-3903) Special symbols (Emoji icons) missing when printing in PDF
Date Wed, 21 Nov 2018 17:30:00 GMT

    [ https://issues.apache.org/jira/browse/PDFBOX-3903?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16694998#comment-16694998
] 

Tilman Hausherr commented on PDFBOX-3903:
-----------------------------------------

Your gist doesn't help because it is not about PDFBox. The file in FOP just didn't have the
emojis at all and the debug messages are not relevant. The color font can't be read at all.
The normal font can be read and displays most of the emojis with this code:
{code:java}
try (PDDocument doc = new PDDocument())
{
    PDFont font = PDType0Font.load(doc, new File("NotoEmoji-Regular.ttf"));
    PDPage page = new PDPage();
    doc.addPage(page);
    PDPageContentStream cs = new PDPageContentStream(doc, page);
    cs.beginText();
    cs.newLineAtOffset(0, 700);
    cs.setFont(font, 20);
    String s = "😃🐠😴🤧✍️👉👨‍🚒👨‍🏫👩‍👦👨‍👧‍👦🐥🐧🐾🐁🐕🎋🐲🐉";
    for (int i = 0; i < s.length()-1; ++i)
    {
        String s1 = new String(new int[]{s.codePointAt(i)}, 0, 1);
        try
        {
            cs.showText(s1);
        }
        catch (IllegalArgumentException ex)
        {
            //cs.showText(" ");
        }
    }
    cs.endText();
    cs.close();
    doc.save(new File("emojis.pdf"));
}{code}

> Special symbols (Emoji icons) missing when printing in PDF
> ----------------------------------------------------------
>
>                 Key: PDFBOX-3903
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3903
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Documentation, FontBox, PDModel, Rendering, XmpBox
>    Affects Versions: 2.0.6, 2.0.7
>         Environment: Java , PDFBOX, 
>            Reporter: Nagendra
>            Priority: Major
>              Labels: Emoji, EmojiOne, Java, PDF, PDFLIB
>   Original Estimate: 72h
>  Remaining Estimate: 72h
>
> When I am trying to print special symbols like emoji icons on pdf by using *PDFBOX Library
in Java environment *, Failing to print and able to print remaining text, Can you please suggest
us the solution.
> Ex: "😃🐠😴🤧✍️👉👨‍🚒👨‍🏫👩‍👦👨‍👧‍👦🐥🐧🐾🐁🐕🎋🐲🐉
"  , I am trying to print these special symbols in pdf, I tried most of the ttf's, no one
is supported to print.  Any quick response is appriciate. Thank you.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

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


Mime
View raw message