PDFiumVCL Docs

FitMode property

Deze API-entry behoudt identifiers, signatures, codeblokken en PDF-termen in hun oorspronkelijke vorm.
Component: TPdfView  ·  Unit: PDFium
Controls how the current page sits inside the viewer's client area; re-applied automatically on Resize and when PageNumber changes so long documents with mixed page sizes stay framed.

Syntax

property FitMode: TPdfViewFitMode;

Description

FitMode is the standard PDF-viewer fit-page / fit-width selector exposed as a published property so applications can drop a TPdfView onto a form and pick a layout without writing zoom math. Each value maps onto a clear visual behaviour:

The active fit mode is re-applied automatically when the control is resized and when the current page changes — that is the whole point of FitMode versus a one-shot zoom assignment. Long documents with mixed page sizes (a portrait cover followed by landscape spreads, for example) stay perfectly framed without any extra Resize / OnPageChange handler.

Setting Zoom directly cancels the active fit mode and reverts FitMode to pfmNone, matching the standard PDF viewer convention where typing a zoom percentage drops out of "Fit Page" / "Fit Width". This keeps the property value honest: FitMode <> pfmNone means "the view will re-fit on the next layout event".

Remarks

Example

// Whole page fits in viewport, even after resize / page change
PdfView1.FitMode := pfmFitPage;

// Page width matches viewport width — long-document reading mode
PdfView1.FitMode := pfmFitWidth;

// 100% — one PDF point per pixel
PdfView1.FitMode := pfmActualSize;

// User types a zoom value → drop out of fit mode
PdfView1.Zoom := 1.5;
Assert(PdfView1.FitMode = pfmNone);

See Also

Zoom, PageZoom, PageWidthZoom, PageHeightZoom, ActualSizeZoom