Questions tagged [html-pdf]

167 questions
13
votes
3 answers

Convert HTML to PDF or PNG without headeless browser instance in NodeJS

TL;DR: Any suggestions in NodeJS to convert an HTML to PDF or PNG without any headless browser instances. Also anyone uses puppeteer in any production environment. I would like to know how the resource utilisations and performance of running…
Anand Prem
  • 397
  • 5
  • 15
11
votes
2 answers

html-pdf converters that are compatible with css flex-box

I am trying to put together a pdf from html template code. The problem I am running into is that the html-pdf converters I have tried don't format the css properly, I guess they are not yet compatible with css flex-box. I have looked at two…
11
votes
3 answers

Node html-pdf Auto configuration failed

I have a simple project using html-pdf package, I'd like to make a simple pdf file with this code : ... pdf.create(html).toStream(function(err, stream){ if (err) reject(err) ; else …
Bilel-Zheni
  • 1,202
  • 1
  • 6
  • 10
9
votes
1 answer

Unicode charsets issue with AWS Lambda

I am using AWS Lambda for generating pdf where html-pdf is the npm package. everything works flawless but the problem is with Hindi character. the characters appear gibberish and understandable something like as shown in attached image. Packages…
Deepak Mallah
  • 3,926
  • 4
  • 21
  • 26
8
votes
0 answers

"ERROR Error: write EPIPE" on AWS Lambda with html-pdf

I coded a NodeJS class which is supposed to create a PDF file out of a html string. The class is deployed on AWS Lambda. It is based on html-pdf (https://www.npmjs.com/package/html-pdf). const {readFileSync} = require('fs'); const pdf =…
juliusphysics
  • 163
  • 1
  • 6
6
votes
3 answers

How to generate a PDF with a given template, with dynamic data in Python or NodeJS to be deployed on AWS

Looking for recommendation of a library in Python(first preference) or NodeJS that can generate a pdf file preferably from dynamic html template to be run in AWS. Requirement is to generate invoice pdf to be sent to customers. Have come across below…
bijalscm
  • 445
  • 3
  • 5
  • 14
5
votes
1 answer

Getting error While Creating pdf using html-pdf

Trying to generate pdf using html-pdf in node js but getting the below error after certain records: TypeError: Cannot read property 'on' of undefined` events.js:183 throw er; // Unhandled 'error' event ^ Error: spawn…
5
votes
3 answers

AWS lambda html-pdf phantomjs "Error: write EPIPE" on NodeJS 12.x

I have been using html-pdf (phantomjs) for creating PDF on AWS Lambda with NodeJS 8.0 and it was working fine. Since AWS Lambda has stopped support on NodeJS 8.0 we have updated our NodeJS version to the latest 12.x and we are now getting the…
4
votes
4 answers

page-break not working in html-pdf coverter in nodejs

I am using html-pdf 2.2.0 module to convert my html in pdf. I am using table with multiple rows so I want to use page-break so then a single row does not divide in two pages but its not working when converting it to pdf. Below is the code…
Anuj Kumar Pal
  • 142
  • 2
  • 12
4
votes
1 answer

How to record page numbers html-pdf node.js?

I'm using html-pdf for node.js to create a pdf from html. Built into html-pdf is the ability to add page numbers to the footers. I want to record those page numbers somehow, maybe in an array. This is my current code: let index = 0; let myIndex =…
4
votes
1 answer

Can't install or run html-pdf on nodejs

I have a application that generates PDF's using html-pdf on nodejs, but after I made a deploy to the production server, I'm not able to generate. It gives this error: 'html-pdf: Failed to load PhantomJS module. You have to set the path to the…
lufizi
  • 403
  • 2
  • 7
  • 14
4
votes
0 answers

html-pdf npm library gives weird output on Linux Server?

I am generating PDF from HTML and that worked fine on my local machine, which has Windows as OS. But now I deploy my application on a Linux server where it gives weird output as follows. . Server Side Code (Node) const htmlPdf =…
4
votes
1 answer

CSS Background property not working in pdfHTML iText7 using java

I am trying to convert html into a pdf with the help of iText by using its method HtmlConverter.convertToPdf(htmlString, pdfDocument, converterProp); But it seems like this service is not honoring css properties defined in html. Here is my html…
Adhum
  • 117
  • 1
  • 12
4
votes
0 answers

node html-pdf creates pdf with no/blank content

I am having trouble creating a pdf that has content. I am running node/express with html-pdf to take a react Dom node converted to a string, then piped back to the client-side to save the Blob as a pdf. That pdf is blank, but has multiple pages,…
Fred Chapman
  • 133
  • 1
  • 10
3
votes
1 answer

HTML-PDF npm working on localhost but not on IP Staging Server?

Project Details: I have a full stack project using ReactJS for the View, NodeJS for back-end and MySQL for database. On my webserver, I'm using NGINX for the web server, and PM2 as a reverse-proxy to run my node instance. The Objective: What I'm…
InoCuro
  • 135
  • 12
1
2 3
11 12