resizing paper size from the command line

Nikiforov g_nikiforov at hotmail.com
Tue Dec 18 07:15:56 PST 2007


Hello,

I am currently using Ubutu 7.10 and a KonicaMinolta printer to which I am connecting via its ip address. I am using it with a HP Color LaserJet 5500 Foomatic/hpijs driver because that it gives me all the functionality that I want (single and duplex printing, color vs grayscale). I set it up using the Ubuntu print GUI and it seems to work fine. However, every once in a while I would like to print from the command line. The paper size which the paper is using is A4 and the problem occurs when I am trying to print out a document which is originally in some other paper size. If I send the document to the printer just using:

lpr <filename.pdf>

I get an error saying that the printer cannot find the appropriate paper size and I need to cancel the job. I tried several options to correct the problem, namely:

lpr -o PageSize=A4 <filename.pdf>
lpr -o PageRegion=A4 <filename.pdf>
lpr -o media=A4 <filename.pdf>
lpr -o fitplot <filename.pdf>
lpr -o scaling=100 <filename.pdf>

as well as all possible combinations thereof, however I still get the same error message. The only work around that I can find is to use

pdftops -paper A4 -expand <filename.pdf>

and then print the resulting .ps file, however that is quite annoying to do every time. So does anyone have a suggestion what option to use in lpr in order to scale a document page, which is not size A4 to print to a paper size A4? Or is it a problem of the driver I am using?

Thanks a lot in advance.




More information about the cups mailing list