Open lofti198 opened 2 years ago
Guess Ive found the answer var pdf = require("pdf-creator-node");
// Read HTML Template
var html = <h1>test</h1>
var options = { format: "A3", orientation: "portrait", border: "10mm", };
var document = { html: html, data: { }, path: "./output.pdf", type: "", // "stream" || "buffer" || "" ("" defaults to pdf) };
console.log(document); pdf .create(document, options) .then((res) => { console.log(res); }) .catch((error) => { console.error(error); });
now how can I put images into output pdf file? I mean in what format they must exist into the input html? Just like tag? <img... ?
Insert img tag with base64 data, instead of file address
Hi! Any example how to save just html code to pdf, not using template file?