command line printing / lp fit-to-page or fitplot not working

Hello,


I have tried printing on Mac Mini (Mac OS 10) using the command line "lp" tool to print images on A6 postcard paper on a Cannon iP7200 printer.

Unfortunately, the printer shifts the image, it leaves empty space on the left and right side of the paper. It works perfectly when I use the printing options through the GUI, the option "fit to full page" does the job.


I have used the following command to print:

lp -o landscape -o fit-to-page -o media=A6 image.jpg


Moreover, I looked at the "cups" log file (/var/log/cups/) and printing through the GUI in the log it shows the "-o media=Custom.WIDTHxLENGTH" option, as I have created a "custom" profile with custom widthxlength, however that does not work in the command line, I use the same width and length as the one reported from printing via GUI in the cups log file. For instance:


lp -o landscape -o fit-to-page -o media=Custom.106x164mm image.jpg


Reading the documentation of "lp" and online support, the "fit-to-page" or "fitplot" option should do the work, but in my case it does not work. Th printer shifts on the left the image and leaves empty space on the left and right side of the paper (only horizontally, top and bottom part is fitted).


Is there any solution to this?


Thanks.

Mac mini, Mac OS X (10.7), lp, Cannon iP7200

Posted on Mar 23, 2017 7:58 AM

Reply
2 replies

May 3, 2017 2:22 AM in response to shaban87

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


N-Up Printing

The

-o number-up=value
option selects N-Up printing. N-Up printing places multiple document pages on a single printed page. CUPS supports 1, 2, 4, 6, 9, and 16-Up formats; the default format is 1-Up:

lp -o number-up=1 filename lp -o number-up=2 filename lp -o number-up=4 filename lpr -o number-up=16 filename

The

-o page-border=value
option chooses the border to draw around each page:

  • -o page-border=double
    ; draw two hairline borders around each page
  • -o page-border=double-thick
    ; draw two 1pt borders around each page
  • -o page-border=none
    ; do not draw a border (default)
  • -o page-border=single
    ; draw one hairline border around each page
  • -o page-border=single-thick
    ; draw one 1pt border around each page

The

-o number-up-layout=value
option chooses the layout of the pages on each output page:

  • -o number-up-layout=btlr
    ; Bottom to top, left to right
  • -o number-up-layout=btrl
    ; Bottom to top, right to left
  • -o number-up-layout=lrbt
    ; Left to right, bottom to top
  • -o number-up-layout=lrtb
    ; Left to right, top to bottom (default)
  • -o number-up-layout=rlbt
    ; Right to left, bottom to top
  • -o number-up-layout=rltb
    ; Right to left, top to bottom
  • -o number-up-layout=tblr
    ; Top to bottom, left to right
  • -o number-up-layout=tbrl
    ; Top to bottom, right to left


Scaling to Fit

The

-o fit-to-page
option specifies that the document should be scaled to fit on the page:

lp -o fit-to-page filename lpr -o fit-to-page filename

The default is to use the size specified in the file.

Note:

This feature depends upon an accurate size in the print file. If no size is given in the file, the page may be scaled incorrectly!

May 5, 2017 5:59 AM in response to BDAqua

Well, the "-o fit-to-page" does not work, as the printed image is not fitted on the paper.


Even using custom width x length and trying to find the right size, still the printer shrinks the image and leaves blank space on the right and left side.


The problem I find is the "lp" tool, as printing through the GUI works fine, on the GUI printing app, checking the "fit to page" works perfectly.


Any suggestions how to deal with this problem?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

command line printing / lp fit-to-page or fitplot not working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.