dom-to-pdf
Advanced tools
Comparing version 0.2.0 to 0.2.1
@@ -87,4 +87,5 @@ let _cloneNode; | ||
let proxyUrl; | ||
let compression = 'NONE'; | ||
({filename, excludeClassNames = [], overrideWidth, proxyUrl} = options); | ||
({filename, excludeClassNames = [], overrideWidth, proxyUrl, compression} = options); | ||
@@ -227,3 +228,3 @@ overlayCSS = { | ||
imgData = pageCanvas.toDataURL('image/PNG'); | ||
pdf.addImage(imgData, 'PNG', 0, 0, a4Width, pageHeight); | ||
pdf.addImage(imgData, 'PNG', 0, 0, a4Width, pageHeight, undefined, compression); | ||
++page; | ||
@@ -230,0 +231,0 @@ } |
{ | ||
"name": "dom-to-pdf", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"description": "Generates a printable paginated pdf from DOM node using HTML5 canvas and svg.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -29,3 +29,5 @@ # dom-to-pdf | ||
* `proxyUrl` - string, e.g. `/api/proxyImage?url=`, a route in your app which renders images on your domain in order to avoid problems with CORS with the images on a DOM | ||
* `compression` - string, compression of the generated image, can have the values 'NONE', 'FAST', 'MEDIUM' and 'SLOW'. (default is 'NONE') | ||
## Support | ||
@@ -32,0 +34,0 @@ <a href='https://ko-fi.com/Y8Y5ZDQP' target='_blank'><img height='36' style='border:0px;height:36px;' src='https://az743702.vo.msecnd.net/cdn/kofi4.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a> |
10102
234
65