How to prevent CUPS omitting the bottom of the CUPS Printer test page

This is something that has been bugging me for years but I never bothered to look into it until now. When I set up a printer using CUPS Administration and then print a test page, for some printers the bottom of the test page image is cut off, as shown in the scanned image below. Also, the left side of the test page image is too close to the left side of the sheet of paper. This happens when I use the Gutenprint printer drivers, although I do not know if that is a coincidence. The CUPS printer test page (A4 paper) shown below is from a Canon PIXMA MP510 printer using the Gutenprint v5.3.3 driver for that model.

Printer test page printed by CUPS before modifying the Canon PIXMA MP510 PPD file

I had a look at the values of the ImageableArea for A4 paper in the printer’s PPD file, and the as-installed values were as follows:

user $ sudo grep "ImageableArea A4" /etc/cups/ppd/MP510.ppd
*ImageableArea A4/A4:   "0.000 0.000 595.000 842.000"

I then edited the PPD file and changed the x,y coordinates of the bottom left of the imageable area from 0,0 to 10,3 for A4 paper so the file now contains the following:

user $ sudo grep "ImageableArea A4" /etc/cups/ppd/MP510.ppd
*ImageableArea A4/A4:   "10.000 3.000 595.000 842.000"

It is necessary to restart CUPS when a change is made to the PPD file:

Gentoo Linux installation using OpenRC

user $ sudo rc-service cupsd restart

Lubuntu 20.10 installation using systemd

user $ sudo systemctl restart cups

Now the ‘Printer test page’ printed by CUPS looks like this:

Printer test page printed by CUPS after modifying the Canon PIXMA MP510 PPD file

Much better.
 
 
ADDENDUM (2 May 2021): I have discovered that the ImageableArea is not the only factor…

I also have a Canon PIXMA MP560 printer, and I printed a CUPS ‘Printer test page’ on that using the Gutenprint v5.3.3 driver for the Canon PIXMA MP560. A scan of the printed test page is shown below:

Printer test page printed by CUPS before modifying the Canon PIXMA MP560 PPD file

The as-installed values of the ImageableArea for A4 paper in the printer’s PPD file were as follows:

user $ sudo grep "ImageableArea A4" /etc/cups/ppd/Canon_MP560_Wi-Fi.ppd
*ImageableArea A4/A4:   "0.000 0.000 595.000 842.000"

Unlike the original test page for the Canon PIXMA MP510, the vertical lines on the left and right sides of the test image are more or less equidistant from the edges of the paper. However, as with the original test page for the Canon PIXMA MP510, the bottom line of the test page was missing. So I tried editing the y coordinate of the bottom left of the ImageableArea in the PPD file for the Canon PIXMA MP560. However, whatever value I used for the y coordinate of the bottom left of the test image, the bottom line was never printed.

I then looked at the contents of the file /etc/cups/printers.conf and found that the configuration for the Canon PIXMA MP510 included a line ‘Option fitplot True‘ whereas the configuration for the Canon PIXMA MP560 did not:

# Printer configuration file for CUPS v2.3.3
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
NextPrinterId 3
<Printer Canon_MP560_Wi-Fi>
PrinterId 2
UUID urn:uuid:428a074e-0e81-3ba3-7789-f8050da82c5a
Info Canon MP560 Wi-Fi
Location My office upstairs
MakeModel Canon PIXMA MP560 - CUPS+Gutenprint v5.3.3
DeviceURI lpd://192.168.1.78/lpt1
State Idle
StateTime 1619978009
ConfigTime 1619880075
Type 36892
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
</Printer>
<DefaultPrinter MP510>
PrinterId 1
UUID urn:uuid:0a2a12b5-ea49-33eb-572a-341c1af02f7e
Info Canon MP510
Location aspirexc600
MakeModel Canon MP510 series - CUPS+Gutenprint v5.3.3
DeviceURI usb://Canon/MP510?serial=934631&interface=1
State Idle
StateTime 1619662185
ConfigTime 1619628669
Type 36876
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option fitplot True
</DefaultPrinter>

 
So I stopped the CUPS service, edited the file to add the line ‘Option fitplot True‘ for the Canon PIXMA MP560, and restarted the CUPS service:

user $ sudo systemctl stop cups
user $ sudo nano /etc/cups/printers.conf
user $ sudo systemctl start cups

The file now looks like this:

# Printer configuration file for CUPS v2.3.3
# Written by cupsd
# DO NOT EDIT THIS FILE WHEN CUPSD IS RUNNING
NextPrinterId 3
<Printer Canon_MP560_Wi-Fi>
PrinterId 2
UUID urn:uuid:428a074e-0e81-3ba3-7789-f8050da82c5a
Info Canon MP560 Wi-Fi
Location My office upstairs
MakeModel Canon PIXMA MP560 - CUPS+Gutenprint v5.3.3
DeviceURI lpd://192.168.1.78/lpt1
State Idle
StateTime 1619978009
ConfigTime 1619880075
Type 36892
Accepting Yes
Shared No
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option fitplot True
</Printer>
<DefaultPrinter MP510>
PrinterId 1
UUID urn:uuid:0a2a12b5-ea49-33eb-572a-341c1af02f7e
Info Canon MP510
Location aspirexc600
MakeModel Canon MP510 series - CUPS+Gutenprint v5.3.3
DeviceURI usb://Canon/MP510?serial=934631&interface=1
State Idle
StateTime 1619662185
ConfigTime 1619628669
Type 36876
Accepting Yes
Shared Yes
JobSheets none none
QuotaPeriod 0
PageLimit 0
KLimit 0
OpPolicy default
ErrorPolicy retry-job
Option fitplot True
</DefaultPrinter>

 

I have the ImageableArea for A4 paper configured as follows in the Canon PIXMA MP560 PPD file for the Gutenprint v5.3.3 driver (I had to increase the y coordinate of the bottom left of the area to 2.000 in order for the bottom line to be printed):

user $ sudo grep "ImageableArea A4" /etc/cups/ppd/Canon_MP560_Wi-Fi.ppd
*ImageableArea A4/A4:   "0.000 2.000 595.000 842.000"

After restarting the CUPS service I printed another CUPS Printer test page and the result is shown below. As you can see, the bottom line is now printed.

Printer test page printed by CUPS after modifying the Canon PIXMA MP560 PPD file

So, if the outline of the CUPS Printer test page is not centred or is missing one or more of the lines, first adjust the ImageableArea for the paper size on which the test page is being printed, and, if that does not result in success, check if ‘Option fitplot‘ exists for the printer in the file /etc/cups/printers.conf and that it is set to ‘True‘.

About Fitzcarraldo
A Linux user with an interest in all things technical.

5 Responses to How to prevent CUPS omitting the bottom of the CUPS Printer test page

  1. viewinghood says:

    Here in Europe we use A4 everywhere, I think. But in the US there is “letter” predominant. And, if I recall correctly, the width of letter is much more. Is it possible that some settings deep inside CUPS interfere with this? 🙄

    • Fitzcarraldo says:

      No, they are separate settings. If you look in the PPD file for a printer, each paper size has its own settings for the ImageableArea. For the Canon PIXMA MP510 with the Gutenprint driver v5.3.3, the ImageableArea coordinates for Letter in the PPD file installed by the driver are:

      $ sudo grep "ImageableArea Letter" /etc/cups/ppd/MP510.ppd
      *ImageableArea Letter/Letter: "0.000 0.000 612.000 792.000"

      If part of the image gets cut off, or is not positioned correctly on the page, when CUPS prints the ‘Printer test page’ on a sheet of Letter paper after the printer has been configured for Letter, then an adjustment can also be made to the coordinates in the PPD file for the ImageableArea for Letter.

      I have used many different printer models to print on US paper sizes (Letter, Ledger/Tabloid, etc.) in various countries and ISO paper sizes (A4, A3, etc.) in others. CUPS caters for all these paper sizes.

      These are the as-installed ImageableArea coordinates in the PPD installed by the Gutenprint open-source driver v5.3.3 for another of my printers, a Canon PIXMA MP560, as viewed on one of my desktop machines:

      $ sudo grep "ImageableArea Letter" /etc/cups/ppd/Canon_MP560_Wi-Fi.ppd
      *ImageableArea Letter/Letter: "0.000 0.000 612.000 792.000"
      $ sudo grep "ImageableArea A4" /etc/cups/ppd/Canon_MP560_Wi-Fi.ppd
      *ImageableArea A4/A4: "0.000 0.000 595.000 842.000"

      When I print on A4 paper to that printer (configured for A4 in CUPS) from my desktop machine, the bottom of the CUPS ‘Printer test page’ is cut off as well.

      These are the as-installed ImageableArea coordinates in the PPD installed by the Canon closed-source driver v3.20 for the Canon PIXMA MP560 printer, as viewed on one of my laptops:

      $ grep "ImageableArea A4" /etc/cups/ppd/Canon_MP560_Printer.ppd
      *ImageableArea A4: "9.64 14.17 585.64 833.39"
      *ImageableArea A4.bl: "0 0 595 842"
      $ grep "ImageableArea Letter" /etc/cups/ppd/Canon_MP560_Printer.ppd
      *ImageableArea Letter: "18.14 14.17 594.14 783.50"
      *ImageableArea Letter.bl: "0 0 612 792"

      Notice that the Canon closed-source driver has inserted different coordinates for the bottom left of the ImageableArea. When I print on A4 paper to that printer (configured for A4 in CUPS) from my laptop using the Canon closed-source printer driver, the bottom of the CUPS ‘Printer test page’ is not cut off, it’s printed perfectly. So the outcome depends on the printer model, which driver you have installed and what default PPD settings it has installed.

      • viewinghood says:

        THX for clarification 👍

        • Fitzcarraldo says:

          Although the Canon close-source driver on my laptop prints the CUPS ‘Printer test page’ correctly on my other printer (the Canon PIXMA MP560), the open-source Gutenprint v5.3.3 driver on my desktop machine for that printer did not print the line at the bottom of the CUPS ‘Printer test page’, whatever y coordinate I specified for the bottom of the A4 ImageableArea in the PPD file that the Gutenprint driver installed. It turns out that an option in the file /etc/cups/printers.conf also affects the border lines that indicate the imageable area on the ‘CUPS Printer test page’.

          I have therefore added an Addendum to my blog post explaining how I fixed the A4 CUPS ‘Printer test page’ for the Canon PIXMA MP560 printed using the Gutenprint v5.3.3 driver on my desktop machine (with CUPS configured to print on A4 paper).

          Note that the border lines printed on the CUPS ‘Printer test page’ are generated ‘on the fly’ when the page is printed, i.e. they are not in the file /usr/share/cups/data/default-testpage.pdf, which only contains the graphics for the CUPS ‘Printer test page’. The information printed below the graphics on the CUPS ‘Printer test page’ is specified in the file /usr/share/cups/data/testprint and is also completed ‘on the fly’ when the test page is printed. It is possible to specify what information is printed on the test page – see the options (‘values’) for the Show command listed at the bottom of the following CUPS documentation page: https://www.cups.org/doc/spec-banner.html

        • viewinghood says:

          Yes, I recall now these options. Years ago I optimized CUPS printing out of MacOS 10.5 and 10.6 to print on the HP LJ 6MP/PS. Also my Lubuntu maschines use the printer via network.
          There was a creepy issue: with the PPD-file from the original Gutenberg project printing a page took me two minutes. I made a deep dive into it, but I found no configuration errors. Finally I exchanged the PPD-file from an old HP archive and printing is as fast as from win32…

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: