I'm hoping to add a pdf annotation using pdfmark to old postscript files that do tray switching based on setpagedevice commands.
I've got the pdfmark annotation code but I'm stuck on how to search for specific setpagedevice calls and basically place that call as an annotation text.
For example:
Assuming the first tray call is:
<< /PageSize [792 1224] /MediaType (STOCK1) >> setpagedevice
I'd like to add a new line after setpagedevice to insert the following line:
[/Rect [0 0 1 1] /Subtype /Stamp /Title (STOCK1) /Contents (This is where a different substrate should change to Tray 1) /ANN pdfmark
Then somewhere down the ps file the next media call is like this:
<< /PageSize [792 1224] /MediaType (STOCK2) >> setpagedevice
so I'd like to stamp this with a slightly different annotation:
[/Rect [0 0 1 1] /Subtype /Stamp /Title (STOCK2) /Contents (This is where a different substrate should change to Tray 2) /ANN pdfmark
What I am stuck on is how to switch this and what the proper code for a prologue.ps file would be and how to best achieve this result. Worst case, if I could just capture one or the other setpagedevice calls, I could then figure out where the rest of them go.
Any help would be greatly appreciated!
I've got the pdfmark annotation code but I'm stuck on how to search for specific setpagedevice calls and basically place that call as an annotation text.
For example:
Assuming the first tray call is:
<< /PageSize [792 1224] /MediaType (STOCK1) >> setpagedevice
I'd like to add a new line after setpagedevice to insert the following line:
[/Rect [0 0 1 1] /Subtype /Stamp /Title (STOCK1) /Contents (This is where a different substrate should change to Tray 1) /ANN pdfmark
Then somewhere down the ps file the next media call is like this:
<< /PageSize [792 1224] /MediaType (STOCK2) >> setpagedevice
so I'd like to stamp this with a slightly different annotation:
[/Rect [0 0 1 1] /Subtype /Stamp /Title (STOCK2) /Contents (This is where a different substrate should change to Tray 2) /ANN pdfmark
What I am stuck on is how to switch this and what the proper code for a prologue.ps file would be and how to best achieve this result. Worst case, if I could just capture one or the other setpagedevice calls, I could then figure out where the rest of them go.
Any help would be greatly appreciated!