Image ASCII85 encoding with Java

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 .

Most used blog post tags

Blog entries by month

  1. January 2012 (1)
  2. August 2011 (2)
  3. March 2011 (1)
  4. February 2011 (1)
  5. November 2010 (1)
  6. October 2010 (1)
  7. August 2010 (2)
  8. January 2009 (1)
  9. December 2008 (1)
  10. November 2008 (1)
  11. October 2008 (2)
  12. September 2008 (3)