Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning 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
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

printing with iText

 
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?
 
Rancher
Posts: 43011
76
  • 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: 43011
76
  • 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: 43011
76
  • 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.
 
Put the moon back where you found it! We need it for tides and poetry and stuff. Like this 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!