Given a complicated view mixed of HTML & various JavaScript widgets that range from SVG to canvas. How do companies make beautiful PDF reports?<p>Started with wkhtmltopdf, then started investigating the SASS industry like DocRaptor and the parent PrinceXML.<p>Started messing with headless Chrome to just take screenshots of the widgets and combine those images into a PDF, but its quite hacky.<p>What do people do in situations like this?
Where we can, we use LaTeX templates. In other places we use Python to generate Word (python-docx) or PowerPoint presentations (python-pptx).<p>A few years ago I had success generating WYSIWYG PDFs using HTML5 and the printable classes in CSS Bootstrap (<a href="https://getbootstrap.com);" rel="nofollow">https://getbootstrap.com);</a> in that particular case I used CherryPy (<a href="https://cherrypy.org" rel="nofollow">https://cherrypy.org</a>) under IIS and sent the rendered HTML to pdfkit (<a href="https://pypi.org/project/pdfkit/" rel="nofollow">https://pypi.org/project/pdfkit/</a>) to generate PDFs. That was preferred over relying on the user to print to the page to PDF from their web browser.
There are libraries like ruby's prawn[1].<p>[1] <a href="https://github.com/prawnpdf/prawn" rel="nofollow">https://github.com/prawnpdf/prawn</a>