aspose file tools*
The moose likes Other Open Source Projects and the fly likes printing with iText Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
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: 42632
    
  65
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.


Ping & DNS - my free Android networking tools app
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: 42632
    
  65
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: 42632
    
  65
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://aspose.com/file-tools
 
subject: printing with iText