2

I'm using spring mvc with jsp. I want to give download to pdf functionality for an article which I see in the view rendered by the jsp. I want to have a same look and feel in the pdf as I have in the jsp view(without the header and footers ofcourse). What is the simplest and the best way to achive this functionality? I'm aware that I can use itext library for AbstractPdf view but that would mean I need to create cell and table. Is there any easier way to do that? Thanks.

tintin
  • 5,676
  • 15
  • 68
  • 97

1 Answers1

0

When I remember right, then iText has a way to render HTML.

So what you need to do, is create the HTML content without header and footer, and then put this in iText.

HTML to PDF: @see Using itext to convert HTML to PDF

JSP to String: @see rendering JSP to a string

Community
  • 1
  • 1
Ralph
  • 118,862
  • 56
  • 287
  • 383