• Post Reply Bookmark Topic Watch Topic
  • New Topic

Printing a pdf  RSS feed

 
Tim Sparg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all

I'm looking to print a pdf silently with java.

Don't need to modify it at all; my only requirement is to stream it from the database where is is stored. Essentially i dont want the pdf to hit the file system during printing.

I have tried numerous commercial libraries Jsmart (activetree) and jPDFPrint (QBS Software) immediately come to mind. These libraries all work, but are exorbitantly expensive (live in South Africa - $7000 equates to about
R45 000) and encompass many features that i don't need.

The only functionality that i need is to print a pdf.
I don't need to modify, or create as this is all done beforehand by crystal reports.

Can anyone point me in the right direction?

thanks
Tim
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

The Adobe AcrobatViewer for JavaBean can print PDFs, but I don't know if you need to display a window to do that first (it sounds like you don't want to do that). Here's an introductory article about it.

A bit later: Just had a look at its API, and it seems that a Viewer object can be instantiated from a File, URL, InputStream or byte array -without displaying anything- and can then be used to print all or selected pages.
[ December 29, 2006: Message edited by: Ulf Dittmer ]
 
Tim Sparg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

thanks for the reply

i have already looked at the Adobe AcrobatViewer. Unfortunately Adobe seemed to have stopped developing it a couple of years ago.
The preview reproductions that you get are shocking - it moves letters around.
And as of yet the demo they provide to showcase functionality has not printed; or more accurately it prints a blank page.

does anyone else have any solutions?

thanks Tim
 
Aditya Kumar
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried PdfLib? you can check about it at: http://www.pdflib.com

Good luck!
 
Tim Sparg
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi Aditya

thanks for the link.

sorry that i'm only replying now, but i got frustrated with the pdf printing, and went onto other projects.

i eventually did find a solution. while it is not a streamlined as i hoped, it at least works.

I send command line parameters to ghostScript to produce the pdf documents. seems to be reliable, and unless i can find a more suitable product, that is what i will use to print.

as i said not the solution i would ideally liked to have used, as i didnt want to hit the file system at all.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!