[vox-tech] scaling PDF with lp

Henry House hajhouse at houseag.com
Tue Nov 14 17:36:02 PST 2006


P=E5 2006-11-14, skrev Dylan Beaudette:
> Greetings,
> =

> I have some PDF files which were created without respecting the target =

> printer's hardware-enforced margins of 5mm. I have computed an approximat=
e =

> scaling ratio 0.91 , used : lp -o scaling=3D91 ...
> =

> Is there a better way to scale PDF files to fit within a printer's margin=
s? I =

> am aware of the psresize command, which works well most of the time- but =
a =

> more robust approach would be nice when the source ps|pdf file is technic=
ally =

> at letterpaper size, just outside of the allowable margins.

It sounds like you want to scale down the pages based on the known
capabilities of the printer, using a general method that can cope with
arbitrary input.

This procedure is not automated, but does do what you want, if I
understand your question correctly:

1. convert the input PDF into postscript using, for ex.,
   pdftops in.pdf step1.ps
2. Use mpage:
   mpage -m100 -o1 < step1.ps > output.ps

where 100 above is the desired margin all around the page in postscript
points (72 pspoint =3D 1 inch). The flag -o1 makes mpage put one input
page on each output page and disables the border that mpage adds around
the page by default.

It should not be too hard to convert the procedure above into an
automatic script. I hope this helps!

-- =

Henry House
+1 530 753 3361 ext. 13
Please don't send me HTML mail! My mail system frequently rejects it.
The unintelligible text that may follow is a digital signature.
See <http://hajhouse.org/pgp> to find out how to use it.
My OpenPGP key: <http://hajhouse.org/hajhouse.asc>.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.lugod.org/pipermail/vox-tech/attachments/20061114/3264e5=
30/attachment.pgp


More information about the vox-tech mailing list