[cups.general] Problems printing PDF files through cups.

Helge Blischke h.blischke at srz.de
Mon Oct 1 08:10:03 PDT 2007


Gerald Britton wrote:
> Well, folks, I'm back at it today.  Still trying to get good printouts
> of pdfs.  To recap:
> 
> I have a large (12x18 inch) PDF, which is actually a scan of an old
> (1851) census.  I want to print it on legal-sized paper (8 1/2x14),
> scaled to fit the page lengthwise (landscape).  Acting on the
> excellent guidance of Helge and Kurt, I did the following:
> 
> 1. removed the "/DeferredMediaSelection true" option from the page
> size and page region statements like this:
> 
> sudo sed 's/\/DeferredMediaSelection true \/PageSize/\/\/PageSize/' \
> /etc/cups/ppd/ps0198.ppd |> /etc/cups/ppd/ps0198new.ppd
> 
> 2. Set these environment variables:
> 
> export PPD=/etc/cups/ppd/ps0198new.ppd
> export CUPS_SERVERROOT='/etc/cups/'
> 
> 3. Ran pdftops (the binary, not the perl script):
> 
> /usr/bin/pdftops -v
> pdftops version 3.00
> Copyright 1996-2004 Glyph & Cog, LLC
> 
> /usr/bin/pdftops -paper legal
> /home/shared/gramps/media/CanadaCensus1851/CAN1851Census-Hamilton-ON-Pg303a.pdf
> /tmp/pdftops.out
> 
> 4. Printed the result;
> 
> lp -d ps0198 -o raw /tmp/pdftops.out
> 
> The results are just what I wanted!!!!
> 
> 5. ran the file through the pstops filter:
> 
> /usr/lib/cups/filter/pstops "1" "dummy" "dummy" "1" "fitplot=true
> PageSize=Legal" /tmp/pdftops.out > /tmp/pstops.out
> 
> 6. printed the result
> 
> lp -d ps0198 -o raw /tmp/psftops.out
> 
> Unfortunately, this time the results are not correct.  The image is
> printed on legal paper stock, lengthwise, but scaled to fit letter
> stock :-(
> 
> FWIW I ran the above tests using the original ppd file (with the
> "/DeferredMediaSelection true" in the page size and page region
> statements).  The results are exactly the same through step 4.  At
> step 6, I had to manually select the paper at the printer, but it was
> scaled properly!
> 
> So it looks like DeferredMediaSelection does what it says in terms of
> making the printer start by itself or not, but has a side effect of
> somehow affecting the scaling of the printout.
> 
> 
> Weird!
> 
> Kurt mentioned that the pdftops program I have is NOT the one in CUPS
> CVS.  Could anyone send me that one, compiled for 32-bit Linux?  I'd
> love to try it out!
> 

What about discarding the "fitplot=true" option? The difference is that
*with* the fitplot option the scaling and rotating is done by the
pstops filter you used and that presumably catched the letter size
which has been configured as the default. Without this option, the
scaling and rotation is left to the printer's PS interpreter, which then
should use the largest media size available for the pages to print on.

Helge


-- 
Helge Blischke
Softwareentwicklung
SRZ Berlin | Firmengruppe besscom

H.Blischke at acm.org




More information about the cups mailing list