/ViewerPreferences /PrintScaling
hint — whether the PDF author wants the viewer's print dialog to default to
application-defined fit-to-page scaling or to print pages at their authored size.property PrintScaling: Boolean; // read only
The /PrintScaling entry of /ViewerPreferences takes one of
two named values per PDF 32000-1 § 12.2 Table 150:
/AppDefault — let the viewer apply its usual scaling behavior
(commonly "Fit to printable area"). PDFiumVCL maps this to
True./None — the document was laid out at the intended physical size
and should be sent to the printer 1:1, with no shrinking or fitting. PDFiumVCL maps
this to False.Use the property when wiring a PDF print pipeline so the user does not have to second
guess what the document expects. Forms, fixed-format invoices, labels with bar codes,
and pre-press proofs typically set /None so the bar codes / measurements
come out exactly the right size; brochures and bound documents typically leave the
default so they fit any paper size.
This is a hint only — PDFium does not enforce it during rasterisation. Your
printing layer (VCL Printer, GDI StartDoc, or any other) is
what actually scales (or refuses to scale) the rendered bitmap or PostScript stream.
Pair it with PrintPaperHandling,
PrintCopies and
PrintPageRanges when populating a print dialog.
/ViewerPreferences PDFium returns the spec default True (AppDefault).ViewerPreference['PrintScaling'] instead, which returns the literal token./None.PrintScaling = False, leave the default radio button when True.
// Apply the document's preferred scaling mode to the printer setup.
begin
if Pdf1.PrintScaling then
begin
radioFit.Checked := True;
Memo1.Lines.Add('PDF prefers app-default (fit to page) scaling');
end
else
begin
radioActualSize.Checked := True;
Memo1.Lines.Add('PDF requests actual-size print (no scaling)');
end;
end;