Back

Painless HTML to PDF converter?

Hi coding Elphas!I'm trying to generate pdf versions of e-vouchers to download and print. Here's a demo of what they look like on-screen (http://bit.ly/2DHJdMo) and printed (http://bit.ly/35XsqRx). It needs to be multipage, keep the styles, and render images. I've been struggling to build something with jsPDF and html2canvas for a few days now and want to move on to a different resource. I couldn't get the 2 page layout I wanted and it was struggling with the logos and voucher background imagesHave you ever built something like this and what do you recommend?I was thinking that Paperplane (https://www.paperplane.app/) looks promising, but I'd like to see if you have any input before I commit myself lol 😅Thanks!
Hi! I use the pdfkit ruby gem which utilizes wkhtmltopdf for rendering PDFs. Pretty sure it has packages for other frameworks/languages. I had a learning curve installing wkhtmltopdf and it’s many dependencies but otherwise it’s awesome for me.
Thanks, Amina! Yeah I I initially put wkhtmltopdf in the 'maybe' pile because it looks like so much work to set up, but i should probably take a closer look at it. It can't be worse than what I've tried already 😅
Hi Grace,I actually did this for my CV ( https://www.madelyneriksen.com/cv/ ) where the page on the web transforms to a different, one page layout when printing but shares the same HTML. You can check out the pdf at the bottom of the page to see the transformationTricks I used:* CSS grid on print styles is your BEST FRIEND. You can actually dictate what goes on what page by way of setting grid units equal to page size.* I used Pandoc with wk2pdf to render the page* Using a separate css sheet for both pages is crucial to keep your sanity!
Ah that's really cool Madelyn! It's interesting that you suggested css grid. Browser inconsistencies with print styles are bascially the whole reason why we're doing this pdf 😅 I initally discounted grid for that reason, but maybe it's worth taking a second look 🤔😄