Qkyrie / Markdown2Pdf

A simple library to convert markdown to pdf using Java

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why chinese MardownFile can't convert to pdf

Yfygithub opened this issue · comments

i try to convert chinese MardownFile to pdf but get messy code in pdf,what‘s wrong with it?

you should make sure you have the chinese font-family, if not, add it
ITextFontResolver fontResolver = renderer.getFontResolver(); fontResolver.addFont("font/simsun.ttc", BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED);

and the html should add follow code
`

<style type="text/css">body {font-family: SimSun}</style>

`