Alex
Alex

Reputation: 75

Inconsistency between postscript encoding when injecting staple commands

I am encoding the files in PostScript and sending this directly to a printer (Cannon Image Runner Adv 8105 PRO) using the command line copy process

I have obtained the PPD file for the printer (CNADV8105E1.PPD), and I am injecting the PS commands into my PS file for stapling as defined in the PPD <</Staple 3 /StapleDetails <</Type 21 /Position (1PLU)>> >> systemdict /setpagedevice get exec I am injecting the staple command in the %%BEGINSETUP block

When my PS file is encoded by acrobat reader (printed using reader to a redmon/ghostscript printer) the staple commands work successfully, however this option is not suitable for the overall desired result as an acrobat reader window opens for each document printed (if multiple documents are printed)

To avoid having to open acrobat reader for each document I am passing the pdf through a .net library (xpdf – pdftops) This encodes the output in a different format of postscript which the printer interprets correctly and prints successfully however, when injecting the staple commands as defined by the PPD into this encoding, the stapling does not work (in fact, no longer are the pages held in escrow before being transferred to the output tray, they are in fact deposited in the output tray as soon as they are drawn)

I have tried other commands from the PPD in this encoding and they do work (such as letterhead)

Any help you could provide would be greatly appreciated

Upvotes: 3

Views: 835

Answers (1)

KenS
KenS

Reputation: 31199

There is some confusion in your posting. You say you are modifying the PostScript program by inserting (device-specific) staple instructions. You then say you are printing the file using Acrobat Reader. That can't be the case because Acrobat doesn't handle PostScript.... Also you later mention converting PDF to PostScript, so there is obviously a step missing here.

I'm not at all sure why you would be printing from Acrobat Reader to Ghostscript via RedMon, when your printer is a PostScript printer. Why not print direct ?

If you are creating a PDF file, then the Staple commands will be lost, they can't be preserved in PDF. So whatever is 'working', it isn't to do with your original modifications, the PostScript being sent to your printer won't bear any relation to your original PostScript program.

The output of pdftops is a PostScript program (yes, PostScript is a programming language), so inserting random stuff into it probably won't work. Its not a different 'format', its a different program altogether. Your different 'PostScript formats' are simply different programs using the same language.

In fact, modifying a PostScript program is quite difficult, and unless you are in a closed workflow of some kind it may be impossible to do reliably. Note that any line beginning with '%'in a PostScript program is a comment, and may not be present unless your file is DSC conformant.

So:

1) How are you creating ('encoding') the PostScript program ? Why can't you simply insert the Staple commands as required when the PostScript is created ? If you are creating the PostScript by printing, then use the PPD (or WPD) for the printer you intend to use.

2) If you do modify the PostScript program, by adding Staple commands, what happens if you send that to the printer ?

3) What is the conversion to PDF step for, and where does it fit into the described workflow ?

Upvotes: 2

Related Questions