Skip to content
Getprintoza
Features How it works Pricing FAQ API docs
Log in Get API key

Emoji show as empty boxes in a Puppeteer PDF on Docker or AWS Lambda

You generate a PDF with Puppeteer. On your laptop the emoji look fine. In production, in a Docker container or on AWS Lambda, they turn into empty squares. Your code is not broken: the machine that runs Chromium has no font that contains those characters. This page shows how to confirm that and how to add an emoji font.

Why it happens Check the fonts Docker AWS Lambda Still boxes? One API call FAQ

Why it happens

Chromium draws text with the fonts installed on the operating system, plus any web fonts your page loads. When no font has a glyph for a character, Chromium draws a placeholder box. Slim container images and the base Lambda environment ship with very few fonts and usually no emoji font. Your laptop has one, so the same HTML looks right there.

This is the same root cause as missing Arabic, Chinese or Hindi text (see our guide to empty boxes in Puppeteer PDFs), but emoji need their own font, such as Noto Color Emoji. The text fonts that fix other scripts do not contain them.

The same fix is reported in the Grover (Rails and Puppeteer) issue “Font and emojis not rendering docker”, where installing the fonts-noto-color-emoji package solved it, and in the @sparticuz/chromium issue about fonts on AWS Lambda.

Step 1: check that it is a font problem

Run this inside the same container or environment that renders the PDF:

fc-list | grep -i emoji

If nothing is printed, the machine has no emoji font. If the shell says fc-list is not found, the fontconfig package is missing as well; the Dockerfile below installs it.

Fix A: Docker (Debian or Ubuntu based image)

Add the emoji font to the image that runs Chrome. fonts-noto-color-emoji is the Debian and Ubuntu package name for Noto Color Emoji:

FROM node:20-bookworm-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
      fontconfig fonts-noto-color-emoji \
    && fc-cache -f \
    && rm -rf /var/lib/apt/lists/*

Rebuild the image, start a new container and run the fc-list check again. It should now print a Noto Color Emoji line. Then render a page with a few emoji and look at the PDF.

Other base images use other package managers and other package names. Check the name for your distribution before you copy the line above.

Fix B: AWS Lambda

The base Lambda environment has no emoji font, so you have to bring one. Two approaches are reported.

1. Put the font in a layer. The README of @sparticuz/chromium says Lambda has no fonts of its own and that the package ships only Open Sans, which covers Latin, Greek and Cyrillic. It lets you add .ttf files in a folder named fonts or .fonts, zipped and uploaded as a Lambda layer, and its own example uses NotoColorEmoji.ttf. The folder must sit at the top of the zip. One commenter in the issue linked above named the zip wrongly at first, and another said the structure inside the zip has to match the README.

fonts.zip
└── fonts/
    └── NotoColorEmoji.ttf

2. Use a container image for Lambda. One commenter in the same issue used a Node.js container image, installed Noto fonts with yum, and only got them to load after setting FONTCONFIG_PATH to /etc/fonts before the library was loaded. That is one report from one setup, so treat it as something to try, not a rule. Amazon Linux uses different package names than Debian, so the Dockerfile from Fix A does not apply there.

After you publish the new layer or image, check that the function really points at the new layer version or image. A function that still uses the old one keeps showing boxes.

Still seeing boxes?

  • Did you rebuild and redeploy the image, not just restart the container?
  • Does fc-list show the emoji font inside the running container, not only on your machine?
  • Is the HTML saved as UTF-8 with <meta charset="utf-8">? A replacement character (�) instead of a box points to an encoding problem, not a missing font.
  • Do Arabic, Chinese or Devanagari characters in the same page fail as well? Then the machine is missing text fonts too. See the guides on Chinese and Japanese and Arabic and Hebrew.

Skip the font setup: one API call

Getprintoza is an HTML to PDF API that runs real Chromium with fonts for 12 languages already installed, so you do not keep a font setup for each environment. We rendered a test page on Getprintoza on 23 October 2026 with faces, symbols, objects, skin-tone variants and flags, and all of them came out as colored emoji. That was one test document, so try your own before you rely on it.

curl -X POST https://getprintoza.com/v1/convert \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"html": "<meta charset=\"utf-8\"><h1>Release notes 🚀</h1><p>Done ✅ Thanks 🎉</p>"}' \
  --output notes.pdf

The Free plan includes 50 PDFs a month and needs no card. Get a free API key, read the API documentation or see the pricing.

FAQ

Why do emoji work on my laptop but not in Docker?
Your laptop has an emoji font. A slim image usually has none, so Chromium draws boxes.

Which package gives me emoji on Debian or Ubuntu?
fonts-noto-color-emoji. Install it together with fontconfig and rebuild the image.

Do the Noto fonts I installed for Arabic or Chinese include emoji?
No. Emoji come from a separate font, so install an emoji font as well.

How do I add an emoji font on AWS Lambda?
Add the font file to a layer, as described in the @sparticuz/chromium README, or build a container image that contains it. Then check that the function uses the new layer version or image.

Getprintoza

HTML to PDF for every language.

Product

Features Pricing FAQ API docs

Legal

Terms Privacy Policy Refunds

Help

support@getprintoza.com
© 2026 Getprintoza. All rights reserved.Twelve languages, right-to-left included.