This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Printing a pdf

 
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
 
Rancher
Posts: 43011
76
  • 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
 
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.
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!