New Forum | Previous | Next | (P-PDF) Developers
Topic: How to write a compression routine
Conf: (P-PDF) Developers, Msg: 54077
Date: 5/29/2002 05:03 PM
Recently I have written a PDF conversion program which takes mainframe data reports and converts them to PDF files. So far it works pretty good. I have followed the PDF specification for basic PDF files. I have no need for graphics, so that simplifies things. One thing I did want to add was compression. The compression is more for security purposes than for actual compression. This way people can't just read the PDF file as a text file and change numbers around. What I need to know is exactly how to write the compress routine. Keep in mind this is on the mainframe. I'm starting to write an LZW compression routine based off of an algorithm given. I got the general lzw routine working on a regular text file. I'm not sure how to incorporate it into my PDF program. From what I've seen you can just compress the stuff in between the STREAM and END STREAM statements. Do you treat each section in between as if it was a separate compressed file? Or should I use some other compression algorithm? What is FLATE? Is it possible or even allowed to write a FLATE compression routine, or do you have to have specific software? I don't want to use specific software because I want to run this on the mainframe. Any help would greatly be appreciated.