Документация PDFiumVCL

Pdf property

Эта запись API сохраняет идентификаторы, сигнатуры, блоки кода и термины PDF в исходном виде.
Component: TPdfView  ·  Unit: PDFium
References the TPdf component whose document is rendered by the viewer.

Syntax

property Pdf: TPdf;

Description

Pdf is the document source for the viewer. The viewer does not own a parser of its own — every page-, text-, image-, annotation- and form-related operation it exposes is delegated to the underlying TPdf instance pointed to by this property. Indexed properties such as Character, Bitmap, WebLink, and counters like PageCount or BitmapCount simply forward to the linked component, scoped to whatever page the viewer is currently showing.

Two usage patterns are supported. The shared pattern drops a TPdf on the form, sets Pdf to it at design time, and lets the same TPdf back several viewers, a printer routine, and a thumbnail panel from one in-memory document. The self-contained pattern leaves Pdf unassigned; the viewer creates and owns an internal TPdf the first time Active is set to True and frees it on destruction, so an application that only ever shows one document can ignore the helper component entirely.

When Pdf is changed while Active is True the viewer reloads the current page from the new source. Setting Pdf to nil on an active viewer deactivates it.

Remarks

Example

// Pattern 1: explicit shared TPdf, drives two viewers.
PdfView1.Pdf := Pdf1;
PdfThumbView.Pdf := Pdf1;
Pdf1.FileName := OpenDialog1.FileName;
PdfView1.Active := True;
PdfThumbView.Active := True;

// Pattern 2: let the viewer own its TPdf.
PdfView2.Pdf.FileName := 'C:\docs\report.pdf';
PdfView2.Active := True;
ShowMessage(Format('Author: %s', [PdfView2.Pdf.Author]));

See Also

Active, PageNumber, PageCount, TPdf, TPdf.Active, TPdf.FileName