• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing with iText

 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The PDFBox library can print PDFs.
 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42968
73
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks,

I will give it a shot.

 
Stan F Smith
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I am sure you already knew it worked!

Thanks for taking the time to help out, people really appreciate it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic