[cups] turning off fit-to-page
Gary Dale
gary at extremeground.com
Sat Jan 6 17:23:58 PST 2024
On 2024-01-05 04:59, Jörg Thümmler wrote:
> Am 04.01.24 um 15:32 schrieb Gary Dale:
>> I'm running Debian/Bookworm on an AMD64 server. I'm usually trying to
>> print to a HP CP1215 colour laser printer.
>>
>> CUPS has been a nightmare for the past year, but I get around it a
>> little by printing from the command line. My workstation can't seem
>> to print to the server's printers anymore so I have been working
>> around it by creating a PDF or image file and using lp to print from
>> the server.
>>
>> However this doesn't work when I have a document that extends into
>> the printer margins. Then lp shrinks the document to fit the margins,
>> which is not what I want. I want the printer to crop at the margins
>> so I get as much of the document as the printer allows without any
>> alterations and without having to create a separate document for each
>> printer I might use.
>>
>> This brought me to the barely documented option "fit-to-page" which
>> (apparently) is turned on by default so that iOS users can air print
>> their photos. I supposedly should be able to override this by setting
>> fit-to-page=off. I supposed to be able to do this using the lpoptions
>> command or specifying it on the lp command using "-o fit-to-page=off".
>>
>> Neither worked.
>>
>> If I use lpoptions as either my regular user or as root, it has no
>> impact - using loptions -p <queue name> -o fit-to-page=off or
>> omitting the -p <queue name> - all 4 variants fail. However I did
>> note some odd behaviour setting the lpoptions. When I list the
>> options, fit-to-page never shows. However if I look at the lpoptions
>> file, the global one only contains the default queue name while the
>> local user one appends "fit-to-page-off=true" to the default line.
>>
>> If I put the -o fit-to-page=off in the lp command, the jpeg file ends
>> up printing over 4 pages, with about 1/4 of the image centred on each
>> page - possibly full size but not what I expected or wanted or can use.
>>
>> I will also note that running "lpoptions -l" never shows the
>> "fit-to-page" setting but it does confirm that my default paper size
>> is "letter". Nor is there a "fit to page" setting through the CUPS
>> printer management page (<servername>:631). However, I used to print
>> unscaled documents to this printer (just not through Gwenview which
>> doesn't have a print full size & crop option, which was why I
>> originally started trying to use lp).
>>
>> Is there a way I can get this to work?
>>
>> _______________________________________________
>> cups mailing list
>> cups at cups.org
>> https://lists.cups.org/mailman/listinfo/cups
>
> Hi
>
> what kind of printer you are printing on? I assume only ps and pdf
> printers will understand this (to me until now unknown) option.
> On the other hand it's possible only special content, as pdf, may be
> printed using this option succsessfully.
> I would install a pdf output printer and test the effect of the option
> in the outputted pdf.
>
It's an under-documented option but graphical programs have for decades
offered the option of fit-to-page (scaling up or down), crop, or even
tile across multiple pages.
Clearly lp understands its own options. What is bizarre is that it
doesn't act on them properly. Again, setting the printer option globally
results in no modification to the global lpoptions file while setting
the option for a regular use does modify their lpoptions file. This is
not how the lpotions command is supposed to work.
Moreover, the option seems to be ignored except when it is specified on
the command line. Again, the lp command should be taking direction from
the global file, the local user file and the command line but doesn't
seem to be.
You can also refer to my post from a month ago about how printer classes
no longer seem to work (However my wife can print from her iPhone - a
capability I don't have from my android phone).
In both cases I am running CUPS on a Debian/Stable platform. Since my
Debian/Testing workstation can no longer print to my Debian/Stable print
server, it appears the CUPS developers have forgotten that not everyone
uses AirPrint.
The HP CP1215 isn't the oldest printer I still use either. When a
company makes a durable printer, it shouldn't be made obsolete because
someone thinks it will simplify their programming to insist that we use
a standard they don't support.
If lp defaults to fit-to-page to make it easier for AirPrint users, the
option to turn that off should also work.
More information about the cups
mailing list