Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

save webpage as pdf  RSS feed

 
mike mimmis
Ranch Hand
Posts: 57
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear Ranchers,

I am developing an application using servlets and jsp .

In my project I need current webpage is stored as pdf . How can I achieve this .

Thanks in advance.....
 
Deepak Bala
Bartender
Posts: 6663
5
Firefox Browser Linux MyEclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What have you tried so far ? What data does the page contain ?
 
mike mimmis
Ranch Hand
Posts: 57
Java MySQL Database Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Deepak Bala wrote:What have you tried so far ? What data does the page contain ?


Sir I have no idea that how to get and where to start...

My data comes from mysql database like employee name,dateofbirth,employee id,photo...etc



 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
two ways -

1. set content type as 'application/PDF' for that page

2. you can use iText API http://www.itextpdf.com/
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1. set content type as 'application/PDF' for that page




You can set the content type for anything you want but JSP is still going to generate text, not the binary PDF format.

In addition to iText, the Apache FOP project toolkit will let you build a pdf file, but it is a multistep process.

Bill
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!