MDPDFOpen the converter →

Convert Markdown with Chinese (CJK) to PDF without broken characters

A practical guide · about 3 min read

You write a document with some Chinese in it, export it to PDF, and the Chinese is gone — replaced by empty boxes (□□□), question marks, or just blank space. The English came through fine. This is one of the most common complaints about Markdown-to-PDF tools, and it has nothing to do with your text being wrong. It's a font problem.

Why the characters turn into boxes

A PDF doesn't store letters as pictures — it stores characters plus a font that knows how to draw them. If the font has no glyph for a character, the reader shows a fallback box instead. Many PDF generators ship with a single Latin font (something like Helvetica) that simply has no Chinese, Japanese or Korean glyphs in it. So your 中文 has nothing to render with, and you get □□.

The same applies to Japanese (日本語) and Korean (한국어), and to less common scripts too. The shorthand for all three is CJK.

The fix: use a font that has the glyphs

There are two ways to make sure the right font is available.

Option 1 — convert in the browser

Your computer already has CJK fonts installed (that's why you can read Chinese web pages). A browser-based converter can use those fonts directly when it prints to PDF, so CJK text just works with nothing to configure. That's the simplest route and the one this tool takes — paste text in any language, and it renders with whatever fonts your system has.

A quick way to test any tool: drop in a line like this and export it.

# 测试 Test テスト 테스트

这一段中文应该完整出现在 PDF 里,不应该变成方框。

If the PDF shows the characters cleanly, the tool handles CJK. If you see boxes, it doesn't, and no amount of editing your text will help.

Option 2 — tell a command-line tool which font to use

If you use Pandoc, you have to point it at a CJK-capable font explicitly, and use an engine that supports system fonts:

pandoc doc.md -o doc.pdf \
  --pdf-engine=xelatex \
  -V mainfont="Noto Sans CJK SC"

Swap Noto Sans CJK SC for whatever CJK font you have — PingFang SC on a Mac, Microsoft YaHei on Windows, or install the free Noto Sans CJK family. Without the --pdf-engine=xelatex part, the default engine won't load the font and you're back to boxes.

Mixing languages in one document

You usually don't need to do anything special for mixed English-and-Chinese text. A good CJK font includes Latin letters too, and browsers fall back gracefully between fonts. Where it gets fussy is fine typographic control — matching the weight of your English font to your Chinese font — but for a normal document that you just need to read and print, the defaults are fine.

The short version

Convert a Chinese document now

CJK renders with your system fonts. Free, in your browser, nothing uploaded.

Open the converter