2

I have a page that built with JSP, struts.This page loading with dynamic content.

I want to save the page as PDF-file with all contents and the same format with a button click. If i can save the page with all contents, I can convert to PDF. How to save a jsp page with this properties as pdf?

thanks in advance

Suresh U
  • 463
  • 3
  • 14
  • can you pls give more details...? – SAMUEL Apr 01 '15 at 09:00
  • I think you can achieve this feature with Apache Fop. You can define an .xsl file with the jsp page structure and then to generate an xml with all the page's data. Then, using fop, you can translate these two into a pdf file. – drgPP Apr 01 '15 at 09:00

1 Answers1

1

I was researching this topic lately and I found that better aproach is to use javascript on client side to generate PDF. There are few libs who can make it for you. choose your way: f.e.

Generate pdf from HTML in div using Javascript

http://html2canvas.hertzen.com/

https://github.com/MrRio/jsPDF (:

Community
  • 1
  • 1
Michal_Szulc
  • 4,097
  • 6
  • 32
  • 59