What is the best way to generate a PCL output file from an existing PDF file in java?
-
Elaborate on what you mean by "best". – Thorbjørn Ravn Andersen Mar 24 '10 at 16:17
3 Answers
It depends on how much you want to invest, and how robust the solution needs to be. For quick and dirty, you can print from Adobe Acrobat to a file, using a PCL driver (look, mom, no Java ...).
The Java Print Service API can process PDF. Use StreamPrintService and write the stream to a file, using PCL for the output format.
If you need to have more control over the content, maybe modify it or add to it, you can use a PDF parser (this one, for instance) and print the resulting HTML from a browser that your application starts, by adding some Javascript, for example.

- 37,019
- 22
- 105
- 153
-
Do you have experience with the PDF or PS input flavours for this? – Thorbjørn Ravn Andersen Mar 24 '10 at 16:21
The StreamPrintService from JDK 6 does only support PS. I am still searching for a StreamPrintService which supports PCL.

- 11
- 1
We capture PCL generated from Acrobat printing a PDF to a PCL driver and redirect as input to our Windows console PCLXForm program. With a custom script, we can "stream edit" the PCL. We can extract the address block text for address correction, insert the corrected text, add the Intelligent Mail Barcode, 2-D barcodes, sort the documents, batch them by page count, change tray assignments, merge with other documents, etc. The product required is PCLTool SDK - Option V at www.pagetech.com

- 36
- 2