You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I have tried the to push the customHeaders into global config or inside conversion option but still found that no custom headers received from server. My code is something like below:
var conversion = require("phantom-html-to-pdf")({
timeout: 120000,
waitForJS: true,
waitForJSVarName: "PHANTOM_HTML_TO_PDF_READY",
printDelay: 5000,
customHeaders: { //put here is not working
"Authorization": token[0]
}
});
conversion({
url: url,
footer: '<div style="font-family: \'Source Sans Pro\',sans-serif;text-align:center">Page {#pageNum} of {#numPages}</div>',
customHeaders: { //put here is also not working
"Authorization": token[0]
}
}, function (err, pdf) {
console.log("err => " + err);
console.log("pdf => " + pdf);
var output = fs.createWriteStream(path)
console.log(pdf.logs);
console.log(pdf.numberOfPages);
// since pdf.stream is a node.js stream you can use it
// to save the pdf to a file (like in this example) or to
// respond an http request.
pdf.stream.pipe(output);
callback(null, path);
});
How can i done this? thanks!
The text was updated successfully, but these errors were encountered:
Hi, I have tried the to push the customHeaders into global config or inside conversion option but still found that no custom headers received from server. My code is something like below:
How can i done this? thanks!
The text was updated successfully, but these errors were encountered: