PostScript won't staple two pages together on Konica Minolta

707 Views Asked by At

I'm trying to send a simple PostScript to a Konica Minolta C364 printer which has a finisher for stapling. I'm able to print a couple of pages and staple them if I do this by printing let's say, a PDF file directly and selecting the appropriate settings from the printing user interface. However, I'm not able to do the same via PostScript commands.

I've tried numerous different commands, adding them both in the beginning and the end of the .ps file, starting from the simple one:

<< /Staple 3 >>

Then trying some additional options:

<< /Staple 3  /StapleDetails << /Type 17 /Position 17 >> >> setpagedevice
or    
<</Staple 3 /StapleDetails <</Type 1 /StapleLocation(SinglePortrait)>> >> setpagedevice

And then more suggestions like:

<</BindingLocation (LongEdge) >> setpagedevice 
<</Collate true /Rotate false /Jog 0>> setpagedevice 
<</Staple 2 /StapleDetails <</Type 5 /Position (1PLU)>> >> setpagedevice

None of them have any effect - the document gets printed but no stapling is performed whatsoever.

Am I using the wrong commands or is it something else that I'm missing?

I also tried looking for a simple premade .ps file in the Internet which has those same commands but I was not able to find one. Many different suggestions in different forums and websites but nothing that I've tried had any success so far so any suggestions are welcome. Thank you!

EDIT: Here is a link to a sample .ps file that I'm using: https://www9.zippyshare.com/v/QW6w7yHl/file.html

Unfortunately I have to do it via a link as the code is way too long, ~11k rows.

EDIT2: After saving the PostScript to a file instead of sending it to the printer I was able to look through the generated code and extract the following lines which do the trick of stapling if added on top of the file:

@PJL COMMENT
@PJL SET ORIENTATION = PORTRAIT
@PJL SET BINDING = LEFT
@PJL SET FINISH = LEFT1POINT
@PJL SET EDGEMATCHING = FINISH
@PJL ENTER LANGUAGE = POSTSCRIPT

Hopefully they will get added to the answer below!

1

There are 1 best solutions below

5
On BEST ANSWER

Device-dependent actions (like Staple, and also Duplex, Tumble, Collate etc) are expected to be controlled, in language level 2 or 3, by calling setpagedevice.

Some device-dependent features (eg Duplex) are well defined in the specification, others are less well defined and manufacturers can create key/value pairs of their own, which are totally undefined. The way the setpagedevice operator works it will ignore anything which it doesn't understand.

So I would expect:

<< /Staple 3 >>

Not to do anything. That simply creates a dictionary with the Key /Staple and a value of 3, it then simply leaves that operand sitting on the operand stack, where it will remain until the end of the job.

Your other examples pass the dictionary to setpagedevice, so they might do something, though Collate and BindingLocation won't affect stapling! Note that sending them at the end of the PostScript program won't do anything useful, because by that time the program is complete and the pages will have been printed.

Its also possible that putting it on the front of the PostScript program won't have any effect either, because its possible that the content of the program starts by resetting the device to its default state. If this is the case then you need to insert the setpagedevice call into the program at an appropriate place. If the program is DSC compliant then there is a defined location you can put it, if its not then all bets are off, frankly. But most PostScript programs are DSC compliant.

The problem is that the exact details of the required values are specific to the manufacturer, so its not possible to tell you what exactly you should use.

The best way to find out is normally to select 'print to file' and print a document with a setup which you know will enable stapling (by trying it out beforehand if necessary). Once you have that you can open the resulting file with a text editor and look through it for the stapling setup.

Unfortunately, the control panel of the printer can do all sorts of stuff, and may not even be controlling the printer via PostScript. Are you sure that this can be controlled via PostScript ? Have you tried contacting the manufacturer and asking their support department ?

If you can capture a program as above (ideally where the printed content is as simple as possible to reduce the size and complexity), post it to a public URL somewhere and then put the URL here. I'll look at it. If you could post the PostScript program you want to modify as well then I can tell you where to insert the code in that program.

If you can't capture a PostScript program, then I can't think of any way, short of asking the printer manufacturer, to find a way to do this.

[EDIT]

The PostScript program is the output of Ghostscript's ps2write device, so I suspect that you aren't using pdf2ps.exe but instead are using pdf2ps.bat, a command shell script which calls Ghostscript. You are also using an older version of Ghostscript (9.20). You should upgrade to version 9.25 (due out in the next couple of days) for security reasons.

But I still don't know what the correct setup for your Stapling is. As I noted above, if you can print to the printer from your operating system, and get that to actuvate stapling, then you can capture the PostScript and extract the relevant portion from there.

But without that, there's not anything I can really tell you.

As requested here's the PJL (not PostScript) code form the original question, which apparently works for adding stapling):

@PJL COMMENT
@PJL SET ORIENTATION = PORTRAIT
@PJL SET BINDING = LEFT
@PJL SET FINISH = LEFT1POINT
@PJL SET EDGEMATCHING = FINISH
@PJL ENTER LANGUAGE = POSTSCRIPT