Search code examples
javapdfprintingprinter-control-language

Java - PDF to PCL


In my company, we're looking for a way to convert a PDF document into a PCL (Printer Command Language) file in Java.

This is our workflow:

  1. Generate a PDF document in memory (meaning it's stored as a byte array)
  2. Convert the byte array into PCL, in memory or as a file
  3. Send that PCL file via FTP to a network printer

Issue Faced:

We cannot find a Java Library or native functionality to convert a byte array into a PCL file. How can this issue be overcome?

I know GhostScript is an option and it works fairly well on our own machines, but we won't be able to use that on the machine we're deploying on.

If there's some kind of library that can convert a PDF file or byte array into a PCL byte array or file, it would be of great help.


Solution

  • To come back to this question and to tell you our solution for an IBM I Series Machine:

    We decided to install GhostScript using AIX (http://yips.idevcloud.com/wiki/index.php/pase/opensourcebinaries). Now, this isn't the ideal solution because for one, we didn't want to install any programs (jars are fine though) and second of all, it adds an extra step to our Java code base which wasn't planned because it adds RPG programming. There just doesn't seem to be any other way.

    I hope this helps anyone who faces the same situation.