Convert View with CSS, JS and PDF Images

2

I have a view in Laravel where I load various graphics. This view is made up of HTML, Images, CSS and JS.

I need to convert (export) this page to PDF via a JS or PHP function.

I can not find a library that faithfully "copies" the page and exports it in PDF. The closest I came was DomPDF, but more mess ...

I tried using DomPDF and jsPSF .

How could I do this?

I was giving a read on this post: link

But does this work on a hosted server?

    
asked by anonymous 09.08.2016 / 19:37

2 answers

0

I recommend using mPDF to export html content into PDF. But depending on the complexity of html, the generation of the html may take a while, as well as consuming a lot of server processing.

link

    
15.09.2016 / 22:36
0

I used the barryvdh / laravel-dompdf , it has a simple use, and rendered in the pdf using even the bootstrap , another option is barryvdh / laravel-snappy , I liked it less and it's a bit more complex, it needs a component installed on the server so it may not work on certain hosts. I recommend using the first one mentioned, you may have to adjust your html and css , but if you have problems, you can open a new question by sending the code example and the error.

    
15.09.2016 / 22:41