• Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.print PDF problem / complex solution?  RSS feed

 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, this is my first attempt in the mess that seems to the be javax.print API, and I'm looking to see if people have some suggestions/ideas:
1). I am trying to print reports within my java desktop application using JasperReports. Jasper's print utility, however, does not print "pretty" PDF fonts. As such, I would like to export the report to a PDF document and print that document. I can export the document to PDF no problem. (Currently I am storing the PDF as a byte array in memory).
2). Once I made it this far, I discovered that the javax.print API does not support printing PDF documents. I have two options:
a). Use Apache's FOP to translate the PDF into a PCL document and try to print that, or
b). Use Adobe's acrobat API to produce one or more java.awt.Images from the PDF document which can be printed using the javax.print API.
So now my questions:
I). Which of the options (2a or 2b) would be easier? I was leaning toward 2b because FOP looked to be over-kill for the functionality that I need.
II). Does anybody know if the Tiger release of Java will support PDFs in its printing API?
III). Is there another way to print PDFs, short of opening up AcrobatReader? (I would prefer for the user to press the "print" button in my application and not have to press "print" again in acrobat...)
 
Joel McNary
Bartender
Posts: 1840
Eclipse IDE Java Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never mind.....
I scrapped the whole PDF thing, as when I printed the report out on paper the fonts looke fine. The problem was than when my virtual printer (FinePrint) displayed teh fonts it came out all funny-looking.
But, I still would like to know if 1.5 will support printing PDFs....
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!