pdfmake-chinese-songti-font

1.0.1 • Public • Published

Support Chinese Fonts in PDFmake library.

Getting Started

  1. support client/server side export PDF by pdfmake.js
  2. support pdf export with chinese fonts FangZhen
  3. limit the package size

Install

$ npm install pdfmake-chinese-songti-font

Usage

import * as pdfMake from 'pdfmake-chinese-songti-font/pdfmake.min';
import * as pdfFonts from 'pdfmake-chinese-songti-font/vfs_fonts';

pdfMake.vfs = pdfFonts.pdfMake.vfs;
pdfMake.fonts = {
  st: {
    normal: 'st.ttf',
    bold: 'st.ttf',
    italics: 'st.ttf',
    bolditalics: 'st.ttf'
  },
};

Then, to use it

const docDefinition = {
    content: [
        "www测试",
        "测试2",
    ],
    defaultStyle: {
        font: 'st',
    }
};
pdfMake.createPdf(docDefinition);

MIT License

Readme

Keywords

Package Sidebar

Install

npm i pdfmake-chinese-songti-font

Weekly Downloads

2

Version

1.0.1

License

MIT

Unpacked Size

30.8 MB

Total Files

4

Last publish

Collaborators

  • zbclqy1314