zopefoundation/z3c.rml — pull request #3 by kylemacfarlane (2013-03-06 00:49:57+00:00)
Title: Added printScaling attribute to document

The ReportLab canvas has the method ``setViewerPreferences`` that lets you set some default preferences for viewers that open your PDF. The possible values are shown in ``reportlab.pdfbase.pdfdoc.ViewerPreferencesPDFDictionary``:

HideToolbar=checkPDFBoolean,
HideMenubar=checkPDFBoolean,
HideWindowUI=checkPDFBoolean,
FitWindow=checkPDFBoolean,
CenterWindow=checkPDFBoolean,
DisplayDocTitle=checkPDFBoolean, #contributed by mark Erbaugh
NonFullScreenPageMode=checkPDFNames(*'UseNone UseOutlines UseThumbs UseOC'.split()),
Direction=checkPDFNames(*'L2R R2L'.split()),
ViewArea=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()),
ViewClip=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()),
PrintArea=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()),
PrintClip=checkPDFNames(*'MediaBox CropBox BleedBox TrimBox ArtBox'.split()),
PrintScaling=checkPDFNames(*'None AppDefault'.split()),

The most useful of these is ``PrintScaling`` which allows you to set the default print size to the actual document size which is good if you're printing anything that requires precision.

I needed this option so I quickly added it to the ``document`` element but it might be worth implementing them all somehow. None of them are available in RML2PDF.

Something similar that might be useful would be the ability to set ``OpenAction`` (still misspelt ``OptionActions`` in ReportLab 2.6) which allows you to set some javascript that is run when the PDF is opened. This is usually used to open the print dialog automatically.