Blog posts archive

Posted Fri January 11th 2008 from 53.3123, -6.2335

While trying to write a CUPS filter, I needed to add an image to a PostScript document. There are some handy PostScript functions for importing design elements in direct PostScript, but I only managed to get the PNG function working which embeds an image using ASCII85 encoding. The only problem: how to encode a PNG image into ASCII85.

Jarmor "is a tiny collection of java filters implementing ASCII armors" - which includes ASCII85, but aside from the source code, I found the download package didn't contain any examples, only tests and API documentation. Some people will find that perfectly adequate, but I prefer some simple examples so I can quickly use the code: EncodeFile will take the filename of an image as an argument and output an ASCII85 encoded version suitable for use in a PostScript document (place the unzipped .java file in the 'src' directory of the unzipped 'jarmor-1.0-src' download and compile in the usual manner).

Tagged , and .