[cups] force CUPS print server to fit-to-page

Josh iptvhub75 at gmail.com
Fri Aug 21 17:09:24 PDT 2020


Greetings fellow CUPS users!

In addition to page size problems the page-ranges attribute is
ignored. I created a two page PDF file, transferred it to an iPhone
and sent it to CUPS printer two times, first specifying to print page
number 1 only, and second time to print page number 2 only, capturing
packets on port 631.

fragment number 1
000001C9 70 61 67 65 2d 72 61 6e 67 65 73 00 08 00 00 00 page-ran ges.....
000001D9 01 00 00 00 01 34 00 09 6d 65 64 69 61 2d 63 6f .....4.. media-co

fragment number 2
000001C9  70 61 67 65 2d 72 61 6e  67 65 73 00 08 00 00 00   page-ran ges.....
000001D9  02 00 00 00 02 34 00 09  6d 65 64 69 61 2d 63 6f   .....4.. media-co

I haven't been able to find exact page-ranges attribute format
description other than listed in section 4.2.7
https://tools.ietf.org/html/rfc2911#section-4.2.7
but hex dump clearly shows numbers 01 and 02.

Needless to say CUPS prints both pages, ignoring page-range attribute.

Is page-range supported by CUPS 1.6.3?
The CUPS documentation page https://www.cups.org/doc/options.html does
mention it but it is not clear what version(s) it is applicable to.

Regards,
Josh.

On Fri, Jul 3, 2020 at 11:43 PM Josh <iptvhub75 at gmail.com> wrote:
>
> Till,
>
> After your command I see an option is added to printers.conf. But no changes in output print size. Still 4x6 image.
>
> Not sure if helpful but
> lpoptions -l
> shows, among other things:
>
> PageSize/Media Size: *Letter
> StpiShrinkOutput/Shrink Page If Necessary to Fit Borders: Shrink Crop *Expand
>
> My understanding that the above is coming from the .ppd file only.
>
> CUPS log file mentions requested page size w288h432 and *Expand to *Letter is clearly ignored unless it means something else.
>
> Josh.
>
> On Fri, Jul 3, 2020 at 4:33 PM Till Kamppeter <till.kamppeter at gmail.com> wrote:
>>
>> Try
>>
>> lpadmin -p PRINTER -o fit-to-page-default=true
>>
>> with PRINTER being the name of your print queue.
>>
>> Does this work?
>>
>>     Till
>>
>> On 03/07/2020 21:28, Josh wrote:
>> >   Greetings,
>> >
>> > I've just set up an AirPrint server for a home office by following
>> > instructions in
>> >
>> > https://www.linux-magazine.com/Issues/2013/154/AirPrint-in-Linux
>> > and
>> > https://github.com/jpawlowski/airprint-generate
>> >
>> > Printer works just fine except for a problem described in
>> >
>> > https://serverfault.com/questions/897140/force-cups-print-server-to-fit-to-page-if-job-is-not-a4
>> >
>> > Text jobs sent from iOS devices print full pages but photos and images
>> > print size is 4x6 inches.
>> >
>> > CUPS v1.6.3 on CentOS 7.
>> >
>> > Does anyone have any ideas?
>> >
>> > Please advise,
>> > Josh.
>> >
>> > PS. More tests and observations:
>> >
>> > $ sudo lpoptions -o auto-fit=True
>> >
>> > has zero effect as well as adding
>> >
>> > Option auto-fit True
>> >
>> > to the DefaultPrinter section of /etc/cups/printers.conf.
>> >
>> > As a matter of fact I have an impression that all options created by
>> > lpoptions command and stored in /etc/cups/lpoptions have zero effect.
>> >
>> > For example
>> >
>> > $ sudo lpoptions -o media=Letter
>> >
>> > has no effect whatsoever but adding line
>> >
>> > Option media Letter
>> >
>> > to the DefaultPrinter section of /etc/cups/printers.conf has a very
>> > noticeable effect despite the fact that Letter has already been selected in
>> > printer settings UI.
>> >
>> > As a side question, could anyone explain the difference between lpoptions,
>> > printers.conf and printers settings UI?
>>


More information about the cups mailing list