Use A4 paper by default for printing with CUPS and AirPrint
When you try to set up a self-hosted AirPrint print server with Linux and CUPS, your iPhone or iPad may only allow you to print in Legal and Letter sizes, instead of your-preferred A4.
You can set up the following steps to make sure that your iPhone or iPad uses the A4 size by default.
- Open
/etc/cups/cupsd.conf, then set or add (if not exists)DefaultPaperSize A4(instead ofDefaultPaperSize Letter). - Change the value on
/etc/papersizetoa4(instead ofletter). - Open your printer's PPD file on
/etc/cups/ppd, then modify the following values toA4(instead ofLetter):
*DefaultPageSize: A4
*StpDefaultPageSize: A4
*DefaultPageRegion: A4
*StpDefaultPageRegion: A4
*DefaultImageableArea: A4
*StpDefaultImageableArea: A4
*DefaultPaperDimension: A4
*StpDefaultPaperDimension: A4
- Delete the CUPS cache directory with
sudo rm -rf /var/cache/cups. Just to make sure things working right due to an old bug. - Try to reopen the Print menu on your iPhone or iPad.
Some printers may only print A4 papers properly if the page size values are adjusted.
- On your printer's PPD file on
/etc/cups/ppd, Change all occurences ofPageSize[595.000 842.000]toPageSize[595.275590551181 841.889763779528]. - Delete the CUPS cache directory with
sudo rm -rf /var/cache/cups. Just to make sure things working right due to an old bug. - Try to reopen the Print menu on your iPhone or iPad.