[cups.general] scaling pdf file for a poster

Johannes Meixner jsmeix at suse.de
Thu Aug 26 01:12:38 PDT 2010


Hello,

On Aug 25 22:40 John King wrote (shortened):
>>> lp -d lexmark -o PageSize=Custom.420x594cm -o fitplot=true

According to
http://www.cups.org/documentation.php/doc-1.3/options.html
------------------------------------------------------------------
The actual options supported are defined in the printer's
PPD file in the PageSize, InputSlot, and MediaType options.
You can list them using the lpoptions(1) command:

lpoptions -p printer -l

When Custom is listed for the PageSize option, you can specify
custom media sizes using one of the following forms:

lp -o media=Custom.WIDTHxLENGTH filename
lp -o media=Custom.WIDTHxLENGTHin filename
lp -o media=Custom.WIDTHxLENGTHcm filename
lp -o media=Custom.WIDTHxLENGTHmm filename

where "WIDTH" and "LENGTH" are the width and length of the media
in points, inches, centimeters, or millimeters, respectively. 
------------------------------------------------------------------

Does
   lpoptions -p lexmark -l
list "Custom" for the PageSize option?


>>> and also setting the PageSize to A2, but in neither case
>>> did the pdf scale up to print over 4 pages on my A4 printer.

On my openSUSE 11.1 system with CUPS 1.3.9

echo Hello | a2ps -1 -o- | ps2pdf - - | lp -d hplaserjet1220ljet4 \
  -o PageSize=A3 -o fitplot

scales the content up to A3 format but then the printer which
has only A4 paper prints only one A4 sheet with only the
upper left part of the scaled content which is the expected
behaviour of the above command according to how I understand
http://www.cups.org/documentation.php/doc-1.3/options.html


According to how I understand
http://www.cups.org/documentation.php/doc-1.3/options.html
only images (more precisely bitmap graphics) can be expanded
and printed on multiple sheets by CUPS:
----------------------------------------------------------------
CUPS supports several options that are only used when printing
image files. These options have absolutely no effect on
PostScript, PDF, HP-GL/2, or text files.
....
The scaling=percent value is a number from 1 to 800 specifying
the size in relation to the page (not the image.) A scaling
of 100 percent will fill the page as completely as the
image aspect ratio allows. A scaling of 200 percent will
print on up to 4 pages.
----------------------------------------------------------------

Therefore you need to produce first a bitmap graphics from your
PDF, then you can expand and print it e.g. on 4 sheets via

lp -d lexmark -o scaling=200 file.bitmap_graphics

For example this works for me (Ghostscript needs PDF input as
regular file and not via stdin because stdin is not seekable).
I use Ghostscript to convert a PDF into a png bitmap graphics.
You may use whatever tool you like more to do the same.

echo Hello | a2ps -1 -o- | ps2pdf - >/tmp/in.pdf

gs -q -dBATCH -dQUIET -dNOPAUSE -sDEVICE=png256 -r600x600 \
  -sOutputFile=- /tmp/in.pdf | lp -d hplaserjet1220ljet4 \
  -o scaling=200

The "-o scaling=200" makes it print on 4 sheets
regardless if "-r1200x1200" or "-r300x300" is used in
Ghostscript for more or less bitmap graphics resolution
(i.e. better or lower printout quality).


Finally there is the RPM package "poster" which is a tool
to split generic PostScript input exactly as you need it.
See "man poster" for details.

You may use "pdf2ps input.pdf output.ps" to convert PDF to PostScript
or use the Adobe Reader to print a PDF into a PostScript file or
call "acroread -toPostScript file.pdf" to get a file.ps
see "acroread -help" for details.

poster seems to be a bit picky regarding its PostScript input.
It requires "generic PostScript input" (see "man poster"), e.g.
/usr/share/doc/packages/ghostscript-library/examples/tiger.eps

But poster may not work with any kind of PostScript input.


Kind Regards
Johannes Meixner
-- 
SUSE LINUX Products GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany
AG Nuernberg, HRB 16746, GF: Markus Rex





More information about the cups mailing list