Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I convert my current page to pdf after some content dynamically added via AJAX?

Tags:

ajax

php

pdf

I have found some libraries or web services in PHP that does the job. The problem is that the conversion is done when the page is fully loaded, I would like to convert the page to PDF after some content dynamically added via AJAX in onload event.

Thank you very much, Omar

like image 590
ompemi Avatar asked Dec 10 '22 22:12

ompemi


1 Answers

You could post back document.getElementsByTagName('html')[0].innerHTML to the server (possibly using AJAX) and generate a PDF from that.

like image 78
Greg Avatar answered Dec 13 '22 14:12

Greg