Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Emoji doesn't render correctly in PDF #29

Open
moataseem opened this issue Nov 7, 2019 · 4 comments
Open

Emoji doesn't render correctly in PDF #29

moataseem opened this issue Nov 7, 2019 · 4 comments

Comments

@moataseem
Copy link

If you think there is a bug in MigraDoc then please use the IssueSubmissionTemplate to make the issue replicable.
http://www.pdfsharp.net/wiki/IssueSubmissions.ashx

Thanks.

Resources

The official project web site:
http://pdfsharp.net/

The official peer-to-peer support forum:
http://forum.pdfsharp.net/

Reporting an Issue Here

I'm unable to get the Emoji to appear in a pdf

Expected Behavior

to have such an icons to appear in the generated pdf as follow
👀 😀 💨 ♡

Actual Behavior

�� �� �� ♡

Steps to Reproduce the Behavior

`

         // Create a new MigraDoc document
        Document document = new Document();
        //document.UseCmykColor = true;

        // Add a section to the document
        Section section = document.AddSection();

        // Add a paragraph to the section
        Paragraph paragraph = section.AddParagraph();

        paragraph.Format.Font.Color = Color.FromCmyk(100, 30, 20, 50);

        // Add some text to the paragraph
        paragraph.AddFormattedText("Hello, World!", TextFormat.Bold);
        paragraph.AddFormattedText("👀 😀 💨 ♡", new Font("Segoe UI Emoji"));

        // Create a renderer for the MigraDoc document.
        PdfDocumentRenderer pdfRenderer = new PdfDocumentRenderer(true);

        // Associate the MigraDoc document with a renderer
        pdfRenderer.Document = document;

        // Layout and render document to PDF
        pdfRenderer.RenderDocument();

        // Save the document...
        const string filename = "HelloWorld.pdf";
        pdfRenderer.PdfDocument.Save(filename);
        // ...and start a viewer.
        Process.Start(filename);

`
IssueSubmission.zip

@ThomasHoevel
Copy link
Member

This is a known limitation of PDFsharp. Surrogate pairs do not work yet and Unicode chars that require two 16-bit values (above 0xffff) will not show correctly.

@ThomasHoevel
Copy link
Member

See also:
empira/PDFsharp#63

@Zeek2
Copy link

Zeek2 commented Jun 16, 2022

Any progress; Has this been fixed yet? This is major blocking issue for me :(

@NeilPearson73
Copy link

This is a major blocking issue for me too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants