* 0 - default
* 1 - none
* 2 - minimum
+ * `pageSize` String - Specify page size of the generated PDF
+ * `A4`
+ * `A3`
+ * `Legal`
+ * `Letter`
+ * `Tabloid`
* `printBackground` Boolean - Whether to print CSS backgrounds.
* `printSelectionOnly` Boolean - Whether to print selection only.
* `landscape` Boolean - `true` for landscape, `false` for portrait.
// Use default printing options
win.webContents.printToPDF({}, function(error, data) {
if (error) throw error;
- fs.writeFile(dist, data, function(error) {
+ fs.writeFile("/tmp/print.pdf", data, function(error) {
if (err)
- alert('write pdf file error', error);
+ throw error;
+ console.log("Write PDF successfully.");
})
})
});