Questions tagged [html-pdf]
167 questions
0
votes
0 answers
How can I render images in the footer and header of my pdf in NESTJS / html-pdf?
I am trying to generate a pdf through this service in NestJS, the file is generated correctly, the problem is when I try to use an image as logo and an image in the footer, I am using the html-pdf library and I have followed its documentation For…

Daniel
- 1
0
votes
1 answer
TypeError: Cannot read properties of undefined (reading 'pipe') in Production(Heroku server)
I have the whole thing working locally but fails as soon as its on heroku server.
implementation
await pdf.create(pdfTemplate(data)).toStream(async function (err, stream) {
await stream.pipe(fs.createWriteStream(`${req.body.phone}.pdf`));
…

Afolabi Opeyemi
- 1
- 1
0
votes
0 answers
Failed to load PhantomJS module
I am facing the issue
html-pdf: Failed to load PhantomJS module. You have to set the path to the PhantomJS binary using 'options.phantomPath'\\nAssertionError [ERR_ASSERTION]: html-pdf: Failed to load PhantomJS module. You have to set the path to…

Vishnupriya
- 148
- 9
0
votes
0 answers
pdf generated by html-pdf looks different on localhost than deployed link
I'm generating a pdf from the backend using html-pdf. The pdf looks different on local than on the deployed link on the aws ec2 server. I think pdf is not able to take inline css.
Ec2 server generated image
Locally generatedimage
I want same css as…
0
votes
0 answers
c# Itext7 - pdfHTML How to set SetMargins
My Code
var path = Path.Combine(Directory.GetCurrentDirectory(), "Untitled-1.html");
string htmlString = File.ReadAllText(path);
Document document = null;
using (var stream = new MemoryStream())
{
using…
0
votes
0 answers
Different PDFs generated from the same template using html-pdf and ejs Rendering
I am having a weird problem.
I have a node application which has a .html template and that template is rendered to a pdf using ejs.renderFile and html-pdf library, you can check the following code:
ejs.renderFile("./templates/template.html", data,…

Shivam Verma
- 3
- 5
0
votes
1 answer
How to embed an HTML in a single Page using html-pdf library [Node.js]
I am creating a pdf file using html-pdf librarby in node js from an html file.
The Pdf looks like this
My code is
const createSettlementPDFFile = function (htmlString, fileName) {
return new Promise((resolve, reject) => {
let filePath =…

Aakarshit
- 49
- 6
0
votes
0 answers
jsPDF breaks document Design
I'm using jsPDF to generate pdf from html card like this one below
C Cabdiraxman
- 21
- 5

C Cabdiraxman
- 21
- 5
0
votes
1 answer
SelectPDF HtmlPdf.ConvertHtmlString method failing in azure-"Error Occurred Trying to Start Process Chrome.exe". Side By Side config is incorrect
I have a .net core 3.1 web app running in an azure web app service using selectpdf with HtmlPdf() to convert a razor view output to PDF. It has been working fine on .net 3.1. I had to upgrade the app service to .net 6 recently. Although it works in…

elitz
- 51
- 3
0
votes
0 answers
Can I view my PDF whilst I edit it? (I'm using HTML and DOMPDF to create the PDF
I am currently creating a PDF and am finding it annoying to constantly make a change, download the PDF and then view it from my website. Is there a better way that I create this PDF, which is quicker than this process?
I initially tried just…

Columbian Toad
- 21
- 2
0
votes
1 answer
iTextPDF pdfHTML add on. Unable to retrieve image
Im following the tutorial given here : (https://kb.itextpdf.com/home/it7kb/ebooks/itext-7-converting-html-to-pdf-with-pdfhtml/chapter-1-hello-html-to-pdf) to generate a PDF from HTML using IText's pdfHTML add…

naruto45
- 1
0
votes
0 answers
Error while create pdf stream using html-pdf npm package on Ubuntu Docker
I am getting below error while converting html to pdf using html-pdf npm package on Ubuntu Docker (however it's working fine in my local system Windows and Mac both) -
node:events:491
throw er; // Unhandled 'error' event
^
Error:…

Hemant
- 1
- 1
0
votes
0 answers
While converting HTML to pdf, the page is stuck in loading at create pdf
While trying to generate a pdf file with the below code, the browser is stuck loading
from io import BytesIO
from django.http import HttpResponse
from django.template.loader import get_template
from xhtml2pdf.pisa import pisa
def…

Hiba
- 1
- 1
0
votes
0 answers
PhantomJS errors out on EBS
I'm using html-pdf to generate and pdf on my nodejs app, which is then being uploaded to S3. This works fine on my local, but I face this error
Error: spawn /usr/local/bin/phantomjs ENOENT
when running the deployed app on EBS. I have added a config…

Karthik
- 114
- 2
- 11
0
votes
1 answer
Repeat table header in html-pdf library while creating PDF from data in node.js
I have one scenario in which I have multiple tables to print by creating PDF. For say, I have 4 tables together and the third table is having number of rows resulting in page change. I want to repeat that table's header on the next page also before…

Shubham Kareer
- 25
- 6