PDFium Delphi Component Docs

Advanced page content APIs

Component: TPdf  ·  Unit: PDFium
Inspects and edits native page content without requiring applications to manage PDFium handles or bitmap buffers

Page object inspection

PageObjectInfo returns one TPdfPageObjectInfo snapshot containing the handle, object type, normal and rotated bounds, effective matrix, active state, transparency, fill and stroke colours, alpha values, stroke width, line join, line cap, dash array, and dash phase

HasRotatedBounds, HasActiveState, and the other Has* fields distinguish an unavailable native value from a valid zero value

RotatedBounds carries the rotated quadrilateral, HasLineJoin and HasLineCap gate the join and cap styles, and DashPhase offsets the start of the dash pattern

Batched page object editing

Info := Pdf1.PageObjectInfo(0);
Info.StrokeWidth := 4;
SetLength(Info.DashArray, 2);
Info.DashArray[0] := 8;
Info.DashArray[1] := 4;
Pdf1.UpdatePageObject(0, Info, [pocStrokeWidth, pocDashPattern]);

UpdatePageObject applies every selected field to the same native object and regenerates page content once

TransformPageObject composes an affine FS_MATRIX with the selected object

Paths, clip paths, and Form XObjects

Content marks, glyphs, and native object helpers

Character inspection and index mapping

CharacterInfo returns fill and stroke colours, font name, PDF font flags, loose glyph bounds, effective matrix, and the associated text-object handle

CharacterIndexToTextIndex and TextIndexToCharacterIndex convert between PDFium character indexes and indexes in the generated text stream

Annotation borders and appearance streams

TPdfAnnotation exposes border radii and width through HasBorder, BorderHorizontalRadius, BorderVerticalRadius, and BorderWidth

Colour coverage extends to ColorAlpha, InteriorColor, and InteriorColorAlpha, markup metadata is gated by HasAuthor, HasName, HasSubject, HasModificationDate, HasCreationDate, and HasIcon, and ink gestures, quad-point geometry, and link targets are exposed through InkList, HasAttachmentPoints, HasLinkUri, and LinkUri

Normal, rollover, and down appearance streams are available through the HasAppearanceNormal, HasAppearanceRollover, and HasAppearanceDown sentinels and their matching AppearanceNormal, AppearanceRollover, and AppearanceDown strings

When reading an annotation, these sentinels identify nonempty appearance content: the native API returns the same empty string for a missing stream and an empty stream, so both report False and are left untouched when the record is written back; callers can still explicitly set a sentinel to True to write an empty appearance

Assign the updated annotation record back to Annotation[Index] to write selected border or appearance values

Native library, annotation, and form diagnostics

Thumbnails and affine page transforms

Matrix rendering

Matrix.a := 0.5;
Matrix.b := 0;
Matrix.c := 0;
Matrix.d := -0.5;
Matrix.e := 0;
Matrix.f := 421;
Clip.Left := 0;
Clip.Top := 0;
Clip.Right := 300;
Clip.Bottom := 421;
Bitmap := Pdf1.RenderPageWithMatrix(300, 421, Matrix, Clip);

RenderPageWithMatrix accepts an invertible FS_MATRIX and a clipping rectangle in device coordinates

The overload that receives a caller-owned TBitmap renders directly into a compatible 32-bit DIB and falls back to one copy only when an external PDFium bitmap cannot be created

Matrix rendering draws page content and non-interactive annotations selected through render flags, but it does not invoke the form-fill overlay renderer