@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 = “סרט:
”;
will be output to the pdf as: :
While this one, that is using English text will be written much better:
string tempText = “movies:
”;
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 = “סרט:
”;
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.
), 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.