Forum How do I...?

Print scaling control and macOS Preview app

As an Apple reseller we and our customers print documents with the macOS Preview app. Unfortunately we don't seem to be able to control its default scaling behaviour for Prince generated PDFs.

Downloading and printing this Prince invoice sample leads to the desired result:

The default scaling in the Preview app is set correctly to 100%:

However, if we generate a new PDF file based on the samples input data, the Preview app sets its default scaling to 96%:

And modifying the CSS to include

@prince-pdf {
    -prince-pdf-print-scaling: none

doesn't help either (see the tests in the attached ZIP file).

Are we doing anything wrong?
  1. MacPreviewCorrectScaling.png470.2 kB
  2. MacPreviewWrongScaling.png448.6 kB
  3. PrintScalingControl MacPreview.zip4.5 MB
Some further observations:

  • The actual width of A4 PDFs generated by Prince 13.6 is not 210 mm, but 210.1 mm. This seemed to be different under Prince 8.1 – see Screenshots below.
  • The macOS Preview app applies the correct default scaling of 100% as long as the actual width of the PDF matches perfectly the width of the selected paper format (in our case the 210 mm of the A4 format).
  • In any other case the Preview app starts to downscale (even if the actual width of the PDF is less then the width of the selected paper format!).
  • The actual height of the PDF doesn't seem to matter.
  • It is possible to suppress the scaling behaviour of the macOS Preview app with:
    defaults write PVImagePrintingScaleMode 0

As we can't change the configuration of every user that prints our documents on their Mac: Is there by any chance a way to force Prince to generate PDFs that are exactly 210 mm wide?

OriginalOutput CorrectScaling.png

TestOutput WrongScaling.png
  1. OriginalOutput CorrectScaling.png135.5 kB
  2. TestOutput WrongScaling.png136.9 kB

Edited by dsu