PDFMake Chinese
Getting Started
pdfmake is library for PDF printing in pure JavaScript.
By default pdfmake uses Roboto font, which does not support Chinese characters.
This package is an extension for adding Chinese character support. It comes with a 方正黑体简体 font, which has 4 styles: Regular, Bold, Italic and Bold Italic.
Installation
Install with NPM:
$ npm install pdfmake-chinese --save
Install with Yarn:
$ yarn add pdfmake-chinese
Install with Bower:
$ bower install pdfmake-chinese --save
Usage
Use with ES6
;; pdfMakevfs = pdfFontspdfMakevfs; var docDefinition = content: '我支持中文啦' ; pdfMakefonts = Roboto: normal: 'fonts/Roboto-Regular.ttf' bold: 'fonts/Roboto-Medium.ttf' italics: 'fonts/Roboto-Italic.ttf' bolditalics: 'fonts/Roboto-MediumItalic.ttf' 方正黑体简体: normal: '方正黑体简体.TTF' bold: '方正黑体简体.TTF' italics: '方正黑体简体.TTF' bolditalics: '方正黑体简体.TTF' ; defaultStyle: font: '方正黑体简体' }; pdfMake;
Supported Languages
- Chinese