Questions tagged [node-html-pdf]

64 questions
0
votes
1 answer

PDF returned from Remote method Loopback is corrupted

I am trying to return a file from my remote method: Visitor.remoteMethod('getVisitorsPDF', { description: 'Get visitors list in PDF file', accepts: [ { arg: 'res', type: 'object', http: { source: 'res' } }, { arg: 'dateInStart',…
Ali Yar Khan
  • 1,231
  • 2
  • 11
  • 33
0
votes
2 answers

Mocking html-pdf using Jest

I am using the html-pdf package in my nodejs code (not in Typescript). Now, this package has a create() function which is chained with the toBuffer() function. I am unit testing my code using Jest and want to mock this call…
0
votes
2 answers

node-html-pdf not show image in PDF

I am trying generate PDF from simple code, but no show image. Help me please. code pdf.create("Hello ").toFile('./pdf/cotizacion.pdf', function (err) { if (err) { console.log(err); } else { …
0
votes
1 answer

How to generate PDF from html with chart and google map in NodeJS

I want to export the HTML into PDF in Nodejs. My HTML file having a chart, graphs, images, and table data. I've created HTML with handlebar parsing as well as creating the one public URL for HTML of pdf. I've tried to export HTML to pdf using…
Keyur Chavda-kc1994
  • 1,045
  • 1
  • 13
  • 28
0
votes
0 answers

node.js SET HEADER ERROR ON upload to any host

I have a problem with node.js html-pdf, its give me the error SET HEADER ERROR, when I upload a file to any host like Amazon EC2 its give me Error: Can't set headers after they are sent to the client, but it works very will on my device host…
0
votes
1 answer

PDF file generated from AWS Lambda has all Blank pages

All pages of PDF file that I am generating from my NestJS based AWS Lambda function are blank. When I generate PDF file and attach it to an email then I receive the correct file with all content in it. But when I download the same file in browser…
0
votes
1 answer

NodeJS - npm package - html-pdf alternate

I am creating a pdf from a static HTML code in nodejs using html-pdf npm package. But it is critical severity vulnerability. I want to change this package. Is there any package available to convert an HTML code to PDF on the server-side.
Vinodh Ram
  • 709
  • 1
  • 9
  • 22
0
votes
0 answers

NodeJS generate pdf and save to firebase storage. Can't open file

I've been stuck on this problem for awhile now and can't seem to figure out why this file isn't being uploaded to firebase correctly. I'm using the code below in firebase functions to generate a document, then I convert that document to a stream,…
0
votes
1 answer

html-pdf text-align: justify not working?

I'm using html-pdf in Node.js to convert html text to a pdf. text-align: left, center, and right work. But text-align: justify does not work. When text-align is justified, it exports the text aligned left. Here's the HTML code:
Page COW
  • 515
  • 13
  • 31
0
votes
1 answer

how to fix html-pdf node module arbitrary file read vulnerability?

I want to convert html to pdf document. Using html-pdf npm module, which contain vulnerability. https://snyk.io/vuln/SNYK-JS-HTMLPDF-467248 Please suggest the alternative solutions.
Nadhas
  • 5,421
  • 2
  • 28
  • 42
0
votes
0 answers

Node JS / Generate PDF server side

I need to create PDF files via server side. I have a pug file with the HTML and it's working as expected (the format and the content is perfect). Also, I have a service that gets the HTML from the pug file in a string. The problem is that I'm facing…
Jose R. Chacón
  • 99
  • 1
  • 12
0
votes
1 answer

How to render html tags/to generate dynamic tables using html-pdf

I want to generate a table from node.js to be printed in pdf format using html-pdf library but unfortunately my code won't work. The problem is because the html-pdf won't execute html tags. It execute the tags as string instead. var tableBody =…
dede
  • 823
  • 4
  • 13
  • 24
0
votes
1 answer

Check Mailbox in a Loop, Read Email and Create PDF

I have a code that reads unseen emails and creates pdf. The problem is; I cannot pull email if any new unseen email exist without executing code again. var Imap = require('imap'); const MailParser = require('mailparser').MailParser; var pdf =…
ilvthsgm
  • 586
  • 1
  • 8
  • 26
0
votes
2 answers

Dynamic PDF with html-pdf npm

When creating a Dynamic PDF in node using html-pdf, the content became cut at the end of pages. In html, added Code that used to create PDF is pdf.create(finalstr, { format: "A3", "footer": { …
Ashwanth Madhav
  • 1,084
  • 1
  • 9
  • 21
0
votes
1 answer

Node js html-pdf command not working from PHP

I am trying to create a PDF file from a HTML for which I am using npm html-pdf package. When I am trying to run this command from terminal html-pdf ticket-2.html ticketpdf.pdf its working fine and PDF is creating successfully.But when I am trying…
user2439124
  • 291
  • 1
  • 3
  • 16