• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

cretaing a PDF from the form details updated in database

 
rbala krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am creating a application in struts 2 for E passport.i am facing a problem about how to generate a PDF file from the details submitted by the user for his passport. i know that i have to create a XML to take it into PDF.but i am not able to do it.i would be very thankful if you give me source code using one parameter or any basic code that you have as soon as possible.

thanks and regards
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How are you trying to generate the PDF? Are you using some library? Are you generating it from scratch, or is there some kind of template? Also, I don't understand what XML has to do with PDF generation.
 
rbala krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"How are you trying to generate the PDF? Are you using some library? Are you generating it from scratch, or is there some kind of template? Also, I don't understand what XML has to do with PDF generation"



actualy i came to know from this forum only that i have to use XML to generate PDF..
actualy i have to give a view to the user about the details that he had entered and then i have to enable the print option in that JSP page to enable the user to take a print out of that ,so i am converting it to a PDF so that he can take the print out.Please help me out with this problem
 
bala nannaka
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You cannot directly generate the PDF file from form details that user has entered.

one way would be to use IText and generate pdf and write the data into it from your form object or any other data container
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
rbala krishnan wrote:actualy i came to know from this forum only that i have to use XML to generate PDF.

I think you must have misunderstood something. XML may be involved in creating a PDF; but it does not have to be.

i have to enable the print option in that JSP page to enable the user to take a print out of that ,so i am converting it to a PDF so that he can take the print out.

What does creating a PDF have to do with printing something? Why couldn't the user just print the web page?
 
rbala krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

i have to enable the print option in that JSP page to enable the user to take a print out of that ,so i am converting it to a PDF so that he can take the print out.

What does creating a PDF have to do with printing something? Why couldn't the user just print the web page?



actualy the user needs to print his details and not the webpage being displayed.Just like after giving our details in a passport site we are able to print our details
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, so the web site doesn't show what the user needs printed. My first thought is: why not show on the web site what the user *does* need printed?

But I still don't understand what PDF or no PDF has to do with anything getting printed or not.
 
rbala krishnan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ulf Dittmer wrote:OK, so the web site doesn't show what the user needs printed. My first thought is: why not show on the web site what the user *does* need printed?

But I still don't understand what PDF or no PDF has to do with anything getting printed or not.



ok fyn...PDF is not required ...just guide me hw do i print the details of the user who entered the details in the form....i need it very urgently......i will explain the problem once again....
my user will enter his details in a form and that will get submitted to the database and when user will click on view or print details then he has to get an option to directly print his details from the view detail page..leave aside PDF and all...i jus need a solution to this problem..please help
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem I would add a "Print" link that opens a page that shows exactly what you want to print. Then the user can use the browser's print functionality.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic