npm.io
1.0.2 • Published 7 years ago

html-dom-to-pdf

Licence
MIT
Version
1.0.2
Deps
0
Size
24 kB
Vulns
0
Weekly
0

#html-dom-to-pdf

A library to convert HTML DOM element to PDF using javascript.

##Install

npm i html-dom-to-pdf

##Usage

import { HtmlToPdf } from 'html-dom-to-pdf';

let pdfConverter = new HtmlToPdf();
/* 
call the convertToPdf method with the following parameters
	domElement - The DOM element which you wish to convert to PDF
	FileName(optional) - Must be a string
	PageSize(optional) - A4 is set as default
	Margin(optional) - Must be a number specified in points
*/
pdfConverter.convertToPdf(domElement, 'Document.pdf', 'A4', 20);

Keywords