marcbachmann / node-html-pdf

This repo isn't maintained anymore as phantomjs got dreprecated a long time ago. Please migrate to headless chrome/puppeteer.
MIT License
3.56k stars 545 forks source link

PDF document gets cut-off on live server #617

Open vamsi-kleargroup opened 3 years ago

vamsi-kleargroup commented 3 years ago

I use a <table> to render out a report in PDF. The out PDF gets successfully uploaded to AWS S3 storage when tested out locally. But the code when deployed to AWS doesn't yield the same result. The generated PDF is getting Chopped off midway on the horizontal axis. image

dmchandru commented 3 years ago

@vamsi-kleargroup I am also facing the same issue. Did you find any workaround to fix this issue?

vamsi-kleargroup commented 3 years ago

@dmchandru nope.

dmchandru commented 3 years ago

@vamsi-kleargroup What is node version used in AWS?

dmchandru commented 3 years ago

@vamsi-kleargroup Reduce the font-size in CSS or inline-styles max = 12px

j45t7 commented 3 years ago

Same problem, any idea how to solved it?

ivex001 commented 3 years ago

I have the same problem. i tried several options and two different html but in all cases it gets cut off

dmchandru commented 3 years ago

@j45t7 @ivex001 Reduce the font-size in your html template as <=12px.

ivex001 commented 3 years ago

@j45t7 @ivex001 Reduce the font-size in your html template as <=12px.

Indeed was a problem of font size. Mine was set to "em" and i changed them to "12px" and "14px" and now it's working. Thank you @dmchandru