I need to create a pdf file from the current screen in my webapp. Some kind of screenshot, but I ran into serious difficulties.
The main problem is that the view contains a grid created using jQuery Gridster; and some widgets contain complex elements such as tables, charts, etc.
So plugins like jsPDF or html2canvas cannot display my page in PDF format. They always generate emptiness.
This is what the page looks like. You can / move the size of each element: (Sorry for the CIA style, but there is business data there)

Some ideas I came up with but don't work:
- Using the print-to-pdf browser function is programmatic. (Can not)
- Use phantomjs . (but questions about the state of the page, therefore ...)
I believe that the solution to this problem can be widely accepted by anyone who is trying to create an img PDF file from the current screen in a web application. Pretty unresolved issue.
This is normal if it only works on Google Chrome.
Many thanks.
EDIT:
One of the possible solutions may be to find a way to present the current state of the layout with the object and save it with and id.
Then retrieve this object using the url parameter with identifier and apply the saved layout to the original page.
That way I could take a screenshot with phatomjs , but to me it seems rather complicated. Any alternative?
source share