PDFium Component Docs

FitMode الخاصية

Component: TPdfView  ·  Unit: PDFium
يتحكم في كيفية تموضع الصفحة الحالية داخل منطقة العميل الخاصة بالعارض؛ ويُعاد تطبيقه تلقائيًا عند Resize وعند تغيّر PageNumber حتى تبقى المستندات الطويلة ذات أحجام الصفحات المختلطة مؤطرة بشكل صحيح

Syntax

property FitMode: TPdfFitMode;

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 behavior:

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