-
Notifications
You must be signed in to change notification settings - Fork 275
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to export Arabic and Chinese characters in pdf export #234
Comments
@sirishayalavarthi, the PDF converter uses default fonts for conversion and the default fonts do not support all unicode code points. I have not yet resolved this issue or figured out how to get around it. See #181 |
A solution to the font problem is to define an embedded TrueType font in the style or stylesheet and set the For example including Noto Serif/Sans/Mono fonts and adding However, the PDF converter requires TrueType fonts and For my test I used If the installation directory for the fonts is @font-face {
font-family: 'noto-cjk';
src: url('file:///usr/local/fonts/arialuni.ttf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'noto-serif';
src: url('file:///usr/local/fonts/NotoSerif-Regular.ttf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'noto-serif';
src: url('file:///usr/local/fonts/NotoSerif-Bold.ttf');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'noto-serif';
src: url('file:///usr/local/fonts/NotoSerif-BoldItalic.ttf');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'noto-serif';
src: url('file:///usr/local/fonts/NotoSerif-Italic.ttf');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'noto-sans';
src: url('file:///usr/local/fonts/NotoSans-Regular.ttf');
font-weight: normal;
font-style: normal;
}
@font-face {
font-family: 'noto-sans';
src: url('file:///usr/local/fonts/NotoSans-Bold.ttf');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'noto-sans';
src: url('file:///usr/local/fonts/NotoSans-BoldItalic.ttf');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'noto-sans';
src: url('file:///usr/local/fonts/NotoSans-Italic.ttf');
font-weight: normal;
font-style: italic;
}
@font-face {
font-family: 'noto-mono';
src: url('file:///usr/local/fonts/NotoMono-Regular.ttf');
font-weight: normal;
font-style: normal;
}
body {
font-family: 'noto-sans', 'noto-cjk', sans-serif;
overflow: hidden;
word-wrap: break-word;
font-size: 14px;
}
var,
code,
kbd,
pre {
font: 0.9em 'noto-mono', Consolas, "Liberation Mono", Menlo, Courier, monospace;
} Sample PdfConverter.java updated. Wiki Page with information added: PDF-Renderer-Converter |
I have tried to download some Arabic characters and Chinese characters showing ###
this is the code in the parser
public byte[] generateFile(final String markdown) {
here is HTML
Disclaimer: By reading this you agree that the template is working as per requirement
I’mmm ڛ ڛ 中文字符 ـش ـص Agree/Disagree bla bla bla
here is output pdf attached
download.pdf
this is how text in pdf looks
Disclaimer: By reading this you agree that the template is working as per requirement
I’mmm # # #### ## ## Agree/Disagree bla bla bla
The text was updated successfully, but these errors were encountered: