simple-html2pdf

Simple HTML-to-PDF using html2canvas and jsPDF.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
simple-html2pdf
2.1.15 years ago6 years agoMinified + gzip package size for simple-html2pdf in KB

Readme

Simple HTML2PDF
NPM Downloads NPM Version Client-side Simple HTML-to-PDF using html2canvas and jsPDF.

Usage

```shell $ npm install simple-html2pdf --save
or
$ yarn add simple-html2pdf ``` ```js import html2pdf from 'simple-html2pdf'; // html2pdf(element, options, callback) html2pdf(document.body, { filename: 'file.pdf', // default 'file.pdf' margin: 40, // default 40, page margin save: true, // default true: Save as file output: '', // default '', jsPDF output type smart: true // default true: Smartly adjust content width }, output => { console.log('finish!', output); }); ``` ```html ```

Options

  • output string optional
jsPDF doc Possible values are 'save', 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'.