We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Display emojis inside PDF using Aspose.PDF for .NET - Certain emojis are not rendered

We generate a simple PDF using one of your samples, and output a text using Segoe UI Symbol or Segoe UI Emoji font, and it works good, expect that Emoticons symbols are displayed as empty square box like it seems that they are not supported (The font support those symbols).

Other symbol are displayed correctly.
For example those are presented correctly: :slight_smile::v::white_check_mark::slight_smile::phone::frowning::soccer::point_up:
But those emoji family that are commonly used by all Applications are not display: :grinning: :wink::sunglasses:
It’s problematic not able to use them when generating PDF (seems like none of the emoji family are working).

This code will work:
string txt = “Segoe UI Emoji: ⏴:slight_smile::v::white_check_mark::slight_smile::phone::frowning::soccer::point_up:”;
And this one won’t:
txt = “Segoe UI Emoji: :grinning::wink::sunglasses:”;

Appreciate any advice

1 Like

@arieosherov

We have logged an investigation ticket as PDFNET-47970 in our issue tracking system as no emoji was rendered in output PDF while testing the scenario with Aspose.PDF for .NET 20.4 in our environment. We will further look into its details and keep you informed with the status of ticket resolution. Please be patient and spare us some time.

We are sorry for the inconvenience.

PS: Would you kindly share an output PDF generated at your end. It would also help us during investigation.

Emoji.pdf (168.9 KB)
Attached a sample PDF that include one row wit valid symbols and one with the Emoticons that are not presented correctly

1 Like

@arieosherov

Thanks for providing the PDF document.

We have attached this as well with the logged ticket and will let you know as soon as we have some updates.

I would like to trigger another critical issue for us, on cases we use a mix text + unsupported emojis.
In those cases the text itself also is invalid and all charterers are replaced with a empty squares in the pdf.

For example this string in Hebrew.
string tempText = “סרט: :point_down:”;
will be output to the pdf as: 􀀀􀀀 :􀀀􀀀􀀀

While this one, that is using English text will be written much better:
string tempText = “movies: :point_down:”;
will be output to the pdf as: movies: 􀀀􀀀

When removing the emoji from the string all is working well:
string tempText = “סרט:”;
will be output correctly to the pdf as: סרט:

I used both ‘Segoe UI Emoji’ and ‘Arial’ fonts and received the same problematic results.

Below is a simple code that generate easily the issue:
static void AddSimpleText()
{
string dataDir = RunExamples.GetDataDir_AsposePdf_Text();
Document pdfDocument = new Document();
Page page = pdfDocument.Pages.Add();
TextBuilder builder = new TextBuilder(page);
string not_validE = “סרט: :point_down:”;
TextFragment textFragment1 = new TextFragment(not_validE);
textFragment1.Position = new Position(100, 700);
textFragment1.TextState.FontSize = 15;
textFragment1.TextState.Font = FontRepository.FindFont(“Arial”);
builder.AppendText(textFragment1);
pdfDocument.Save(dataDir + “Emoji.pdf”);
}

The issue when using Hebrew chars is a blocker for us, because it seems like when a single unsupported symbol is used (e.g. :point_down:), nothing in the string will be output correctly to the pdf (not only the unsupported item).

Update:
i played a little more and I think I I know why when using Hebrew text, all output is not displayed correctly. It seems like when you encode a string that has unsupported symbols, you change the selected font (e.g. Ariel) to a fallback font that doesn’t support Hebrew language (MSGothic) and this is why Hebrew is also not displayed (you are doing the same when using English text but the fallback font does support this language and this is why it’s displayed correctly).

Can you please advice if there’s a workaround or a different way to implement this

1 Like

@arieosherov

Thanks for the update and sharing more details.

We have updated the ticket with the information that you provided. We will surely look into it as well and as soon as we have some investigation results, we will share with you. Please spare us some time.