Francois
Francois9mo ago

HTML to PDF bigger images

I use the HTML to PDF node, it works fine with images of size 1024x1024. I tested 32 pages (a book can have 60 pages), where each page have an image. But, I generate pdf for printing books with lulu.com. I need images of 4096x4096 to match the lulu's requirements. With that size, it generates the pdf, but when I try to open it, I get 'Error Failed to load PDF document'. Is there a limit on your server for Puppeteer or something?
18 Replies
Gaurav Chadha
Gaurav Chadha9mo ago
cc @Deepanshu, can you help checking if there is any limit on puppeteer to process images with larger size? Or something we can update in puppeteer pdf runner?
Deepanshu
Deepanshu9mo ago
@Francois can you share the details of parameter you are trying to use for the HTML to PDF node?
Francois
FrancoisOP9mo ago
The pdfOptions for Pupeteer? Something like that: const pdfOptions = { width: '8.75in', height: '8.75in' }; here's the node logic: https://docs.google.com/document/d/1v5LBRb_APotbxb67KmOVLrIbZgohIxePmxQfQzuXsw8/edit?usp=sharing or if it helps, my Buildship link: https://buildship.app/p/buildship-0i2pvh/workflow/n8jY3VGNdhz2xxOS22j4
Deepanshu
Deepanshu9mo ago
@Francois can you share sample input for data as mentioned in your node logic?
Francois
FrancoisOP9mo ago
Yes just added in the doc @Deepanshu let me know if you need anything else to test, thanks! No need to find a solution, I use images of 3072x3072 now and it works fine!
Francois
FrancoisOP8mo ago
@Deepanshu it's me again... I don't understand, it used to work with 3072x3072 images but now it doesn't. If I have 15 images, it works when it's the same image repeated (it would never happen but I wanted to test if my link is the problem, it appears it's not), but when I have 15 different images, the pdf link is generated but I can't open it. Updated the doc so you can test it: https://docs.google.com/document/d/1v5LBRb_APotbxb67KmOVLrIbZgohIxePmxQfQzuXsw8/edit?usp=sharing
No description
Francois
FrancoisOP8mo ago
I'm really close to launch the beta of my software, would be great if Buildship don't break in the future with the pdf generations, I want to be sure it will work no matter the number of images and pdf
Deepanshu
Deepanshu8mo ago
Hey @Francois , can you please send a support request through buildship app with these details? Also, include the discord message link!.
Francois
FrancoisOP8mo ago
Perfect, just sent it hey! It's been almost a week, did you find something?
Gaurav Chadha
Gaurav Chadha8mo ago
Hi @Francois, yes, we have progress on the above issue, we'll be releasing the updated version for this soon, thank you for your patience.
Francois
FrancoisOP8mo ago
No prob, thanks!
Deepanshu
Deepanshu8mo ago
Hey @Francois , the issue occurs with the invalid pdf because the puppeteer timeouts when setting the html-content for different-images-case, the issue will be resolved after passing custom navigationTimeout param in request-body. Let me know if above works!
Deepanshu
Deepanshu8mo ago
I have slightly updated your node-logic^
Francois
FrancoisOP8mo ago
Thanks! But weird, just tested it and I still get the same thing, it generate a link but 'Failed to load PDF document' error message
Deepanshu
Deepanshu8mo ago
Can you try to log the response and share the data?
Francois
FrancoisOP8mo ago
You mean the links generated?
Francois
FrancoisOP8mo ago
Added this, but still only get the links
No description
No description
Francois
FrancoisOP7mo ago
hey @Deepanshu , do you have more details on what you need? Thanks