Open MohsinUddinAbir opened 1 year ago
When downloading as pdf on localhost image shows fine but when downloading from VPS Ubuntu server image does not show, instead showing a squire box.
ejs .renderFile(path.join(__dirname, "../../utils/invoice.ejs"), {}) .then((html) => { let options = { httpHeaders: { "content-type": "application/pdf" }, orientation: "portrait", type: "pdf", format: "A4", }; pdf.create(html, options).toStream(function (err, stream) { stream.pipe(res); return; }); }) })
// invoice.ejs <div class="col"> <div class="invoice"> <img src="https://masterfileservice.com/storage/logo.png" /> <!-- Problem here, image showing on localhost but not showing on VPS Ubuntu server --> </div> </div>
When downloading as pdf on localhost image shows fine but when downloading from VPS Ubuntu server image does not show, instead showing a squire box.