• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing in JSP ???  RSS feed

 
hasan wasif2k1
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can we Print the content of a file using JSP ???
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can't. The last thing the world needs is rogue websites which, when visited, cause large print jobs to be forced into your computer, using up your paper and ink/toner, and maybe even overloading and crashing the system. So it's not permitted.
However, you can output a web page and permit the user to print it. Or for situations where you wish exact control of the page layout, output content in PDF format.
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was browsing some of the old posts when i saw this and wanted to know more.
Can anyone give me more on how to really output in PDF format ?
resources even ?
TIA
------------------
KaReEm
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need software. PDF printing is a page-layout form - meaning that you don't just output text, you specify fonts and absolute page positions (as well as graphics and other things to make the document look nicer).
There are commercial packages for this, but a good way to get your feet wet is to get the gnujp package (formerly known as retepPDF) from http://www.sourceforge.net I recommend that you start by writing the code in a Java Application and capturing the output to a PDF file - that way you can debug the PDF part without getting into problems because Netscape won't display PDF's properly unless they're downloaded preceeded by a valid Content-Length header - and you won't know the PDF size until the PDF has actually been created!
 
Kareem Gad
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot i'll try that out and let you know
------------------
KaReEm
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!