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.
RenderHtmlAsPdf() and RenderHtmlFileAsPdf() feed the same embedded Chromium engine, so switching between string and file rendering does not change emoji handling. Emoji are dropped (or rendered as empty boxes) when the rendering host has no emoji-capable font installed, and the problem is made worse when the input encoding is not declared. The fix is to declare UTF-8 encoding and ensure an emoji-capable font is available to the renderer.
Solution
Option 1: Declare UTF-8 input encoding
Set the InputEncoding property on the renderer so the engine interprets the HTML as UTF-8:
using System.Text;
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.InputEncoding = Encoding.UTF8;
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
using System.Text;
var renderer = new ChromePdfRenderer();
renderer.RenderingOptions.InputEncoding = Encoding.UTF8;
PdfDocument pdf = renderer.RenderHtmlAsPdf(htmlContent);
pdf.SaveAs("output.pdf");
Imports System.Text
Dim renderer As New ChromePdfRenderer()
renderer.RenderingOptions.InputEncoding = Encoding.UTF8
Dim pdf As PdfDocument = renderer.RenderHtmlAsPdf(htmlContent)
pdf.SaveAs("output.pdf")
You can also declare the encoding inside the HTML itself with a meta charset tag in the <head>:
<meta charset="UTF-8">
<meta charset="UTF-8">
Option 2: Install an emoji-capable font
Even with correct encoding, emoji only appear if the rendering host has a font that includes emoji glyphs. On servers without a desktop environment (for example, minimal Linux containers), install an emoji font such as Noto Color Emoji and make it available to the renderer. Without an emoji-capable font, the characters render as empty boxes or are dropped from the output.

