Closed mcrowder65 closed 7 years ago
hi! there is no output path option because this package returns an object with an stream in it, you can save the PDF to a file using the following code:
var fs = require('fs')
var conversion = require("phantom-html-to-pdf")();
conversion({ html: "<h1>Hello World</h1>" }, function(err, pdf) {
var output = fs.createWriteStream('/path/to/your/output/directory/output.pdf')
console.log(pdf.logs);
console.log(pdf.numberOfPages);
pdf.stream.pipe(output);
});
Perfect, thank you
I'm not finding anywhere in the documentation or the code where I can specify the output path?