By Date: <-- -->
By Thread: <-- -->

printDocumentSilent-troubles



Michael Caletka <michael.caletka <at> gmail.com> writes:

> 
> Hi,iText is a really wonderful tool, yet I do have some 
troubles concerning printing. I have a big Java-application, 
that produces lots of PDF-files. 
One for each customer. Now I want them ALL printed as well. 
I tried the method printDocumentSilent, which just prints 
the last of the files I produced. Next I tried printDocument, 
which seems to work, but always comes up with an additional
screen from Adobe, which is very disturbing once you have to 
print more than 100 files. I tried to put the 
printDocumentSilent-method in a thread, but this way
also only one gets printed, and you cannot predict which 
one it will be. Strangely the method leaves a Process of 
Acrobat running. It seems, that after sending the File to 
the printer, it doesn't close Acrobat properly. Next I tried
the way described on iText (
> Runtime.getRuntime().exec("cmd.exe start /C acrord32 /p /h" +
"mypdffile.pdf");), but that just didn't do anything. 
What else can I do now? I really need the possibility to print 
the documents (and I mean more than just one).
> Any help highly appreciated!

Michael,

I've playing around with silent printing PDFs for a while now.
Some thoughts:

1) The screen your seeing is most probably Acrobat Reader's splash screen. 
Try disabling it in the Reader ("edit" - "settings" - "application start" - 
show splash" or something similar).
2) You can indeed start and/or print a PDF using Runtime.getRuntime().exec().
Check the return value of your Process or just try supplying the absolute path
to acrord32, as it may not be in the path when your starting the Process.
3) Printing via acrord32 is a possibilty, but it is not supported by Adobe. 
They want us to use Acrobat's DDE interface. That said, there is a nice tool,
that does that: pdfp.exe (http://www.noliturbare.com/ChicksTools.html). 
Try it from a command line and if you are satisfied, run it from your class 
by using the Runtime.exec method(s). Note that you can pass in the printer, 
number of copies and a list (wildcards are suported) of files to print. 
Make sure you're using Acrobat Reader 7.0 at least, as otherwise the Reader 
may reamain open after printing.

Hope that helps, 
Thomas






-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions (at) lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions