property Page: FPDF_PAGE; // read only
Page exposes the raw PDFium FPDF_PAGE handle bound to the currently
active page. The handle is allocated when PageNumber is set (or when
Active transitions to True) and is kept alive for the
lifetime of that page binding. It is the same handle that PDFium’s C API expects
for every FPDFPage_*, FPDF_RenderPage*, annotation, content
stream, and form widget call.
The handle is valid only while Active is True and a valid
PageNumber is set. Assigning a new PageNumber, calling
ReloadPage, or setting Active back to False
destroys the existing handle and (in the first two cases) creates a new one. Do
not call FPDF_ClosePage on this handle — the component owns
its lifetime and will tear it down automatically.
Page is an advanced property useful when calling PDFium APIs that PDFiumVCL has not
yet wrapped — for example custom appearance stream regeneration, page-object
bookkeeping, or low-level text-extraction tweaks. Most callers should prefer the
high-level properties (PageWidth, PageHeight,
RenderToBitmap, Annotation, etc.) which already manage the
handle correctly.
nil when no page is active. Always check before passing
the handle to a PDFium function.Document.Document when calling PDFium APIs that take both
handles — e.g. FPDFPage_Delete(Pdf.Document, Pdf.PageNumber - 1).
var P: FPDF_PAGE;
Pdf1.Active := True;
Pdf1.PageNumber := 1;
P := Pdf1.Page;
if Assigned(P) then
ShowMessage(Format('%.0f x %.0f points',
[FPDF_GetPageWidth(P), FPDF_GetPageHeight(P)]));