[cups] setting margins when printing a ps (postscript) file

Johannes Meixner jsmeix at suse.de
Wed Feb 18 02:16:36 PST 2015


Hello,

On Feb 17 21:26 Istvan Gabor wrote (excerpt):
> cups 1.5.3 in openSUSE 12.2
> I have a (proprietary) program which generates ps (postscript) file
> output and sends it to cups to print it out. I can not affect in any
> way what comes out from the program.

But you can modify in any way as you like what the CUPS filtering
does with that PostScript, see
https://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS


> The problem is that the left margin of the generated ps file is too big.
> I would like to make it smaller when printed (taht is cut down the
> left side of the page). The printer has a ppd file and accompanying filter.

What exactly is "the printer" and the "accompanying filter"?

What is the PPD file /etc/cups/ppd/<queue_name>.ppd?
Can you post an URL to the PPD file or provide at least
the output of the command
# egrep 'NickName|cupsFilter' /etc/cups/ppd/<queue_name>.ppd

Cf.
https://en.opensuse.org/SDB:How_to_Report_a_Printing_Issue


> I changed the ImageableArea from "0 0 595 842" to "30 0 595 842" and to
> other left lower x values but it had no effect on the printed margin.
> If I convert the file to pdf by ps2pdf and print the pdf, the setting
> is respected, the margin becomes smaller (or the left side of the page
> is cut off). How could I do the same with printing the ps file without
> converting it manually to pdf?

Does it perhaps work when you print your original PostScript using
# lp -d queue_name -o fit-to-page original.ps
cf.
http://cups.org/documentation.php/doc-1.5/options.html

If '-o fit-to-page' does not work, you can enhance the CUPS filtering
that it does any conversions that makes it work as you need it.

I guess it also works when you let Ghostscript re-create a new PostScript
from your original PostScript by ps2ps (or even ps2ps2 if that is available
in the Ghostscript of openSUSE 12.2).

When e.g. after
# ps2ps -sPAPERSIZE=a4 original.ps new.ps
or
# ps2ps -sPAPERSIZE=letter original.ps new.ps
the new PostScript in new.ps prints as you need it, then you could enhance
the CUPS filtering to do "PostScript Preprocessing with Ghostscript" and/or
by "Adding Additional Filter Stages to the Default CUPS Filter System", see
https://en.opensuse.org/SDB:Using_Your_Own_Filters_to_Print_with_CUPS


Kind Regards
Johannes Meixner
-- 
SUSE LINUX GmbH - GF: Felix Imendoerffer, Jane Smithard, Jennifer Guild,
Dilip Upmanyu, Graham Norton - HRB 21284 (AG Nuernberg)




More information about the cups mailing list