This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes printing with iText Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Reply Bookmark "printing with iText" Watch "printing with iText" New topic
Author

printing with iText

Stan F Smith
Greenhorn

Joined: Jun 28, 2011
Posts: 20
Hello,

has anyone been aboe to print a pdf with iText without displaying the pdf?
I have tried several example such as:



which does not error but also does ot print.

can anyone help with this?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
What this code does is not to print anything, but to add JavaScript code that potentially prints something to the document. Without opening the PDF with a PDF reader that interprets JavaScript (not all do), nothing could possibly be printed.


Android appsImageJ pluginsJava web charts
Stan F Smith
Greenhorn

Joined: Jun 28, 2011
Posts: 20
Thank you,

Can you please assit me with how I would then print a pdf that i currently have as a ByteArrayOutputStream?

Thanks again.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
The PDFBox library can print PDFs.
Stan F Smith
Greenhorn

Joined: Jun 28, 2011
Posts: 20
Thanks I will try that out.

So to be clear I cant do it with regular java or the iText lib?

Thanks again
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 35241
    
    7
You can do it with the standard Java printing API if you have a printer/driver combination that understands PDFs; not all do.

iTest is for creating and manipulating PDFs; it does not include a PDF interpreter.
Stan F Smith
Greenhorn

Joined: Jun 28, 2011
Posts: 20
Thanks,

I will give it a shot.

Stan F Smith
Greenhorn

Joined: Jun 28, 2011
Posts: 20
As I am sure you already knew it worked!

Thanks for taking the time to help out, people really appreciate it.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: printing with iText
 
Similar Threads
How jsp and a pdf document displayed in the same browser?
iText Silent Print
Images in PDF files problem for ServletOutputStream
Covert a PDF to PDF/A format using iText
PdfBox, do you have to save the .pdf to a file?