Emojis Not Rendering in IronPDF Using RenderHtmlAsPdf()

When rendering HTML that contains emoji characters using RenderHtmlAsPdf(), the resulting PDF does not display the emoji characters even though they appear correctly in browser print previews and the HTML is correctly encoded as UTF-8.

The string-based RenderHtmlAsPdf() method has Unicode handling limitations that cause emoji characters to be dropped from output PDFs. File-based rendering processes content in a context closer to a real browser, which improves Unicode and emoji handling.

Solution

Option 1: Use RenderHtmlFileAsPdf()

Write the HTML content to a temporary file and render from the file path instead of the string:

string tempPath = Path.GetTempFileName() + ".html";
File.WriteAllText(tempPath, htmlContent, System.Text.Encoding.UTF8);

var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlFileAsPdf(tempPath);

File.Delete(tempPath);
pdf.SaveAs("output.pdf");
string tempPath = Path.GetTempFileName() + ".html";
File.WriteAllText(tempPath, htmlContent, System.Text.Encoding.UTF8);

var renderer = new ChromePdfRenderer();
PdfDocument pdf = renderer.RenderHtmlFileAsPdf(tempPath);

File.Delete(tempPath);
pdf.SaveAs("output.pdf");
Imports System.IO
Imports System.Text
Imports IronPdf

Dim tempPath As String = Path.GetTempFileName() & ".html"
File.WriteAllText(tempPath, htmlContent, Encoding.UTF8)

Dim renderer As New ChromePdfRenderer()
Dim pdf As PdfDocument = renderer.RenderHtmlFileAsPdf(tempPath)

File.Delete(tempPath)
pdf.SaveAs("output.pdf")
$vbLabelText   $csharpLabel

Option 2: Convert emojis to numeric HTML entities

Replace emoji characters with their numeric HTML entity equivalents before rendering:


👋

😊

👋

😊
HTML

Option 1 avoids repeated entity lookups when the template contains many emoji characters.

Curtis Chau
Technical Writer

Curtis Chau holds a Bachelor’s degree in Computer Science (Carleton University) and specializes in front-end development with expertise in Node.js, TypeScript, JavaScript, and React. Passionate about crafting intuitive and aesthetically pleasing user interfaces, Curtis enjoys working with modern frameworks and creating well-structured, visually appealing manuals.

...

Read More
Ready to Get Started?
Nuget Downloads 19,345,590 | Version: 2026.6 just released
Still Scrolling Icon

Still Scrolling?

Want proof fast? PM > Install-Package IronPdf
run a sample watch your HTML become a PDF.