Printing on custom paper size / adding paper size to PPD

cupspdfppd

I have some trouble when printing to custom paper sizes. Currently, I want to print something to a 21cm x 21cm card. So, I created a document with this size in libre office and exported it to PDF. The PDF looks fine.

When I want to print the document, the printer dialog has no option for this paper size. If I choose Din A4 (also 21cm wide), strange things happen:

  • Acrobat Reader centers the document on an A4 sheet as it thinks it's printing to A4.
  • Okular aligns the top of the document with the top of the sheet. This would be fine and exactly what I want, but it also crops the upper part of the documents. It looks as if it puts the document top-aligned on the sheet and then erases everything outside a center-aligned box of the same size as the document size.

My current workaround is to create the document in A4 size, aligning the area to be printed to the top of the page. However, this looks odd when creating the document.

I saw that using the --custom option of the printing command may allow this, but I do not want to print the documents from the command line.


So, my question is:

  • How can I print documents of custom page sizes to paper sheets of the same custom size?
  • I saw paper sizes defined in my PPD file. Can I just edit it? Is there a convenient tool for this?

My printer is a brother L2340 laser printer with original cups drivers from brother. I'm running OpenSuse 13.2, cups is 1.5.4 if I'm correct.

Best Answer

According to : https://stackoverflow.com/a/3112256/544721 you need to add to your printer's file description four lines in appropriate places describing four properties of your page: PageSize, PageRegion, ImageableArea and PaperDimension.

Btw. Here is my try of adding description of S0929100 Cards roll to Dymo 450 LabelWriter: https://gist.github.com/gwpl/d6f90e41c5b07cd9f9262e4c6515037d , however it's still work in progress. Hopefully this will give you a hint, here is digest of mentioned gist with four lines - each should land in appropriate section of .ppd file:

*PageSize w144h252/S0929100 Cards - Appointment Name Badge 51x89 mm : "<</PageSize[144 252]/ImagingBBox null/cupsInteger0 0>>setpagedevice"
*PageRegion w144h252/S0929100 Cards - Appointment Name Badge 51x89 mm : "<</PageSize[144 252]/ImagingBBox null/cupsInteger0 0>>setpagedevice"
*ImageableArea w144h252/S0929100 Cards - Appointment Name Badge 51x89 mm : "0.00 4.32 141.12 235.44"
*PaperDimension w144h252/S0929100 Cards - Appointment Name Badge 51x89 mm : "144.00 252.00"
Related Question