On Wed, 22 Nov 2006, Dan wrote:

Yep, got that!  Well, I get an extra dash: %!PS-Adobe-3.0

The %BeginProlog and %%EndProlog comments are important.

Yep, got these too!

Yep, got "%%Page".  Our format is:
%%Page: C1-003458191 4
where C1 is our form type, the 9-digit number following that is a policy
number, and the '4' is the page number.

So, then, what's involved to do this?  Are you talking RPG, Java, ???

Then you are in pretty good circumstances. Writing a post-processor shouldn't be too hard. All you really need to do is read in original postscript as input and then output the pages you want. In the output you will need to include the Prolog (well, actually everything from the beginning of the original postscript document to the %%EndProlog comment). Then output the page(s) you want. At the end of all that, output the Trailer (another special comment in the postscript: %%Trailer). Include everything from %%Trailer to the end of the file in your output.

You can (should) change the total number of pages (the %%Pages comment) and can also change the page numbering (%%Page comment). Note that simply changing the %%Page comment won't change that page number that actually prints on the page. There isn't a standard way to do that - you would have to look at the postscript code and determine how if you want to. But changing these comments will affect how the PDF is generated.

Once you have output your desired pages with the Prolog and Trailer you can just feed it to ps2pdf to get your PDF file. You can probably use ghostscript to do this, but I'm on linux so it is easy:

ps2pdf <input.ps> <output.pdf>

Of course you post-processor page separator program could call ps2pdf itself.

James Rich

It's not the software that's free; it's you.
        - billyskank on Groklaw

Return to Archive home page | Return to MIDRANGE.COM home page