2.1.1 • Published 5 years ago

simple-html2pdf v2.1.1

Weekly downloads
195
License
MIT
Repository
github
Last release
5 years ago

Simple HTML2PDF

NPM Downloads NPM Version

Client-side Simple HTML-to-PDF using html2canvas and jsPDF.

Usage

$ npm install simple-html2pdf --save
# or
$ yarn add simple-html2pdf
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); });
<script src="https://unpkg.com/simple-html2pdf"></script>
<script>
  // html2pdf(element[, options][, callback])
</script>

Options

  • output string optional

jsPDF doc

Possible values are 'save', 'arraybuffer', 'blob', 'bloburi'/'bloburl', 'datauristring'/'dataurlstring', 'datauri'/'dataurl', 'dataurlnewwindow', 'pdfobjectnewwindow', 'pdfjsnewwindow'.

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

5 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.2.0

6 years ago

1.1.0

6 years ago

1.0.0

6 years ago

0.8.1

6 years ago

0.8.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago