Skip to content

Instantly share code, notes, and snippets.

@jjsub
Last active December 11, 2018 17:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jjsub/989d90756790d9e5042ed60990ec5da3 to your computer and use it in GitHub Desktop.
Save jjsub/989d90756790d9e5042ed60990ec5da3 to your computer and use it in GitHub Desktop.
$ npm install pdfmake
//It's very important to follow this order
import pdfFonts from 'pdfmake/build/vfs_fonts';
import pdfMake from 'pdfmake/build/pdfmake';
//It's a important one too
pdfMake.vfs = pdfFonts.pdfMake.vfs;
// Methods:
// How to generate a black page
{ text: '', style: 'header' , pageBreak:'before'}
// Margin:Here is how it works… is not pure like CSS
`margin: [0,5,0,100]` => margin: [⬅️, ⬆️, ➡️, ⬇️ ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment