PDFium Component Docs

PDFium VCL API Reference

Helper Units

UnitDescription
FPdfAsyncProvides cancellation tokens and lightweight future helpers for cancelable background PDF work.
FPdfMatrixProvides the TPdfMatrix affine matrix wrapper used with PDFium page-object transform APIs.
FPdfMeasureAdds TPdf.MeasureText, MeasureTextWidth, and WrapText helper methods for text layout in PDF user units
FPdfPreflightReportBuilds reusable PDF/A, PDF/UA, PDF/E, PDF/X, PDF/R, and PDF/VT preflight report objects with TXT / HTML / Markdown / JSON / CSV export and issue-category counts.
FPdfThumbnailProvides the TPdfThumbnailView scrollable thumbnail navigation control.

TPdf Component Methods

Document Management

MethodDescription
CreateDocumentCreate a new empty PDF document
LoadDocument(Data: TMemoryStream; Buffered: Boolean = True)Load PDF document from memory stream
LoadDocument(Data: Pointer; Size: Integer; Buffered: Boolean = True)Load PDF document from memory buffer
LoadDocumentLoad PDF document from FileName
LoadDocument(const Data: TBytes; Buffered: Boolean = True)Load PDF document from TBytes
LoadCustomDocument(AStream: TStream; AOwnsStream: Boolean = False)Stream a PDF document from any TStream via FPDF_LoadCustomDocument; PDFium pulls blocks on demand instead of copying the entire file into memory. AOwnsStream = True transfers stream lifetime to the TPdf instance.
SaveAs(Stream: TStream; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): BooleanSave document to stream. When Compressed is True, ensures all streams are FlateDecode compressed. Explicit pv13 through pv17 targets are normalized and validated, including existing catalog /Version overrides in incremental output; incompatible newer PDF features raise EPdfError. Saved files without an existing OpenAction open on the first page with Fit Height zoom when the target version supports it. Trial builds apply the trial watermark during save.
SaveAs(const FileName: string; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): BooleanSave document to file. Explicit pv13 through pv17 targets are normalized and validated, including existing catalog /Version overrides in incremental output; incompatible newer PDF features raise EPdfError. Saved files without an existing OpenAction open on the first page with Fit Height zoom when the target version supports it. Trial builds apply the trial watermark during save.
ImportPages(Pdf: TPdf; const Range: string; PageNumber: Integer = 1): BooleanImport pages from another PDF document. Range format: '1,3,5-7'
ImportPreferences(Pdf: TPdf): BooleanImport viewer preferences from another PDF

Page Operations

MethodDescription
AddPage(PageNumber: Integer; Width, Height: Double)Add a new page at the specified one-based position with given dimensions (in points, 72 points = 1 inch). Passing 0 is accepted as a compatibility alias for inserting the first page, and the inserted page becomes current.
DeletePage(PageNumber: Integer)Delete page at specified index
GetPageBox(Box: TPdfPageBox): TPdfRectangleRead the selected page dictionary box from the current page
RemoveObject(Index: Integer; DestroyObject: Boolean = True)Remove a page object from the current page and regenerate page content
ReloadPageReload the current page
SetPageBox(Box: TPdfPageBox; const Rectangle: TPdfRectangle)Set the selected page dictionary box on the current page
UpdatePageApply pending changes to the current page (calls FPDFPage_GenerateContent)

Text Operations

MethodDescription
Text(StartIndex: Integer = 0; Count: Integer = MaxInt): WStringExtract text from current page
TextInRectangle(Left, Top, Right, Bottom: Double): WStringExtract text from rectangular area (page coordinates)
TextInRectangle(Rectangle: TPdfRectangle): WStringExtract text from rectangle
AddText(const Text, Font: WString; FontSize: Single; X, Y: Double; Color: TColor = clBlack; Alpha: Byte = $FF; Angle: Double = 0.0)Add text at specified position with font, color, transparency, and rotation angle
SetText(ObjectIndex: Integer; const Text: WString)Set text for an existing text object (undocumented PDFium API, may cause formatting issues)
SetTextPositions(ObjectIndex: Integer; const Positions: TPdfSingleArray)Set per-character positions for an existing text object. Positions start with the second character and are relative to the text object origin.
FindFirst(const Text: WString; Options: TSearchOptions = []; StartIndex: Integer = 0; DirectionUp: Boolean = True): IntegerStart text search, returns character index or -1 if not found
FindNext: IntegerContinue text search forward, returns character index or -1
FindPrevious: IntegerContinue text search backward, returns character index or -1
CharacterIndexAtPos(X, Y, ToleranceX, ToleranceY: Double): IntegerGet character index at page position
RectangleCount(StartIndex: Integer = 0; Count: Integer = MaxInt): IntegerGet the number of text rectangles for a character range
ReadingUnits: TPdfReadingUnitsReturn sentence-level reading units for assistive listen-reading and semantic navigation
DocumentReadingUnits: TPdfReadingUnitsBuilds sentence-level TPdfReadingUnit records for the whole document readable-content stream
PageWordBoxes: TPdfWordBoxesReturn word boxes with FTextPage ranges and page-space rectangles for word-by-word highlighting
SetReadingWord(const Word: TPdfWordBox)Highlights one TPdfWordBox as the current spoken word on TPdfView
ClearReadingWordClears the current word-level reading cursor overlay on TPdfView
TrackReadingWordAt(PageNumber, CharIndex: Integer): IntegerMaps a page character offset to the containing TPdfWordBox, highlights it, and returns the word index
SelectWordBox(const Word: TPdfWordBox): BooleanSelect the viewer text range represented by one TPdfWordBox
SelectWordSpan(const Words: TPdfWordBoxes; StartIndex, EndIndex: Integer): BooleanSelect a same-page span of TPdfWordBox records as one viewer text selection
BuildReadingUnits(Fragments)Converts TPdfContentFragments into sentence-level TPdfReadingUnit records without loading pdfium.dll
NextReadingUnitOfKind(Units, CurrentIndex, Kind, GoForward)Finds the next or previous TPdfReadingUnit whose Kind matches a requested TPdfContentFragmentKind
BuildWordBoxes(PageText)Splits page text into TPdfWordBox records with word text and FTextPage character ranges
WordBoxIndexAtCharIndex(Words, CharIndex)Map a character index back to the zero-based TPdfWordBox index that contains it
SpokenTextAppend(var Spoken: TPdfSpokenText; const SpokenPart: WString; Page, StartIndex: Integer; SourceCount: Integer = -1)Append one mapped spoken-text run to TPdfSpokenText
BuildSpokenTextFromWords(Words, FirstWord, LastWord)Build TPdfSpokenText from a contiguous TPdfWordBox range
SpokenToPageChar(Spoken, SpokenOffset, Page, CharIndex)Translate a speech-engine character offset back to a PDF page character
EstimateSpokenWordIndex(Words, ElapsedMs, WordsPerMinute)Estimate the spoken word index when the speech engine reports no word position

Annotation Operations

MethodDescription
CreateAnnotation(const Annotation: TPdfAnnotation)Create a new annotation on the current page
DeleteAnnotation(Index: Integer)Delete annotation at index

Form Flattening

MethodDescription
GenerateFormAppearancesRegenerates /AP appearance streams for every form widget on every page (FPDF_FFLDraw). Call after FormField[] assignments and before SaveAs / FlattenPage / FlattenAllPages.
FlattenPage(nFlag: Integer = FLAT_NORMALDISPLAY): IntegerFlatten annotations and form widgets on the current page into static content. Returns FLATTEN_SUCCESS, FLATTEN_NOTHINGTODO, or FLATTEN_FAIL.
FlattenAllPages(nFlag: Integer = FLAT_NORMALDISPLAY): BooleanFlatten every page in the document. Returns True when all pages succeed.
SetFormFieldFlags(Index: Integer; const Flags: TPdfFormFieldFlags)Set AcroForm field flags for the form field at the specified annotation index on the current page.
SetFormFieldFlagsAt(X, Y: Single; const Flags: TPdfFormFieldFlags)Set AcroForm field flags for the form field at the specified page coordinates.

XFA Operations

MethodDescription
GetXfaConfigRetrieves the raw XML bytes of the XFA config packet from the PDF document
GetXfaDatasetsRetrieves the original XFA datasets XML bytes from the PDF document
GetXfaFormPacketsSnapshots all embedded XFA packets in a TXfaPacketList collection
GetXfaTemplateRetrieves the raw XML bytes of the XFA template packet from the PDF document

Attachment Operations

MethodDescription
CreateAttachment(const Name: WString): BooleanCreate a new empty attachment
DeleteAttachment(Index: Integer): BooleanDelete attachment at index

Image Operations

MethodDescription
AddJpegImage(JpegImage: TStream; X, Y, Width, Height: Double): BooleanAdd JPEG image from stream at specified position and size
AddPicture(Picture: TPicture; X, Y: Double)Add picture at position (original size)
AddPicture(Picture: TPicture; X, Y, Width, Height: Double)Add picture at position with specified size
AddImage(const FileName: string; X, Y, Width, Height: Double)Direct image-file insertion (delegates to AddPicture through a temporary TPicture); accepts any image format registered with the VCL or LCL graphics units
AddImage(Bitmap: TBitmap; X, Y, Width, Height: Double)Insert a pf32bit TBitmap directly without the TPicture intermediary; raises EPdfError on nil bitmap

Drawing Operations

MethodDescription
CreatePath(X, Y: Single; FillMode; FillColor; FillAlpha; Stroke; StrokeColor; StrokeAlpha; StrokeWidth; LineCap; LineJoin; BlendMode)Create a path starting at position (X, Y)
CreatePath(X, Y, Width, Height: Single; ...)Create a rectangular path with given bounds
MoveTo(X, Y: Single)Move the current point to (X, Y)
LineTo(X, Y: Single)Draw a line from the current point to (X, Y)
BezierTo(X1, Y1, X2, Y2, X3, Y3: Single)Draw a Bezier curve with two control points and an endpoint
ClosePathClose the current subpath
AddPathAdd the completed path to the current page

Rendering

MethodDescription
RenderPage(DeviceContext: HDC; Left, Top, Width, Height: Integer; Rotation; Options)Render page to a device context (HDC)
RenderPage(Left, Top, Width, Height: Integer; Rotation; Options; Color): TBitmapRender page to a new bitmap
RenderPage(Bitmap: TBitmap; Left, Top, Width, Height: Integer; Rotation; Options; Color)Render page to an existing bitmap
RenderPageThumbnail(PageIndex, MaxWidth, MaxHeight: Integer): TBitmapRender any one-based page to a caller-owned thumbnail bitmap without changing PageNumber or firing page-change notifications
RenderTile(Left, Top, Width, Height, PageWidth, PageHeight: Integer; ...): TBitmapRender a tile (portion) of a page to a new bitmap
RenderTile(Bitmap: TBitmap; Left, Top, Width, Height, PageWidth, PageHeight: Integer; ...)Render a tile to an existing bitmap
InvertPdfBitmap(Bitmap)Inverts RGB channels in a rendered 32-bit TBitmap in place for dark-mode or high-contrast viewing
GrayscalePdfBitmap(Bitmap)Converts a rendered 32-bit TBitmap to luminance grayscale in place
DuotonePdfBitmap(Bitmap, DarkColor, LightColor)Maps rendered bitmap luminance onto caller-selected dark and light colours in place

Coordinate Conversion

MethodDescription
DeviceToPage(X, Y, Left, Top, Width, Height: Integer; Rotation: TRotation; out PageX, PageY: Double): BooleanConvert device coordinates to page coordinates
PageToDevice(PageX, PageY: Double; Left, Top, Width, Height: Integer; Rotation: TRotation; out X, Y: Integer): BooleanConvert page coordinates to device coordinates

PAdES Digital Signatures

MethodDescription
PadesCryptoAvailableIndicates whether the signature cryptographical backend is available on the system
SaveAsPadesDss(const FileName: string; const Options: TPadesDssOptions)Saves the active PDF to a file while embedding PAdES DSS validation certificates
SaveAsPadesDssToStream(Stream: TStream; const Options: TPadesDssOptions)Saves the active PDF to a custom stream while embedding PAdES DSS validation certificates
SignPades(const FileName: string; const Options: TPadesSignOptions)Appends a PAdES signature update to the PDF document using local certificate stores
SignPadesToStream(Stream: TStream; const Options: TPadesSignOptions)Appends a PAdES signature update to the PDF document and writes the result to a stream
SignPadesWithPdfA(const FileName: string; const Options; PdfAOptions)Saves a signed PAdES PDF document complying with PDF/A archive standards
ValidatePadesValidates all digital signatures in the PDF and returns a PAdES compliance report

TPdf Component Properties

Published Properties (Design-Time)

PropertyTypeDescription
AboutstringComponent version information (stored False)
ActiveBooleanSet to True to load/activate the document, False to close it
FileNamestringPath to the PDF file to load
FormFillBooleanEnable interactive form filling with JavaScript support (default True)
PageNumberIntegerCurrent page number (1-based, 0 when no document is loaded)
PasswordstringPassword for opening encrypted PDF documents

Document Properties

PropertyTypeR/WDescription
AuthorWStringRDocument author
CompressedBooleanR/WWhen True (default), SaveAs post-processes the output to ensure all streams are FlateDecode compressed
CreationDateWStringRDocument creation date metadata
CreatorWStringRApplication that created the document
DocumentFPDF_DOCUMENTRLow-level PDFium document handle
FileIdentifier[IDType: TPdfFileIdentifierType]TBytesRPermanent or changing trailer file identifier bytes without the PDFium terminator byte
FormTypeTPdfFormTypeRForm type: ftNone, ftAcroForm, ftXFAFull, ftXFAForeground
IsTaggedBooleanRTrue if document is a tagged PDF
JavaScriptAction[Index]TPdfJavaScriptActionRDocument-level JavaScript name-tree action by zero-based index
JavaScriptActionCountIntegerRNumber of document-level JavaScript name-tree actions
JavaScriptActionsTPdfJavaScriptActionsRAll document-level JavaScript name-tree actions
KeywordsWStringRDocument keywords
LanguageWStringR/WDocument catalog language (/Lang)
StructureElementsTPdfStructureElementsRFlattened logical structure elements for the current page
MetaText[const Tag: string]WStringRArbitrary metadata value by tag name
ModifiedDateWStringRLast modification date metadata
PageCountIntegerRTotal number of pages
PdfVersionTPdfVersionREffective PDF version, including a valid catalog /Version override when present
PermissionsLongWordRDocument permissions flags
PrintCopiesIntegerRNumber of print copies specified
PrintPageRangesTPdfPrintPageRangesROne-based print page ranges from viewer preferences
PrintPaperHandlingTPrintPaperHandlingRPaper handling preference
PrintScalingBooleanRWhether print scaling is enabled
ProducerWStringRPDF producer application
SubjectWStringRDocument subject
TitleWStringRDocument title
UserPermissionsLongWordRUser-level permissions
ViewerPreference[const Key: string]WStringRViewer preference value by key
XFABooleanRTrue if document contains XFA forms

Page Properties

PropertyTypeR/WDescription
PageFPDF_PAGERLow-level PDFium page handle
PageBoundsTPdfRectangleRBounding rectangle of the current page
PageBox[Box: TPdfPageBox]TPdfRectangleR/WMediaBox, CropBox, BleedBox, TrimBox, or ArtBox for the current page
PageHeightDoubleRHeight of current page in points
PageLabel[PageNumber: Integer]WStringRPage label for a given page number
PageModeTPageModeRHow the document should be displayed when opened
PageRotationTRotationR/WRotation of the current page (ro0, ro90, ro180, ro270)
PageWidthDoubleRWidth of current page in points
ThumbnailTBitmapRThumbnail bitmap of the current page
TransparentBooleanRTrue if the current page contains transparent content

Text and Character Properties

PropertyTypeDescription
Character[Index]WideCharUnicode character at index
CharacterAngle[Index]SingleCharacter rotation angle in radians
CharacterCountIntegerNumber of characters on current page
CharacterFontSize[Index]DoubleFont size of character at index; FontSize[Index] remains as a compatible alias
CharacterFontWeight[Index]IntegerFont weight of character at index
CharacterGenerated[Index]BooleanTrue if character was generated (not from original content)
CharacterIsHyphen[Index]BooleanTrue if character is a hyphen
CharacterMapError[Index]BooleanTrue if character has a mapping error
CharacterOrigin[Index]TPdfPointOrigin point of the character
CharacterRectangle[Index]TPdfRectangleBounding rectangle of the character
Charcode[Index]WideCharCharacter code at index
FindFPDF_SCHHANDLELow-level PDFium search handle
Rectangle[Index]TPdfRectangleText rectangle from last RectangleCount call
TextPageFPDF_TEXTPAGELow-level PDFium text page handle

Font Properties

PropertyTypeDescription
FontAscent[Index; FontSize]SingleAscent of the font used by the text object at index
FontBaseName[Index]WStringBase font name for the text object at index
FontData[Index]TBytesRaw font data for the text object at index
FontDescent[Index; FontSize]SingleDescent of the font used by the text object at index
FontFamilyName[Index]WStringFont family name for the text object at index
FontHandle[Index]FPDF_FONTLow-level PDFium font handle for the text object at index
FontIsEmbedded[Index]BooleanTrue if the text object's font is embedded in the PDF
FontItalicAngle[Index]IntegerItalic angle of the text object's font
FontSize[Index]DoubleBackward-compatible alias for CharacterFontSize[Index]
FontWeight[Index]IntegerFont weight of the text object's font (e.g., 400 = normal, 700 = bold)

Object Properties

PropertyTypeDescription
ObjectCountIntegerNumber of page objects
ObjectType[Index]TObjectTypeType: otUnknown, otText, otPath, otImage, otShading, otForm
ObjectBounds[Index]TPdfRectangleBounding rectangle of the object
ObjectBitmap[Index]TBitmapBitmap representation of the object
ObjectHandle[Index]PointerLow-level object handle
ObjectTransparent[Index]BooleanTrue if object is transparent

Image Properties

PropertyTypeDescription
Bitmap[Index]TBitmapBitmap of page object at index
BitmapCountIntegerNumber of bitmap objects on page
Image[Index]TPdfImageImage data (Width, Height, Data) at index
ImageCountIntegerNumber of images on page

Annotation Properties

PropertyTypeR/WDescription
Annotation[Index]TPdfAnnotationR/WGet or set annotation at index
AnnotationCountIntegerRNumber of annotations on current page

Form Properties

PropertyTypeR/WDescription
FormField[Index]WStringR/WForm field value by index
FormFieldAt[X, Y: Single]WStringR/WForm field value at page position
FormFieldCountIntegerRNumber of form fields on current page
FormFieldInfo[Index]TPdfFormFieldInfoRForm field information by index
FormFieldInfoAt[X, Y: Single]TPdfFormFieldInfoRForm field information at page position
FocusedFormFieldValue()WStringRReturns the current logical form field value by FocusedFormFieldIndex without depending on the interactive caret
FocusedFormFieldName()WStringRReturns the current logical form field display name, preferring AlternateName and falling back to Name
FocusedFormFieldDetails()TPdfFormFieldInfoRReturns TPdfFormFieldInfo for the current logical form field
FormHandleFPDF_FORMHANDLERLow-level form fill handle
HasFormFieldAt[X, Y: Single]BooleanRTrue if a form field exists at the position

Attachment Properties

PropertyTypeR/WDescription
Attachment[Index]TBytesR/WAttachment data by index
AttachmentCountIntegerRNumber of attachments
AttachmentName[Index]WStringRAttachment filename by index
AttachmentType[Index]WStringRAttachment MIME subtype by index

Navigation Properties

PropertyTypeDescription
Bookmark[const Title: WString]TBookmarkFind bookmark by title
BookmarkChildren[const Bookmark: TBookmark]TBookmarksChild bookmarks of a bookmark
BookmarkFrom[Handle: FPDF_BOOKMARK]TBookmarkBookmark data from a handle
BookmarksTBookmarksTop-level bookmarks array
Destination[Index]TDestinationNamed destination by index
DestinationByName[const Name: WString]TDestinationNamed destination by name
DestinationCountIntegerNumber of named destinations
HasBookmarkChildren[const Bookmark: TBookmark]BooleanTrue if bookmark has children
LinkAnnotation[PageNumber, Index]TLinkAnnotationLink annotation on a given page
LinkAnnotationCount[PageNumber]IntegerNumber of link annotations on a page
WebLink[PageNumber, Index]TWebLinkWeb link (URL) on a given page
WebLinkCount[PageNumber]IntegerNumber of web links on a page

Digital Signature Properties

PropertyTypeDescription
Signature[Index]TPdfSignatureDigital signature information at index
SignatureCountIntegerNumber of digital signatures in the document

TPdf Events

EventTypeDescription
OnFormFieldEnterTPdfFormFieldEnterEventFired when a form field is entered. Parameters: Sender: TObject; const Text: WString
OnFormFieldExitTNotifyEventFired when focus leaves a form field
OnJavaScriptResponseTPdfJavaScriptResponseEventFired when PDF-embedded JavaScript actions request user interaction
OnPageChangeTNotifyEventFired when the current page changes
OnUnsupportedFeatureTPdfUnsupportedFeatureEventFired when the PDF contains an unsupported feature
OnXfaGotoUrlTPdfXfaGotoUrlEventFired when navigating link URLs inside dynamic XFA forms
OnXfaUriActionTPdfXfaUriActionEventFired when link URI actions trigger inside dynamic XFA contexts

Other Public Methods and Properties

APIDescription
span class="keyword">property About: stringReports PDFiumPas component version information for TPdf.
ActiveOpens or closes the selected PDF document.
span class="keyword">procedure AddImage(const FileName: string; X, Y, Width, Height: Double)Insert an image from a file into the current PDF page. Internally uses TPicture.LoadFromFile, so any image format registered with the VCL or LCL graphics units (BMP, PNG via Vcl.Imaging.PngImage / LCL TPortableNetworkGraphic, JPG, etc.) is accepted. Coordinates are in PDF user space (origin at the page lower-left); Width and Height are the placement size in user units, not the source image pixel size.
span class="keyword">function AddJpegImage(JpegImage: TStream; X, Y, Width, Height: Double): BooleanAdd JPEG image to the current PDF page using the specified coordinates.
span class="keyword">procedure AddPage(PageNumber: Integer; Width, Height: Double)Creates a new blank page with the given dimensions in points.
AddPathCommits the accumulated MoveTo/LineTo/BezierTo path as a new page object with the requested paint.
span class="keyword">procedure AddPicture(Picture: TPicture; X, Y: Double)Add picture to the current PDF page using the specified coordinates.
span class="keyword">procedure AddText(const Text, Font: WString; FontSize: Single; X, Y: Double; Color: TColor = clBlack; Alpha: Byte = $FF; Angle: Double = 0.0)Add text to the current PDF page at the specified position.
AnnotationIndexed property — returns the annotation record at the given index on the current page (subtype, rect, color, contents, etc.)
AnnotationCountNumber of annotation objects attached to the currently active page.
span class="keyword">property Attachment[Index: Integer]: TBytesReads or replaces the raw byte payload of the document-level embedded file at the specified zero-based index. Each slot corresponds to one entry in the PDF EmbeddedFiles name tree defined in section 7.11 of the PDF 1.7 specification.
AttachmentCountNumber of embedded file attachments declared in the document.
AttachmentNameReturns the Unicode file name registered for the embedded file at the given zero-based index in the document EmbeddedFiles name tree.
AttachmentTypeReturns the registered MIME / subtype string for the embedded file at the specified zero-based index. The value is taken from the file specification dictionary's /Subtype entry as defined in PDF section 7.11.3.
AuthorReturns the value of the /Author entry from the PDF document information dictionary.
BezierToAppends a cubic Bezier curve from the current point through control points (X1,Y1) and (X2,Y2) to (X3,Y3).
BitmapReturns a freshly-decoded VCL TBitmap holding the raster data of the specified image object on the current page. The bitmap is newly allocated on each call; the caller owns it and is responsible for calling Free.
BitmapCountNumber of image page objects on the active page, accessible as VCL TBitmap.
BookmarkLooks up a bookmark by its title string and returns the matching TBookmark record from the document outline tree defined in PDF section 12.3.3.
BookmarkChildrenIndexed property — returns the immediate child bookmarks of a given parent bookmark node
BookmarkFromConverts a raw FPDF_BOOKMARK handle into a fully populated TBookmark record by reading the title, destination page, and action metadata for that outline node.
BookmarksIndexed property — returns the full list of top-level outline (bookmark) entries for the document
CharacterRead-only indexed access to the UTF-16 string form of the character at the given index (typically one code unit, but two for a surrogate pair).
CharacterAngleRead-only indexed access to the rotation angle of the character in radians, taking the page CTM into account.
CharacterCountNumber of extractable characters on the currently active page.
CharacterFontSizeRead-only indexed access to the effective font size used to render the character (in PDF points, after CTM scaling).
CharacterFontWeightRead-only indexed access to the OS/2 usWeightClass value of the font used (100 = Thin, 400 = Regular, 700 = Bold, 900 = Black).
CharacterGeneratedReturns True when the character at the specified index was synthesised by PDFium during text extraction rather than being drawn explicitly by the page content stream. Synthetic characters are emitted for ligature expansion, soft hyphenation, and word/line boundary heuristics so search and select-all results read naturally.
span class="keyword">function CharacterIndexAtPos(X, Y, ToleranceX, ToleranceY: Double): IntegerGet the index of a character at or nearby a certain position on the page. If there is no character at or nearby the point, return value will be -1. If an error occurs, -3 will be returned.
CharacterIsHyphenReturns True when the character at the specified index is recognized as a soft hyphen used for end-of-line word breaking. Useful when reconstructing words across line wraps without retaining the visible hyphen mark.
CharacterMapErrorReturns True when the character at the specified index could not be mapped to a valid Unicode code point. The flag is reported per-character by the PDFium text extractor and lets callers identify code points that are likely incorrect because the originating font lacks a usable ToUnicode CMap or encoding vector.
CharacterOriginRead-only indexed access to the origin (baseline-left anchor) of the character in PDF user-space points.
CharacterRectangleRead-only indexed access to the bounding rectangle of the character in PDF user-space coordinates (origin bottom-left, in points).
CharcodeRead-only indexed access to the Unicode code point (UCS-4) of the character at the given index.
span class="keyword">procedure ClearFormFieldFocusWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
ClosePathCloses the current sub-path by drawing a straight line back to the most recent MoveTo.
CompressedControls whether streams in the output PDF are FlateDecode-compressed when SaveAs / Save is called. The post-save compression engine scans the serialized PDF, replaces any uncompressed streams with their zlib-deflated equivalents, and rebuilds the xref table. Already-compressed streams pass through unchanged.
constructor Create(AOwner: TComponent); overrideCreates the TPdf component and initializes document, rendering, form, and cache state
span class="keyword">procedure CreateAnnotation(const Annotation: TPdfAnnotation)Create a new annotation.
CreateAttachmentAdds a new embedded file (attachment) at the document level.
span class="keyword">procedure CreateDocumentCloses the current document (if any) and starts a brand-new empty PDF.
span class="keyword">procedure CreatePath(X, Y: Single; FillMode: TPdfFillMode = fmNone; FillColor: TColor = clBlack; FillAlpha: Byte = $FF; Stroke: Boolean = True; StrokeColor: TColor = clBlack; StrokeAlpha: Byte = $FF; StrokeWidth: Single = 1.0; LineCap: TPdfLineCap = lcDefault; LineJoin: TPdfLineJoin = ljDefault; BlendMode: TPdfBlendMode = bmDefault)Create a new path object at an initial position.
CreateXObjectFromPageWraps a page from another TPdf as a reusable Form XObject handle that can be stamped into this document any number of times.
CreationDateOriginal creation timestamp from the document Info dictionary.
CreatorName of the originating authoring application stored in the Info dictionary.
DeleteAnnotationRemoves the annotation at the given index on the current page.
span class="keyword">function DeleteAttachment(Index: Integer): BooleanRemoves the embedded file attachment at the given index.
span class="keyword">procedure DeletePage(PageNumber: Integer)Removes the page at PageIndex from the document.
DestinationReturns the TDestination record for the named destination at the specified zero-based index. Named destinations are the indirect targets defined under the document catalog Dests / Names tree as described in PDF section 12.3.2.
DestinationByNameLooks up a /Names destination by string name and returns its target page / fit-type / coordinates.
DestinationCountNumber of named destinations declared in the document.
destructor Destroy; overrideReleases document handles, form state, cached fonts, streams, and timers before TPdf is destroyed
ExportXFDFSerializes every form field value and annotation across all pages of the loaded document into an XFDF (ISO 19444-1) document, written as UTF-8 XML with the http://ns.adobe.com/xfdf/ namespace.
span class="keyword">function DeviceToPage(X, Y, Left, Top, Width, Height: Integer; Rotation: TRotation; out PageX, PageY: Double): BooleanConvert the screen coordinate of a point to page coordinate.
span class="keyword">property DocumentNative PDFium FPDF_DOCUMENT handle for direct low-level access.
span class="keyword">function DocumentReadableContent: TPdfContentFragmentsReturns semantic readable content fragments for screen-reader, text-to-speech, and accessibility workflows
function DocumentReadingUnits: TPdfReadingUnitsBuilds sentence-level TPdfReadingUnit records for the whole document readable-content stream
FileIdentifierRead-only flag — returns the document file identifier array for the requested identifier slot.
span class="keyword">property FileNamePath of the PDF to open; assigning while Active reloads from the new path.
FindSearches for Pattern starting from PageNum (or the current page if -1) and returns the global character index of the first match.
span class="keyword">function FindFirst(const Text: WString; Options: TSearchOptions = []; StartIndex: Integer = 0; DirectionUp: Boolean = True): IntegerStart a search of the specified text. StartIndex is 0-based, -1 is for end of the page. DirectionUp parameter determines direction of this search operation.
span class="keyword">function FindNextAdvances the cursor of an in-progress Find session and returns the next matching character index.
span class="keyword">function FindPreviousReverses the Find cursor by one match.
span class="keyword">function FlattenAllPages(nFlag: Integer = FLAT_NORMALDISPLAY): BooleanConvenience wrapper that flattens every page in the document. Returns True when every page completes with FLATTEN_SUCCESS or FLATTEN_NOTHINGTODO. Recommended workflow: GenerateFormAppearances → FlattenAllPages → SaveAs.
span class="keyword">function FlattenPage(nFlag: Integer = FLAT_NORMALDISPLAY): IntegerFlattens annotations and form widgets on the current page into permanent (non-editable) page content. nFlag selects the flattening profile: FLAT_NORMALDISPLAY (0) for screen display or FLAT_PRINT (1) for printed output. Returns one of FLATTEN_SUCCESS, FLATTEN_NOTHINGTODO, or FLATTEN_FAIL. Call GenerateFormAppearances first when flattening filled-in form values.
function FocusedFormFieldDetails: TPdfFormFieldInfoReturns TPdfFormFieldInfo for the current logical form field
span class="keyword">function FocusedFormFieldIndex: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
function FocusedFormFieldName: WStringReturns the current logical form field display name, preferring AlternateName and falling back to Name
span class="keyword">function FocusedFormFieldText: WStringWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
function FocusedFormFieldValue: WStringReturns the current logical form field value by FocusedFormFieldIndex without depending on the interactive caret
span class="keyword">function FocusFormField(Index: Integer): BooleanWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">function FocusNextFormField: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">function FocusPreviousFormField: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
FontAscentReturns the font's ascent (distance from the baseline to the highest ascender) of a page object's font, expressed in PDF points and scaled to a caller-supplied font size.
FontBaseNameReturns the PostScript base name (the /BaseFont entry from the PDF font dictionary) of the font used by a page object, including any style suffix such as -Bold or ,Italic.
FontDataRead-only indexed access to the raw bytes of the embedded font program (only populated when the font is embedded).
FontDescentReturns the font's descent (the distance from the baseline down to the lowest descender) of a page object's font, expressed in PDF points and scaled to a caller-supplied font size.
FontFamilyNameReturns the typographic family name (e.g. Helvetica, Times New Roman, Noto Sans CJK SC) of the font used by a page object on the current page.
FontHandleReturns the native FPDF_FONT handle of the font used by a page object. The handle gives advanced callers direct access to PDFium font APIs not wrapped by the component.
FontIsEmbeddedIndicates whether the font used by a page object is embedded inside the PDF (True) or merely referenced and resolved at view time from the operating system (False).
FontItalicAngleRead-only indexed access to the italic angle of the font in degrees (negative for typical italic; 0 for upright).
FontSizeReturns the rendered font size, in PDF points, of an individual character on the current page. FontSize is an alias for CharacterFontSize retained for backward compatibility.
FontWeightReturns the CSS-style weight (boldness) of the font used by a page object on the current page. Typical values are 400 for regular and 700 for bold.
FormFieldIndexed property — returns one form field on the current page
FormFieldAtRead or write the value of the form field located at the given page coordinate.
FormFieldCountNumber of form field widgets on the currently active page.
FormFieldInfoFull record describing a form field at a given index on the active page.
FormFieldInfoAtForm field record for the widget located at the given page coordinate.
span class="keyword">function FormFieldTabOrder: TPdfIntegerArrayWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">property FormFillInterface that lets your application supply forms-related callbacks (Beep, Invalidate, OutputDocFile, etc.).
FormHandleNative PDFium form-fill environment handle attached to the document.
span class="keyword">property FormTypeTells you whether the document contains AcroForm fields, XFA, or no forms at all.
span class="keyword">procedure GenerateFormAppearancesRegenerates the /AP (appearance stream) for every form widget on every page by rendering each page through FPDF_FFLDraw. This is the recommended companion call to FormField[i] := value assignments — without it, form values may be visible only when the field has focus, and any subsequent flatten operation will silently lose the values. Call after all FormField[] assignments and before SaveAs / FlattenPage / FlattenAllPages.
span class="keyword">function GetPageBoxReads the rectangle of the named page box on the current page.
function GetXfaConfig: TBytesRetrieves the raw XML bytes of the XFA config packet from the PDF document
function GetXfaDatasets: TBytesRetrieves the original XFA datasets XML bytes from the PDF document
function GetXfaFormPackets: TXfaPacketListSnapshots all embedded XFA packets in a TXfaPacketList collection
function GetXfaTemplate: TBytesRetrieves the raw XML bytes of the XFA template packet from the PDF document
HasBookmarkChildrenReturns True when the given outline node has at least one child bookmark.
HasFormFieldAtHit-test that returns True when a form field widget covers the given page coordinate.
ImageIndexed property — returns one image page object on the current page (handle + bbox + bit depth + color space)
ImageCountNumber of raster image XObjects on the currently active page.
ImportXFDFReads an XFDF (ISO 19444-1) document and applies its form field values and annotations to the loaded PDF, creating annotations on the matching pages and writing field values into their widget annotations.
ImportNPagesToOneBuilds a brand-new TPdf whose pages are NumX×NumY composites of the source document's pages, suitable for N-up printing layouts.
ImportPagesCopies one or more pages from another open TPdf into this document.
ImportPagesByIndexImports a specific subset of pages from another TPdf by zero-based index, with control over the insertion point in the current document.
span class="keyword">function ImportPreferences(Pdf: TPdf): BooleanBit-set controlling how ImportPages copies content (resources, named destinations, comments, etc.).
span class="keyword">function InsertFormObjectFromXObject(XObject: TPdfXObject): FPDF_PAGEOBJECTInserts ONE copy of the page wrapped by a TPdfXObject into the current page of this document, returning the FPDF_PAGEOBJECT so the caller can position / scale / rotate it.
IsTaggedWhether the document declares a structure tree for accessibility.
JavaScriptActionIndexed property — returns one document-level JavaScript action (name + Type + Source string)
JavaScriptActionCountNumber of document-level JavaScript actions stored in the PDF.
JavaScriptActionsAll document-level JavaScript actions returned as a single dynamic array.
KeywordsAuthor-supplied keyword list from the document Info dictionary.
LanguageNatural language identifier declared in the document catalog.
LineToAppends a straight line from the current point to (X, Y).
LinkAnnotationIndexed property — returns the explicit /Annot Subtype Link at the given index, including the target action or destination
LinkAnnotationCountNumber of /Link annotation entries on a specific page.
span class="keyword">procedure LoadCustomDocument(AStream: TStream; AOwnsStream: Boolean = False)Loads a PDF from any seekable TStream using PDFium's on-demand block reader, so multi-GB documents and remote / database-backed sources do not need an up-front in-memory copy.
span class="keyword">procedure LoadDocumentOpen and load a PDF document from FileName.
span class="keyword">property MetaTextReturns the document XMP metadata packet as a wide string.
ModifiedDateLast-modification timestamp recorded in the document Info dictionary.
MovePagesReorders pages of this document in place by zero-based index, keeping the page count constant.
MoveToStarts a new sub-path at the given page coordinate.
ObjectBitmapIndexed property — returns one image page object as a renderable VCL TBitmap (lossy decoded from JPX/CCITT/etc.)
ObjectBoundsTight axis-aligned bounding rectangle of a single page object on the current page,
ObjectCountRead-only number of page objects (text, path, image, shading, form) at the current page.
ObjectHandleRaw PDFium FPDF_PAGEOBJECT pointer for the specified page object,
ObjectTransparentIndicates whether a page object participates in PDF transparency — either through
ObjectTypeReturns the category of the page object at the specified index — text, path, image, shading, or form XObject. The classification matches the PDF content-stream operator that produced the object and lets callers iterate the page-object array with a single switch dispatch.
span class="keyword">property OnFormFieldEnterFired when the form-fill engine gains focus on a form field.
span class="keyword">property OnFormFieldExitFired when the form-fill engine loses focus on a form field.
property OnJavaScriptResponseFired when PDF-embedded JavaScript actions request user interaction
span class="keyword">property OnPageChangeFired when Pdf.Page is assigned to a different page index.
span class="keyword">property OnUnsupportedFeatureFired when the document uses a PDF feature that PDFium does not implement (e.g. XFA full forms, 3D annotations, multimedia).
property OnXfaGotoUrlFired when navigating link URLs inside dynamic XFA forms
property OnXfaUriActionFired when link URI actions trigger inside dynamic XFA contexts
function PadesCryptoAvailable: BooleanIndicates whether the signature cryptographical backend is available on the system
PageNative PDFium page handle for the currently active page.
span class="keyword">property PageBounds[Box: TPdfPageBox]: TPdfRectanglePage-level property — the rectangle for the requested page box (MediaBox/CropBox/BleedBox/TrimBox/ArtBox).
span class="keyword">property PageBox[Box: TPdfPageBox]: TPdfRectanglePage-level property — reads or writes a specific page-box rectangle on the current page.
span class="keyword">property PageCount: IntegerPage-level property — total number of pages in the open document.
PageHeightHeight of the active page in PDF user-space units (points = 1/72 inch).
span class="keyword">property PageLabel: WStringPage-level property — returns the user-visible page label (such as "iv" or "A-3") rather than the zero-based index.
span class="keyword">property PageMode: TPageModePage-level property — the document /PageMode hint (Outlines, Thumbs, FullScreen, ...).
span class="keyword">property PageNumber: IntegerPage-level property — 1-based page index of the current page (so PageNumber = Page + 1).
span class="keyword">property PageRotation: TRotationPage-level property — rotation applied to the current page when rendering (ro0 / ro90 / ro180 / ro270).
span class="keyword">function PageToDevice(PageX, PageY: Double; Left, Top, Width, Height: Integer; Rotation: TRotation; out X, Y: Integer): BooleanConvert the page coordinate of a point to screen coordinate.
span class="keyword">property PageWidth: DoublePage-level property — width of the current page in points (1 pt = 1/72 inch).
function PageWordBoxes: TPdfWordBoxesReturns TPdfWordBox records for words on the current TPdf page with character ranges and page-space rectangles
span class="keyword">property PasswordDecryption password assigned before Active := True.
PdfAConformanceRead-only PDF/A conformance level of the currently open document, without needing to call ValidatePdfA explicitly.
PdfEConformanceRead-only PDF/E conformance level of the currently open document, without needing to call ValidatePdfE explicitly.
PdfRConformanceRead-only PDF/R conformance level of the currently open document, without needing to call ValidatePdfR explicitly.
PdfUaConformanceRead-only PDF/UA conformance level of the currently open document, without needing to call ValidatePdfUa explicitly.
PdfVersionRead-only flag — the PDF specification version of the open document (e.g. pv14, pv17, pv20).
PdfVTConformanceRead-only PDF/VT conformance level of the currently open document, without needing to call ValidatePdfVT explicitly.
PdfXConformanceRead-only PDF/X conformance level of the currently open document, without needing to call ValidatePdfX explicitly.
span class="keyword">property PermissionsReturns the owner-password permission bits as decoded from the /Encrypt dictionary.
PrintCopiesEmbedded suggested number of copies the PDF's author would like the print dialog
PrintPageRangesDecoded list of one-based page ranges the PDF's author would like the print
PrintPaperHandlingDecoded value of the document's /ViewerPreferences /Duplex hint —
PrintScalingDecoded value of the document's /ViewerPreferences /PrintScaling
ProducerName of the PDF library or converter that produced the file.
ReadableContentReturns semantic readable content fragments for screen-reader, text-to-speech, and accessibility workflows
span class="keyword">function ReadablePageContent(PageNumber: Integer): TPdfReadableContentReturns semantic readable content fragments for screen-reader, text-to-speech, and accessibility workflows
function ReadingUnits: TPdfReadingUnitsBuilds sentence-level TPdfReadingUnit records from the current page readable-content stream for assistive listen-reading workflows
RectangleReturns one text bounding rectangle from the current page text layout.
span class="keyword">function RectangleCount(StartIndex: Integer = 0; Count: Integer = MaxInt): IntegerCount number of rectangular areas occupied by a segment of texts. Function automatically merges small character boxes into bigger one if those characters are on the same line and use same font settings.
span class="keyword">procedure ReloadPageReloads the currently selected page from the PDFium engine, refreshing the page object cache.
span class="keyword">procedure RemoveObject(Index: Integer; DestroyObject: Boolean = True)Removes the specified page object from the current page. When DestroyObject is True, the removed object is released after removal. The page content stream is regenerated automatically.
span class="keyword">procedure RenderPage(DeviceContext: HDC; Left, Top, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = [])Render contents of a page to a device (screen, bitmap, or printer).
RenderPageProgressiveCancellable variant of RenderPage that drives PDFium's progressive rendering loop and polls an IPdfCancellationToken between iterations so long high-DPI renders can abort mid-page instead of blocking until completion.
function RenderPageThumbnail(PageIndex, MaxWidth, MaxHeight: Integer): TBitmapRenders any one-based page into a bitmap that fits within the requested thumbnail bounds
span class="keyword">function RenderTile(Left, Top, Width, Height, PageWidth, PageHeight: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []; Color: TColor = clWhite): TBitmapRender rectangular area of a page to a new bitmap. Returned bitmap has to be manually released.
span class="keyword">function SaveAs(Stream: TStream; Option: TSaveOption = saNone; PdfVersion: TPdfVersion = pvUnknown): BooleanSaves the copy of PDF document to the specified stream. If PdfVersion is pv13 through pv17, the saved output is normalized and validated for that target version, including existing catalog /Version overrides in incremental output. The validator covers the full PDF 1.1–1.7 / ISO 32000-1 feature timeline: filters (FlateDecode, JBIG2Decode, JPXDecode), object & xref streams, transparency (SMask, ca/CA, blend modes), Tagged PDF (StructTreeRoot, MarkInfo), color spaces (ICCBased, DeviceN), page boxes (BleedBox/TrimBox/ArtBox), output intents, optional content, AcroForm, CID/Type 0 and OpenType fonts, AES & AES-256 encryption (CFM AESV2/AESV3), all version-restricted annotation subtypes (Widget, Sound, Movie, FreeText, Line, Square, Circle, Highlight, Underline, StrikeOut, Stamp, Ink, Popup, FileAttachment, TrapNet, Squiggly, PrinterMark, Polygon, PolyLine, Caret, Screen, Watermark, 3D, Redact), version-restricted action types (SubmitForm, ResetForm, ImportData, Hide, Named, JavaScript, Trans, SetState, Rendition, GoToE, GoTo3DView), and catalog entries (Perms, Legal, Collection, Requirements, NeedsRendering). Anything that exceeds the chosen target version raises EPdfError. If the document has no existing OpenAction and the target version supports it, the saved PDF opens on the first page with Fit Height zoom. Trial builds apply the trial watermark during save.
function SaveAsPadesDss(const FileName: string; const Options: TPadesDssOptions): BooleanSaves the active PDF to a file while embedding PAdES Document Security Store validation material in an incremental update that preserves the source xref representation
function SaveAsPadesDssToStream(Stream: TStream; const Options: TPadesDssOptions): BooleanSaves the active PDF to a custom stream while embedding PAdES DSS validation material and preserving the source xref representation
SaveAsPdfASaves the current document as a PDF/A-1b conformant file by post-processing the base PDF with an incremental update that injects an XMP metadata stream, an sRGB ICC OutputIntent, and an updated document catalog.
span class="keyword">function SaveAsPdfAToStream(Stream: TStream; const Options: TPdfASaveOptions): BooleanIn-memory variant of SaveAsPdfA — writes the PDF/A-1b output into any TStream without staging through disk.
SaveAsPdfESaves the current document as a PDF/E-1 conformant file by post-processing the base PDF with an incremental update that injects PDF/E-1 file-format markers (ISO 24517-1:2008).
span class="keyword">function SaveAsPdfEToStream(Stream: TStream; const Options: TPdfESaveOptions): BooleanIn-memory variant of SaveAsPdfE — writes the PDF/E-1 output into any TStream without staging through disk.
SaveAsPdfRSaves the current document as a PDF/R-1 conformant file (ISO 23504-1:2020, the raster image transport and storage subset of PDF used for scanned documents).
span class="keyword">function SaveAsPdfRToStream(Stream: TStream; const Options: TPdfRSaveOptions): BooleanIn-memory variant of SaveAsPdfR — writes PDF/R-1 output into any TStream without staging through disk.
SaveAsPdfUaSaves the current document as a PDF/UA-1 conformant file by post-processing the base PDF with an incremental update that injects PDF/UA file-format markers.
span class="keyword">function SaveAsPdfUaToStream(Stream: TStream; const Options: TPdfUaSaveOptions): BooleanIn-memory variant of SaveAsPdfUa — writes the PDF/UA-1 output into any TStream without staging through disk.
SaveAsPdfVTSaves the current document as a single-file PDF/VT-1 conformant file (ISO 16612-2:2010, the variable and transactional printing PDF subset).
span class="keyword">function SaveAsPdfVTToStream(Stream: TStream; const Options: TPdfVTSaveOptions): BooleanIn-memory variant of SaveAsPdfVT — writes PDF/VT output into any TStream without staging through disk.
SaveAsPdfXSaves the current document as a PDF/X-1a:2001, PDF/X-3:2002, or PDF/X-4 conformant file by post-processing the base PDF with an incremental update that injects PDF/X file-format markers (ISO 15930 family).
span class="keyword">function SaveAsPdfXToStream(Stream: TStream; const Options: TPdfXSaveOptions): BooleanIn-memory variant of SaveAsPdfX — writes PDF/X output into any TStream without staging through disk.
span class="keyword">procedure SetFormFieldFlags(Index: Integer; const Flags: TPdfFormFieldFlags)Sets AcroForm field flags for the form field at the specified annotation index on the current page.
span class="keyword">procedure SetFormFieldFlagsAt(X, Y: Single; const Flags: TPdfFormFieldFlags)Sets the Flags bit field on the form field at the given coordinates.
span class="keyword">procedure SetPageBox(Box: TPdfPageBox; const Rectangle: TPdfRectangle)Writes a new rectangle for the named page box (MediaBox / CropBox / BleedBox / TrimBox / ArtBox) on the current page.
SetTextAdds a text page object at the given page coordinate.
span class="keyword">procedure SetTextPositions(ObjectIndex: Integer; const Positions: TPdfSingleArray)Sets per-character positions for the specified text object. The first character position is implied as 0; Positions[0] sets the second character position, Positions[1] sets the third, and so on. Values are in points and relative to the text object origin.
SignatureIndexed property — returns one digital-signature record (signer, reason, contact, byte range)
SignatureCountNumber of digital signature fields embedded in the document.
function SignPades(const FileName: string; const Options: TPadesSignOptions): BooleanAppends a PAdES signature as an invisible Widget in the first page annotations and AcroForm fields while preserving existing entries
function SignPadesToStream(Stream: TStream; const Options: TPadesSignOptions): BooleanWrites a PAdES signature update with a registered Widget field, 64-bit ByteRange processing and the source xref representation
function SignPadesWithPdfA(const FileName: string; const Options: TPadesSignOptions; PdfAOptions: TPdfASaveOptions): BooleanSaves a signed PAdES PDF document complying with PDF/A archive standards
StructureElementsIndexed property — returns the children of a logical structure tree element (StructTree)
SubjectReturns the value of the /Subject entry from the PDF document information dictionary.
span class="keyword">function Text(StartIndex: Integer = 0; Count: Integer = MaxInt): WStringExtract text string from the page. StartIndex and Count parameters determine characters to be extracted. StartIndex parameter is 0-based.
span class="keyword">function TextInRectangle(Left, Top, Right, Bottom: Double): WStringExtract text within a rectangular boundary on the page.
TextPageNative PDFium text-page handle for the currently active page.
span class="keyword">property ThumbnailReturns the raw bytes of the /Thumb entry for the current page (optional precomputed preview, typically a 64x64 raster).
TitleReturns the value of the /Title entry from the PDF document information dictionary.
TransparentWhether the currently active page contains transparent content.
span class="keyword">procedure UpdatePageCommits in-memory edits made through CreateAnnotation, AddImage, AddText, SetFormFieldFlagsAt, etc. to the underlying PDFium page.
span class="keyword">property UserPermissionsReturns the user-password permission bits (a subset of Permissions).
function ValidatePades: TPadesValidationResultValidates all digital signatures in the PDF and returns a PAdES compliance report
span class="keyword">function ValidatePdfA: TPdfAValidationResultInspects the currently open PDF for PDF/A compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found.
span class="keyword">function ValidatePdfE: TPdfEValidationResultInspects the currently open PDF for PDF/E-1 compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found.
span class="keyword">function ValidatePdfR: TPdfRValidationResultInspects the currently open PDF for PDF/R-1 compliance markers and returns a structured result with the detected conformance level plus the set of issues found.
span class="keyword">function ValidatePdfUa: TPdfUaValidationResultInspects the currently open PDF for PDF/UA-1 compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found.
span class="keyword">function ValidatePdfVT: TPdfVTValidationResultInspects the currently open PDF for PDF/VT compliance markers and returns a structured result with the detected conformance level plus the set of issues found.
span class="keyword">function ValidatePdfX: TPdfXValidationResultInspects the currently open PDF for PDF/X compliance markers and returns a structured result with the detected conformance level plus the set of specific issues found.
ViewerPreferenceIndexed property — returns the integer value of a /ViewerPreferences key (NumCopies, PrintScaling, etc.)
WebLinkURL and bounding rectangles for an auto-detected web link on a page.
WebLinkCountNumber of auto-detected web URLs identified by scanning a page's text.
span class="keyword">property XFAReturns the XFA XML packet embedded in the document (PDF/A 2.0 deprecated the format, but Acrobat-generated forms still use it).

TPdfView Component

TPdfView is a scrollable visual control for displaying and interacting with PDF documents. It requires a Pdf: TPdf reference.

Published Properties (Design-Time)

PropertyTypeDefaultDescription
AboutstringComponent version information
ActiveBooleanFalseActivate/deactivate the viewer
CurrentCharIndexInteger0Application-selected character index retained for compatibility
DisplayModeTPdfDisplayModedmSingleContinuousPage display mode (dmSingleContinuous, dmTwoPageContinuous, dmTwoPageContinuousWithCover)
OptionsTRenderOptions[reLcd]Rendering options (LCD text, annotations, grayscale, etc.)
PageShadowSizeInteger0Optional drop-shadow size in pixels; negative values clamp to 0
PageShadowColorTColorclGrayDrop-shadow fill color used when PageShadowSize > 0
PageBorderColorTColorclBlackOne-pixel page border color
SmoothScrollBooleanFalseAnimates line/page scrollbar commands in timer-driven segments; thumb tracking remains immediate
LinkOptionsTPdfViewLinkOptions[loAutoGoto, loAutoOpenURI]Controls automatic goto, URI, launch, and embedded-goto behavior after link click events
AsyncRenderingBooleanFalseShows the loading overlay when enabled; the application still owns worker dispatch
LoadingTextstringLoading...Text drawn in the AsyncRendering overlay; empty string suppresses the overlay
LoadingColorTColorclYellowBackground color for the AsyncRendering overlay
NightDuotoneInkTColor$0000C8FFInk colour used by the reNightDuotone low-vision render option
NightDuotonePaperTColorclBlackPaper colour used by the reNightDuotone low-vision render option
ReadingHighlightColorTColorclSkyBlueControls the broader reading highlight overlay colour
ReadingWordColorTColor$0000A5FFControls the overlay colour used for the current word-level reading cursor
ReadingWordFollowBooleanTrueControls whether TPdfView scrolls the current spoken word into view while tracking reading
PageNumberInteger1Current page number (1-based)
PdfTPdfnilReference to the TPdf component
RotationTRotationro0Display rotation (ro0, ro90, ro180, ro270)
ZoomDouble1.0Zoom level (1.0 = 100%)

TPdfView-Specific Public Properties

PropertyTypeDescription
ActualSizeZoom[PageNumber]DoubleZoom value to display the page at its actual size
CanvasTCanvasCanvas for custom drawing on the viewer
CharacterAngle[Index]SingleCharacter rotation angle in radians
CharacterCountIntegerNumber of characters on the current viewer page
CharacterFontSize[Index]DoubleFont size of character at index; FontSize[Index] remains as a compatible alias
CharacterFontWeight[Index]IntegerFont weight of character at index
CharacterOrigin[Index]TPointCharacter origin in viewer device coordinates
CharacterRectangle[Index]TRectCharacter bounds in viewer device coordinates
FontAscent[Index; FontSize]SingleAscent of the font used by the text object at index
FontBaseName[Index]WStringBase font name for the text object at index
FontData[Index]TBytesRaw font data for the text object at index
FontDescent[Index; FontSize]SingleDescent of the font used by the text object at index
FontFamilyName[Index]WStringFont family name for the text object at index
FontHandle[Index]FPDF_FONTLow-level PDFium font handle for the text object at index
FontIsEmbedded[Index]BooleanTrue if the text object's font is embedded in the PDF
FontItalicAngle[Index]IntegerItalic angle of the text object's font
FontWeight[Index]IntegerFont weight of the text object's font
PageHeightZoom[PageNumber]DoubleZoom value to fit the page height in the viewer
PageWidthZoom[PageNumber]DoubleZoom value to fit the page width in the viewer
PageZoom[PageNumber]DoubleZoom value to fit the entire page in the viewer
StructureElementsTPdfStructureElementsFlattened logical structure elements for the current viewer page
WindowHandleHWNDWindow handle of the viewer control

TPdfView-Specific Methods

MethodDescription
CharacterIndexAtPos(X, Y: Integer; ToleranceX, ToleranceY: Double): IntegerResolve the character near a viewer device-coordinate point; returns -1 when no character is nearby
DeviceToPage(X, Y: Integer; out PageX, PageY: Double): BooleanConvert viewer device coordinates to page coordinates
DeviceToPage(X, Y: Integer; var PageNumber: Integer; var PageX, PageY: Double): BooleanConvert viewer device coordinates to page coordinates with page detection
DeviceToPage(Rectangle: TRect): TPdfRectangleConvert a viewer device rectangle to a page rectangle
PageToDevice(PageX, PageY: Double; out X, Y: Integer): BooleanConvert page coordinates to viewer device coordinates
PageToDevice(Rectangle: TPdfRectangle): TRectConvert a page rectangle to a viewer device rectangle
LinkAnnotationAtPos(X, Y: Integer): IntegerGet link annotation index at screen position
LinkAnnotationAtPos(X, Y: Integer; out PageNumber: Integer): IntegerGet link annotation index with page number
WebLinkAtPos(X, Y: Integer): IntegerGet web link index at screen position
WebLinkAtPos(X, Y: Integer; out PageNumber: Integer): IntegerGet web link index with page number
PaintSelection(SelectionStart, SelectionEnd: Integer; Mask: TColor)Paint text selection highlight
FocusedFormFieldValue: WStringReturns the current logical form field value by FocusedFormFieldIndex without depending on the interactive caret
FocusedFormFieldName: WStringReturns the current logical form field display name, preferring AlternateName and falling back to Name
FocusedFormFieldDetails: TPdfFormFieldInfoReturns TPdfFormFieldInfo for the current logical form field
ReadingUnits: TPdfReadingUnitsReturn sentence-level reading units for assistive listen-reading and semantic navigation
PageWordBoxes: TPdfWordBoxesReturn word boxes with FTextPage ranges and page-space rectangles for word-by-word highlighting
SetReadingWord(const Word: TPdfWordBox)Highlights one TPdfWordBox as the current spoken word on TPdfView
ClearReadingWordClears the current word-level reading cursor overlay on TPdfView
TrackReadingWordAt(PageNumber, CharIndex: Integer): IntegerMaps a page character offset to the containing TPdfWordBox, highlights it, and returns the word index
RemoveObject(Index: Integer; DestroyObject: Boolean = True)Remove a page object from the current page, regenerate page content, and repaint the viewer
GenerateFormAppearancesRegenerates /AP appearance streams via the associated TPdf component (see TPdf.GenerateFormAppearances)
FlattenPage(nFlag: Integer = FLAT_NORMALDISPLAY): IntegerFlatten annotations and form widgets on the current page into static content
SetFormFieldFlags(Index: Integer; const Flags: TPdfFormFieldFlags)Set AcroForm field flags by current-page annotation index
SetFormFieldFlagsAt(X, Y: Integer; const Flags: TPdfFormFieldFlags)Set AcroForm field flags at viewer control coordinates

VCL Inherited and Other Properties & Methods

APIDescription
span class="keyword">property About: stringDocuments the About member published by TPdfView.
ActiveActivates or deactivates the viewer, opening the bound PDF document and rendering the selected page.
span class="keyword">property ActualSizeZoom[PageNumber: Integer]: DoubleRead-only zoom factor that displays the page at its true physical size on the host screen.
span class="keyword">procedure AddImage(const FileName: string; X, Y, Width, Height: Integer); overloadAdds an image to the page currently displayed by TPdfView, converting a viewer client-coordinate rectangle into PDF page coordinates.
span class="keyword">function AddJpegImage(JpegImage: TStream; X, Y, Width, Height: Integer): BooleanTPdfView wrapper that forwards to TPdf.AddJpegImage.
span class="keyword">procedure AddPicture(Picture: TPicture; X, Y: Integer); overloadTPdfView wrapper that forwards to TPdf.AddPicture.
AlignControls how the PDF viewer is laid out inside its parent container.
span class="keyword">property AllowUserPageChange: BooleanAllows user input (mouse wheel, scroll bar drag, key bindings) to change the current page.
span class="keyword">property AllowUserTextSelection: BooleanGates user-input-driven text selection in the viewer.
AnchorsSpecifies which edges of the viewer remain a fixed distance from the corresponding edges of its parent when the parent is resized.
span class="keyword">property Annotation[Index: Integer]: TPdfAnnotationTPdfView wrapper that forwards to TPdf.Annotation.
span class="keyword">property AnnotationCount: IntegerTPdfView wrapper that forwards to TPdf.AnnotationCount.
span class="keyword">property AsyncRendering: BooleanOpt-in flag that tells the view to draw a small "Loading..." overlay during long renders so applications using their own worker for off-thread rendering share a consistent visual affordance.
span class="keyword">property Bitmap[Index: Integer]: TBitmapTPdfView wrapper that forwards to TPdf.Bitmap.
span class="keyword">property BitmapCount: IntegerTPdfView wrapper that forwards to TPdf.BitmapCount.
span class="keyword">property Canvas: TCanvasDrawing canvas exposed by the control after a page is rendered.
span class="keyword">property ChangePageOnMouseScrolling: BooleanIn SinglePage mode, controls whether mouse-wheel scrolling at the page edge advances to the next page.
span class="keyword">property Character[Index: Integer]: WideCharTPdfView wrapper that forwards to TPdf.Character.
span class="keyword">property CharacterAngle[Index: Integer]: SingleTPdfView wrapper that forwards to TPdf.CharacterAngle.
span class="keyword">property CharacterCount: IntegerTPdfView wrapper that forwards to TPdf.CharacterCount.
span class="keyword">property CharacterFontSize[Index: Integer]: DoubleTPdfView wrapper that forwards to TPdf.CharacterFontSize.
span class="keyword">property CharacterFontWeight[Index: Integer]: IntegerTPdfView wrapper that forwards to TPdf.CharacterFontWeight.
span class="keyword">property CharacterGenerated[Index: Integer]: BooleanTPdfView wrapper that forwards to TPdf.CharacterGenerated.
span class="keyword">function CharacterIndexAtPos(X, Y: Integer; ToleranceX, ToleranceY: Double): IntegerReturns the character index in the current page nearest to the screen pixel (X, Y), or -1 if no character is close enough.
span class="keyword">property CharacterIsHyphen[Index: Integer]: BooleanTPdfView wrapper that forwards to TPdf.CharacterIsHyphen.
span class="keyword">property CharacterMapError[Index: Integer]: BooleanTPdfView wrapper that forwards to TPdf.CharacterMapError.
span class="keyword">property CharacterOrigin[Index: Integer]: TPointTPdfView wrapper that forwards to TPdf.CharacterOrigin.
span class="keyword">property CharacterRectangle[Index: Integer]: TRectTPdfView wrapper that forwards to TPdf.CharacterRectangle.
span class="keyword">property Charcode[Index: Integer]: WideCharTPdfView wrapper that forwards to TPdf.Charcode.
span class="keyword">procedure ClearFormFieldFocusWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">procedure ClearHighlightTPdfView wrapper that forwards to TPdfView.ClearHighlight.
span class="keyword">procedure ClearReadingHighlightControls the TPdfView reading-highlight overlay used by synchronized text-to-speech playback
procedure ClearReadingWordClears the current word-level reading cursor overlay on TPdfView
span class="keyword">procedure ClearSelectionClears the current text selection and invalidates the view.
ColorSets the background color drawn between the page rectangles and around the document edges.
ConstraintsDefines the minimum and maximum width and height the PDF viewer is allowed to reach when its parent is resized.
span class="keyword">function CopySelectionToClipboard: BooleanCopies the currently selected text to the Windows clipboard as CF_UNICODETEXT.
constructor Create(AOwner: TComponent); overrideCreates the TPdfView control and initializes rendering, scrolling, selection, and form interaction state
span class="keyword">procedure CreateAnnotation(const Annotation: TPdfAnnotation)TPdfView wrapper that forwards to TPdf.CreateAnnotation.
span class="keyword">property CurrentCharIndex: IntegerRead-only zero-based character index under the current mouse cursor (or last hit-tested point).
span class="keyword">procedure DeleteAnnotation(Index: Integer)TPdfView wrapper that forwards to TPdf.DeleteAnnotation.
destructor Destroy; overrideReleases viewer resources, rendering buffers, and document subscriptions before TPdfView is destroyed
span class="keyword">function DeviceToPage(X, Y: Integer; out PageX, PageY: Double): Boolean; overloadConverts a screen pixel (X, Y) inside the view to a PDF user-space point on the current page.
span class="keyword">property DisplayMode: TPdfDisplayModeLayout mode: single page, continuous, two-page, two-page continuous, with or without cover.
span class="keyword">property DragCursorDocuments the DragCursor member published by TPdfView.
span class="keyword">property DragKindDocuments the DragKind member published by TPdfView.
span class="keyword">property DragModeDocuments the DragMode member published by TPdfView.
EnabledControls whether the PDF viewer accepts user input from the mouse and keyboard.
span class="keyword">property Find: FPDF_SCHHANDLETPdfView wrapper that forwards to TPdf.Find.
span class="keyword">function FindFirst(const Text: WString; Options: TSearchOptions= []; StartIndex: Integer= 0; DirectionUp: Boolean= True): IntegerStart a search of the specified text. StartIndex is 0-based, -1 is for end of the page. DirectionUp parameter determines direction of this search operation.
span class="keyword">function FindNext: IntegerTPdfView wrapper that forwards to TPdf.FindNext.
span class="keyword">function FindPrevious: IntegerTPdfView wrapper that forwards to TPdf.FindPrevious.
span class="keyword">property FitMode: TPdfFitModeControls 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.
span class="keyword">function FlattenPage(nFlag: Integer = FLAT_NORMALDISPLAY): IntegerTPdfView wrapper that forwards to TPdf.FlattenPage.
span class="keyword">function FocusFormField(Index: Integer): BooleanWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">function FocusNextFormField: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">function FocusPreviousFormField: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
function FocusedFormFieldDetails: TPdfFormFieldInfoReturns TPdfFormFieldInfo for the current logical form field
span class="keyword">function FocusedFormFieldIndex: IntegerWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
function FocusedFormFieldName: WStringReturns the current logical form field display name, preferring AlternateName and falling back to Name
span class="keyword">function FocusedFormFieldText: WStringWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
function FocusedFormFieldValue: WStringReturns the current logical form field value by FocusedFormFieldIndex without depending on the interactive caret
span class="keyword">property FontAscent[Index: Integer; FontSize: Single]: SingleTPdfView wrapper that forwards to TPdf.FontAscent.
span class="keyword">property FontBaseName[Index: Integer]: WStringTPdfView wrapper that forwards to TPdf.FontBaseName.
span class="keyword">property FontData[Index: Integer]: TBytesTPdfView wrapper that forwards to TPdf.FontData.
span class="keyword">property FontDescent[Index: Integer; FontSize: Single]: SingleTPdfView wrapper that forwards to TPdf.FontDescent.
span class="keyword">property FontFamilyName[Index: Integer]: WStringTPdfView wrapper that forwards to TPdf.FontFamilyName.
span class="keyword">property FontHandle[Index: Integer]: FPDF_FONTTPdfView wrapper that forwards to TPdf.FontHandle.
span class="keyword">property FontIsEmbedded[Index: Integer]: BooleanTPdfView wrapper that forwards to TPdf.FontIsEmbedded.
span class="keyword">property FontItalicAngle[Index: Integer]: IntegerTPdfView wrapper that forwards to TPdf.FontItalicAngle.
span class="keyword">property FontSize[Index: Integer]: DoubleTPdfView wrapper that forwards to TPdf.FontSize.
span class="keyword">property FontWeight[Index: Integer]: IntegerTPdfView wrapper that forwards to TPdf.FontWeight.
span class="keyword">function FormCanRedo: BooleanReports whether the focused AcroForm widget has at least one undone edit to redo.
span class="keyword">function FormCanUndo: BooleanReports whether the focused AcroForm widget has at least one edit to undo.
span class="keyword">property FormField[Index: Integer]: WStringTPdfView wrapper that forwards to TPdf.FormField.
span class="keyword">property FormFieldAt[X, Y: Integer]: WStringTPdfView wrapper that forwards to TPdf.FormFieldAt.
span class="keyword">property FormFieldCount: IntegerTPdfView wrapper that forwards to TPdf.FormFieldCount.
span class="keyword">property FormFieldInfo[Index: Integer]: TPdfFormFieldInfoTPdfView wrapper that forwards to TPdf.FormFieldInfo.
span class="keyword">property FormFieldInfoAt[X, Y: Integer]: TPdfFormFieldInfoTPdfView wrapper that forwards to TPdf.FormFieldInfoAt.
span class="keyword">function FormFieldTabOrder: TPdfIntegerArrayWorks with the current-page AcroForm logical focus cursor for keyboard, speech, and accessibility workflows
span class="keyword">function FormRedo: BooleanRedoes the most recently undone edit on the focused AcroForm widget, driving PDFium's per-widget redo history.
span class="keyword">function FormUndo: BooleanUndoes the most recent edit on the focused AcroForm widget, driving PDFium's per-widget undo history.
span class="keyword">procedure GenerateFormAppearancesTPdfView wrapper that forwards to TPdf.GenerateFormAppearances.
span class="keyword">function GetSelectedFormText: WStringReturns the text currently selected inside the focused AcroForm widget on the view's active page.
span class="keyword">property HasFormFieldAt[X, Y: Integer]: BooleanTPdfView wrapper that forwards to TPdf.HasFormFieldAt.
span class="keyword">function HasSelection: BooleanReturns whether any text is currently selected in the viewer.
span class="keyword">property HighlightColor: TColorColor of the rectangle painted over each match returned by HighlightSearchText. Defaults to clYellow; published so applications can theme the highlight.
span class="keyword">function HighlightSearchText(const Text: WString; MatchCase: Boolean= False; MatchWholeWord: Boolean= False): IntegerTPdfView wrapper that forwards to TPdfView.HighlightSearchText.
span class="keyword">property Image[Index: Integer]: TPdfImageTPdfView wrapper that forwards to TPdf.Image.
span class="keyword">property ImageCount: IntegerTPdfView wrapper that forwards to TPdf.ImageCount.
span class="keyword">property LinkAnnotation[PageNumber, Index: Integer]: TLinkAnnotationTPdfView wrapper that forwards to TPdf.LinkAnnotation.
span class="keyword">function LinkAnnotationAtPos(X, Y: Integer; out PageNumber: Integer): Integer; overloadReturns the link-annotation index at the screen pixel (X, Y), or -1.
span class="keyword">property LinkAnnotationCount[PageNumber: Integer]: IntegerTPdfView wrapper that forwards to TPdf.LinkAnnotationCount.
span class="keyword">property LinkOptions: TPdfViewLinkOptionsPublished set that controls which of PDFium's four link action types the view follows automatically when the user clicks the link.
LoadingColorFill color of the “loading” placeholder drawn while a page is still being rendered.
LoadingTextText shown in the center of the page while asynchronous rendering is still in progress.
property NightDuotoneInk: TColorControls the ink colour used by the reNightDuotone low-vision render option
property NightDuotonePaper: TColorControls the paper colour used by the reNightDuotone low-vision render option
span class="keyword">property ObjectBitmap[Index: Integer]: TBitmapTPdfView wrapper that forwards to TPdf.ObjectBitmap.
span class="keyword">property ObjectBounds[Index: Integer]: TPdfRectangleTPdfView wrapper that forwards to TPdf.ObjectBounds.
span class="keyword">property ObjectCount: IntegerTPdfView wrapper that forwards to TPdf.ObjectCount.
span class="keyword">property ObjectHandle[Index: Integer]: PointerTPdfView wrapper that forwards to TPdf.ObjectHandle.
span class="keyword">property ObjectTransparent[Index: Integer]: BooleanTPdfView wrapper that forwards to TPdf.ObjectTransparent.
span class="keyword">property ObjectType[Index: Integer]: TObjectTypeTPdfView wrapper that forwards to TPdf.ObjectType.
span class="keyword">property Options: TRenderOptionsSet of rendering hints and TPdfView post-render low-vision options
span class="keyword">property Page: FPDF_PAGETPdfView wrapper that forwards to TPdf.Page.
span class="keyword">property PageBorderColor: TColorColor of the 1-pixel border drawn around each page rectangle.
span class="keyword">property PageBounds: TPdfRectangleTPdfView wrapper that forwards to TPdf.PageBounds.
span class="keyword">property PageColor: TColorBackground color painted under the rendered PDF page, decoupled from the surrounding control's Color. Default is clWhite so PDF pages stay paper-white even when the host control's Color is themed dark.
span class="keyword">property PageCount: IntegerTPdfView wrapper that forwards to TPdf.PageCount.
span class="keyword">property PageHeight: DoubleTPdfView wrapper that forwards to TPdf.PageHeight.
span class="keyword">property PageHeightZoom[PageNumber: Integer]: DoubleRead-only zoom factor that fits the page height into the view.
span class="keyword">property PageLabel: WStringTPdfView wrapper that forwards to TPdf.PageLabel.
span class="keyword">property PageNumber: IntegerTPdfView wrapper that forwards to TPdf.PageNumber.
span class="keyword">property PageRotation: TRotationTPdfView wrapper that forwards to TPdf.PageRotation.
PageShadowColorFill color of the drop shadow painted beneath each page rectangle.
span class="keyword">property PageShadowSize: IntegerWidth (in pixels) of the soft shadow drawn around each page in continuous modes.
span class="keyword">function PageToDevice(PageX, PageY: Double; out X, Y: Integer): Boolean; overloadInverse of DeviceToPage: converts a PDF user-space point to a screen pixel inside the view.
span class="keyword">property PageWidth: DoubleTPdfView wrapper that forwards to TPdf.PageWidth.
span class="keyword">property PageWidthZoom[PageNumber: Integer]: DoubleRead-only zoom factor that fits the page width into the view.
function PageWordBoxes: TPdfWordBoxesReturns TPdfWordBox records for words on the current TPdfView page with character ranges and page-space rectangles
span class="keyword">property PageZoom[PageNumber: Integer]: DoubleRead-only zoom required to fit the current page into the view at the current DisplayMode.
span class="keyword">procedure PaintSelection(SelectionStart, SelectionEnd: Integer; Mask: TColor)TPdfView wrapper that forwards to TPdfView.PaintSelection.
span class="keyword">property ParentShowHintDocuments the ParentShowHint member published by TPdfView.
span class="keyword">property Pdf: TPdfReferences the TPdf component whose document is rendered by the viewer.
PopupMenuAssociates a TPopupMenu with the PDF viewer so that right-clicking on a page presents a context menu.
ReadableContentReturns semantic readable content fragments for screen-reader, text-to-speech, and accessibility workflows
span class="keyword">property ReadingHighlightColor: TColorControls the TPdfView reading-highlight overlay used by synchronized text-to-speech playback
function ReadingUnits: TPdfReadingUnitsBuilds sentence-level TPdfReadingUnit records from the current TPdfView page
span class="keyword">property ReadingWordColor: TColorControls the overlay colour used for the current word-level reading cursor
span class="keyword">property ReadingWordFollow: BooleanControls whether TPdfView scrolls the current spoken word into view while tracking reading
span class="keyword">property Rectangle[Index: Integer]: TRectTPdfView wrapper that forwards to TPdf.Rectangle.
span class="keyword">function RectangleCount(StartIndex: Integer = 0; Count: Integer = MaxInt): IntegerTPdfView wrapper that forwards to TPdf.RectangleCount.
span class="keyword">procedure ReloadPageTPdfView wrapper that forwards to TPdf.ReloadPage.
span class="keyword">procedure RemoveObject(Index: Integer; DestroyObject: Boolean = True)TPdfView wrapper that forwards to TPdf.RemoveObject.
span class="keyword">procedure RenderPage(DeviceContext: HDC; Left, Top, Width, Height: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = [])Render contents of a page to a device (screen, bitmap, or printer).
span class="keyword">function RenderTile(Left, Top, Width, Height, PageWidth, PageHeight: Integer; Rotation: TRotation = ro0; Options: TRenderOptions = []): TBitmapRender rectangular area of a page to a new bitmap. Returned bitmap has to be manually released.
span class="keyword">property Rotation: TRotationVisual rotation applied to the rendered page (ro0 / ro90 / ro180 / ro270).
span class="keyword">procedure SelectAllSelects every character on the page(s) currently displayed by the viewer.
span class="keyword">function SelectAllFormText: BooleanSelects every character inside the focused AcroForm widget on the view's active page (the equivalent of Ctrl+A inside the widget).
span class="keyword">function SelectTextRange(Page, StartIndex, Count: Integer): BooleanReads or writes the TPdfView programmatic text-selection model without requiring user mouse input
function SelectWordBox(const Word: TPdfWordBox): BooleanSelects the text range represented by one TPdfWordBox on the current TPdfView page
function SelectWordSpan(const Words: TPdfWordBoxes; StartIndex, EndIndex: Integer): BooleanSelects a same-page span of TPdfWordBox records as one TPdfView text selection
span class="keyword">function SelectedText: WStringReturns the currently selected text as a wide string.
span class="keyword">function SelectionCharCount: IntegerReturns the total number of characters currently selected.
span class="keyword">property SelectionColor: TColorFill color for the user-drag text selection overlay.
span class="keyword">function SelectionRanges: TPdfUserSelectionRangesReads or writes the TPdfView programmatic text-selection model without requiring user mouse input
span class="keyword">function SelectionRectangles: TPdfRectanglesReads or writes the TPdfView programmatic text-selection model without requiring user mouse input
span class="keyword">procedure SetFormFieldFlags(Index: Integer; const Flags: TPdfFormFieldFlags)TPdfView wrapper that forwards to TPdf.SetFormFieldFlags.
span class="keyword">procedure SetFormFieldFlagsAt(X, Y: Integer; const Flags: TPdfFormFieldFlags)TPdfView wrapper that forwards to TPdf.SetFormFieldFlagsAt.
span class="keyword">procedure SetReadingHighlight(const Rects: TPdfRectangles; PageNumber: Integer)Controls the TPdfView reading-highlight overlay used by synchronized text-to-speech playback
procedure SetReadingWord(const Word: TPdfWordBox)Highlights one TPdfWordBox as the current spoken word on TPdfView
span class="keyword">function SetSelection(const Ranges: TPdfUserSelectionRanges): BooleanReads or writes the TPdfView programmatic text-selection model without requiring user mouse input
ShowHintEnables or disables the hint balloon shown when the mouse hovers over the PDF viewer.
span class="keyword">property SmoothScroll: BooleanEnables timer-driven segmented animation for line/page scrollbar commands. Thumb tracking remains immediate.
span class="keyword">property StructureElements: TPdfStructureElementsTPdfView wrapper that forwards to TPdf.StructureElements.
TabOrderDefines the position of the PDF viewer in the parent's tab cycle.
TabStopIndicates whether the user can give focus to the PDF viewer by pressing the Tab key.
span class="keyword">function Text(StartIndex: Integer = 0; Count: Integer = MaxInt): WStringTPdfView wrapper that forwards to TPdf.Text.
span class="keyword">function TextInRectangle(Left, Top, Right, Bottom: Integer): WString; overloadTPdfView wrapper that forwards to TPdf.TextInRectangle.
span class="keyword">property TextPage: FPDF_TEXTPAGETPdfView wrapper that forwards to TPdf.TextPage.
span class="keyword">property Thumbnail: TBitmapTPdfView wrapper that forwards to TPdf.Thumbnail.
span class="keyword">property TouchDocuments the Touch member published by TPdfView.
function TrackReadingWordAt(PageNumber, CharIndex: Integer): IntegerMaps a page character offset to the containing TPdfWordBox, highlights it, and returns the word index
span class="keyword">property Transparent: BooleanTPdfView wrapper that forwards to TPdf.Transparent.
span class="keyword">procedure UpdatePageTPdfView wrapper that forwards to TPdf.UpdatePage.
VisibleShows or hides the PDF viewer.
span class="keyword">property WebLink[PageNumber, Index: Integer]: TWebLinkTPdfView wrapper that forwards to TPdf.WebLink.
span class="keyword">function WebLinkAtPos(X, Y: Integer; out PageNumber: Integer): Integer; overloadReturns the web-link index at the screen pixel (X, Y).
span class="keyword">property WebLinkCount[PageNumber: Integer]: IntegerTPdfView wrapper that forwards to TPdf.WebLinkCount.
span class="keyword">property WindowHandle: HWNDNative window handle of the control (Windows-only).
span class="keyword">property Zoom: DoubleZoom factor where 1.0 = 100% (one PDF point = 1 screen pixel at 72 DPI).

TPdfView Events

EventTypeDescription
OnPageChangeTNotifyEventFired when the displayed page changes during scrolling
OnPageNumberChangedTNotifyEventFired when the PageNumber property is modified
OnAnnotationLinkClickTPdfViewAnnotationLinkClickEventFired before an annotation-link automatic action; set Handled to suppress the default action
OnWebLinkClickTPdfViewWebLinkClickEventFired before an auto-detected web-link automatic action; set Handled to suppress ShellExecute
OnPaintTNotifyEventFired during custom painting operations
span class="keyword">property OnAnnotationLinkClick: TPdfViewAnnotationLinkClickEventFired when the user clicks a /Annot Subtype Link that is not auto-handled by LinkOptions.
span class="keyword">property OnCanResizeDocuments the OnCanResize event published by TPdfView.
OnClickOccurs when the user clicks (left mouse button) inside the viewer.
span class="keyword">property OnConstrainedResizeDocuments the OnConstrainedResize event published by TPdfView.
span class="keyword">property OnContextPopupDocuments the OnContextPopup event published by TPdfView.
OnDblClickOccurs when the user double-clicks (left mouse button) inside the viewer.
span class="keyword">property OnDragDropDocuments the OnDragDrop event published by TPdfView.
span class="keyword">property OnDragOverDocuments the OnDragOver event published by TPdfView.
span class="keyword">property OnEndDockDocuments the OnEndDock event published by TPdfView.
span class="keyword">property OnEndDragDocuments the OnEndDrag event published by TPdfView.
span class="keyword">property OnEnterDocuments the OnEnter event published by TPdfView.
span class="keyword">property OnExitDocuments the OnExit event published by TPdfView.
span class="keyword">property OnFormFieldFocusChange: TPdfFormFieldFocusEventFires when TPdfView moves or clears the logical AcroForm field focus cursor
span class="keyword">property OnGestureDocuments the OnGesture event published by TPdfView.
span class="keyword">property OnKeyDown: TKeyEventFired when a key is pressed while the control has focus.
span class="keyword">property OnKeyPress: TKeyPressEventFired for each character generated by the keyboard.
span class="keyword">property OnKeyUp: TKeyEventOccurs when a key is released while the viewer control has focus.
span class="keyword">property OnMouseActivateDocuments the OnMouseActivate event published by TPdfView.
span class="keyword">property OnMouseDown: TMouseEventFired when the user presses a mouse button over the view.
span class="keyword">property OnMouseEnterDocuments the OnMouseEnter event published by TPdfView.
span class="keyword">property OnMouseLeaveDocuments the OnMouseLeave event published by TPdfView.
span class="keyword">property OnMouseMove: TMouseMoveEventFired whenever the mouse moves over the view.
span class="keyword">property OnMouseUp: TMouseEventFired when the user releases a mouse button.
span class="keyword">property OnMouseWheel: TMouseWheelEventFired when the wheel is rotated over the view.
span class="keyword">property OnMouseWheelDownDocuments the OnMouseWheelDown event published by TPdfView.
span class="keyword">property OnMouseWheelUpDocuments the OnMouseWheelUp event published by TPdfView.
span class="keyword">property OnPageChange: TNotifyEventFired when the current page changes for any reason.
span class="keyword">property OnPageNumberChanged: TNotifyEventFired when the visible page number changes due to scrolling.
span class="keyword">property OnPaint: TNotifyEventFired after the view has finished painting the current page.
span class="keyword">property OnResize: TNotifyEventFired whenever the control's client area changes size.
span class="keyword">property OnSelectionChange: TNotifyEventFires when the materialised text selection ranges actually change.
span class="keyword">property OnStartDockDocuments the OnStartDock event published by TPdfView.
span class="keyword">property OnStartDragDocuments the OnStartDrag event published by TPdfView.
span class="keyword">property OnWebLinkClick: TPdfViewWebLinkClickEventFired when the user clicks a text-detected web URL that is not auto-handled by LinkOptions.

TPdfReadingSession Component

TPdfReadingSession is a TTS-neutral read-aloud state machine that coordinates TPdfSpokenText chunks, host speech-engine callbacks, and TPdfView word-cursor highlighting.

Methods

MethodDescription
Create(AOwner: TComponent)Initialize an idle session with default estimated speech pacing
LoadSpoken(const Chunks: TPdfSpokenTexts)Stop current playback and copy the chunks to speak in order
PlayStart playback from the first loaded chunk
PlayFrom(ChunkIndex: Integer)Start playback from a zero-based chunk index
PauseMove from pssSpeaking to pssPaused and raise OnPauseRequest
ResumeResume paused playback or re-speak the current chunk when ResumeRestartsChunk is enabled
StopCancel playback, reset chunk and word cursors, and clear attached TPdfView word highlighting
FeedSpokenPosition(SpokenOffset: Integer)Map a speech-engine offset back to a PDF page character and move the TPdfView word cursor
Tick(SpeechStillBusy: Boolean; ElapsedMs: Cardinal = 0)Advance to the next chunk, finish playback, or estimate the current word while speech is still busy

Properties

PropertyTypeDescription
StateTPdfReadingSessionStateCurrent state: pssIdle, pssSpeaking, or pssPaused
ChunkCountIntegerNumber of loaded spoken chunks
CurrentChunkIntegerZero-based active chunk index, or -1 when no chunk is active
CurrentWordIntegerZero-based active word index inside the current chunk, or -1 when unknown
ViewTPdfViewViewer that receives word cursor updates
EstimatePacingBooleanUse elapsed time to estimate word position for speech engines with no word-position signal
EstimatedWordsPerMinuteIntegerSpeech rate used by estimated pacing, default 175
ResumeRestartsChunkBooleanMake Resume re-speak the current chunk for engines where pause cancels queued speech

Events

EventTypeDescription
OnSpeakTPdfReadingSpeakEventRaised when the host should speak a chunk
OnCancelRequestTNotifyEventRaised when the host should cancel speech
OnPauseRequestTNotifyEventRaised when the host should pause speech
OnResumeRequestTNotifyEventRaised when the host should resume speech without restarting the chunk
OnChunkChangeTPdfReadingChunkEventRaised when the active chunk changes
OnWordChangeTPdfReadingWordEventRaised when the active word changes
OnFinishedTNotifyEventRaised after the last chunk finishes

TPdfThumbnailView Component

TPdfThumbnailView is a scrollable side-panel control from the FPdfThumbnail unit. It links to a TPdf component and renders one page thumbnail per row for page navigation.

Published Properties

PropertyTypeDefaultDescription
PdfTPdfnilDocument component used for thumbnail rendering
CurrentPageIndexInteger0One-based selected page index; 0 means no page selected
ThumbnailWidthInteger120Target thumbnail width, clamped to 48..800
ThumbnailHeightInteger160Target thumbnail height, clamped to 48..800
TextColorTColorclBlackPage-number caption color
HoverColorTColorclMoneyGreenRow highlight color under the hovered thumbnail
SelectionColorTColorclHighlightRow highlight color for CurrentPageIndex
BorderColorTColorclGrayThumbnail border color

Events

EventTypeDescription
OnPageClickTPdfThumbnailClickEventFired when the user left-clicks a thumbnail row; APageIndex is one-based

Data Types and Enumerations

Core Types

TypeDefinition
WStringWide string type for Unicode text
TPdfIntegerArrayDynamic array of Integer values
TPdfSingleArrayDynamic array of Single values used for text object character positions
TPdfPrintPageRangeRecord: StartPage, EndPage: Integer
TPdfPrintPageRangesDynamic array of one-based print page ranges
TPdfPointRecord: X, Y: Double
TPdfRectangleRecord: Left, Top, Right, Bottom: Double
TPdfReadingUnitStores one spoken reading unit with text, semantic kind, page, highlight rectangles, source indexes, alternate-text state, and language
TPdfReadingUnitsDynamic array of TPdfReadingUnit records
TPdfWordBoxStores one word, its FTextPage character range, its page-space rectangle, and its one-based page number
TPdfWordBoxesDynamic array of TPdfWordBox records
TPdfSpokenSpanMaps one run of speech-engine text back to a source page character range
TPdfSpokenSpansDynamic array of TPdfSpokenSpan records
TPdfSpokenTextSpeech text plus span mappings back to PDF page text
TPdfSpokenTextsDynamic array of TPdfSpokenText chunks
TPdfReadingSessionStatepssIdle, pssSpeaking, pssPaused
TPdfReadingSpeakEventCallback signature for TPdfReadingSession.OnSpeak
TPdfReadingChunkEventCallback signature for TPdfReadingSession.OnChunkChange
TPdfReadingWordEventCallback signature for TPdfReadingSession.OnWordChange
TPdfStreamAdapterClass that exposes a seekable TStream as PDFium FPDF_FILEACCESS callbacks
TPdfXObjectLifetime wrapper for reusable Form XObject handles created by CreateXObjectFromPage
TPdfFileIdentifierTypefidPermanent, fidChanging
TPdfPageBoxpbMedia, pbCrop, pbBleed, pbTrim, pbArt
TPdfJavaScriptActionRecord: Name, Script: WString
TPdfJavaScriptActionsDynamic array of TPdfJavaScriptAction records
TPdfVersionpvUnknown, pv10, pv11, pv12, pv13, pv14, pv15, pv16, pv17. Explicit SaveAs targets from pv13 through pv17 are normalized and validated against the selected PDF version: the saved file is rejected if it carries dictionary entries, filter names, annotation subtypes, action types, fonts, color spaces, or encryption parameters introduced after the chosen version (for example JBIG2Decode, MarkInfo, Polygon/PolyLine/Caret/Screen/Watermark/Redact annotations, AES/AES-256 encryption, Tagged PDF, OutputIntents, or Portable Collection are blocked when the target is too old).
TRotationro0, ro90, ro180, ro270
TSaveOptionsaNone, saIncremental, saNoIncremental, saRemoveSecurity
TObjectTypeotUnknown, otText, otPath, otImage, otShading, otForm
TPageModepmNone, pmOutline, pmThumbs, pmFullScreen, pmOptionalContentGroup, pmAttachments, pmUnknown
TPdfActionacUnsupported, acGoto, acGotoRemote, acUri, acLaunch
TPdfPrintModeprEmf, prTextOnly, prPostScript2, prPostScript3, prPostScript2PassThrough, prPostScript3PassThrough, prEmfImageMasks, prPostScript3Type42, prPostScript3Type42PassThrough
TPdfDisplayModedmSingleContinuous, dmTwoPageContinuous, dmTwoPageContinuousWithCover
TPdfViewLinkOptionloAutoGoto, loAutoOpenURI, loAutoLaunch, loAutoEmbeddedGoto
TPdfViewLinkOptionsSet of TPdfViewLinkOption values

Search and Render Options

TypeValues
TSearchOptionseCaseSensitive, seWholeWord, seConsecutive
TSearchOptionsSet of TSearchOption
TRenderOptionreAnnotations, reLcd, reNoNativeText, reGrayscale, reDebugInfo, reNoCatchException, reLimitCache, reHalftone, rePrinting, reReverseByteOrder, reNoSmoothText, reNoSmoothImage, reNoSmoothPath, reInvert, reNightDuotone
TRenderOptionsSet of TRenderOption

Drawing Types

TypeValues
TPdfFillModefmNone, fmAlternate, fmWinding
TPdfLineCaplcDefault, lcButt, lcRound, lcProjectingSquare
TPdfLineJoinljDefault, ljMiter, ljRound, ljBevel
TPdfBlendModebmDefault, bmMultiply, bmScreen, bmOverlay, bmDarken, bmLighten, bmColorDodge, bmColorBurn, bmHardLight, bmSoftLight, bmDifference, bmExclusion, bmHue, bmSaturation, bmColor, bmLuminosity

Annotation Types

TypeDescription
TPdfAnnotationSubtypeAnnotation subtypes: Text, Link, FreeText, Line, Square, Circle, Polygon, PolyLine, Highlight, Underline, Squiggly, StrikeOut, Stamp, Caret, Ink, Popup, FileAttachment, Sound, Movie, Widget, Screen, PrinterMark, TrapNet, Watermark, 3D, RichMedia, XFAWidget, Redact
TPdfAnnotationFlagFlags: afInvisible, afHidden, afPrint, afNoZoom, afNoRotate, afNoView, afReadOnly, afLocked, afToggleNoView
TPdfAnnotationRecord containing Subtype, Flags, Color, InteriorColor, Contents, Rectangle, and other properties

Form Types

TypeDescription
TPdfFormTypeftUnknown, ftNone, ftAcroForm, ftXfaFull, ftXfaForeground
TPdfFormFieldTypefiUnknown, fiPushButton, fiCheckBox, fiRadioButton, fiComboBox, fiListBox, fiTextField, fiSignature
TPdfFormFieldFlagffReadOnly, ffRequired, ffNoExport, ffMultiline, ffChoiceCombo, ffChoiceEdit, ffPassword, ffChoiceMultiSelect
TPdfFormFieldInfoRecord containing FieldType, Flags, Name, Value, AlternateName, and other properties

Record Types

TypeFields
TBookmarkHandle, Title, PageNumber, Action, ActionPageNumber
TDestinationHandle, Name, PageNumber, HasX, X, HasY, Y, HasZoom, Zoom
TLinkAnnotationHandle, Rectangle, PageNumber, Action, ActionPageNumber, ActionPath, Points
TWebLinkUrl: WString, Rectangles: TPdfRectangles
TPdfImageWidth: Integer, Height: Integer, Data: TBytes
TPdfSignatureContent: TBytes, Encoding: WString, Reason: WString, Time: WString, Permission: Integer
TPdfStructureElementLevel, ParentIndex, TypeName, ObjectType, Title, AlternateText, ActualText, Expansion, ID, Language, MarkedContentID, MarkedContentIDs, ChildCount, ChildMarkedContentIDs, AttributeCount

FPdfAsync Helper Unit

TypeDescription
IPdfCancellationTokenRead-only cancellation token with IsCancelled, ThrowIfCancelled, and RegisterCallback
IPdfCancellationTokenSourceOwner-side cancellation source exposing Token and Cancel
TPdfCancellationTokenSourceDefault implementation; use TPdfCancellationTokenSource.New
EPdfOperationCancelledException raised by ThrowIfCancelled after cancellation
TPdfFutureStatuspfsSuccess, pfsCancelled, pfsFailure
TPdfFutureResult<T>Result envelope with Value, Status, ErrorMessage, and IsSuccess / IsCancelled / IsFailure helpers
TPdfFuture<T>.RunFire-and-forget background worker helper that queues a reply back to the main thread
PdfNoCancellationTokenShared token that never cancels

FPdfMeasure Helper Unit

MemberDescription
TPdf.MeasureTextReturns text width and height in PDF user units for the selected font and size
TPdf.MeasureTextWidthReturns only the text width in PDF user units
TPdf.WrapTextSplits text on spaces and packs words into lines no wider than MaxWidth

FPdfMatrix Helper Unit

MemberDescription
TPdfMatrix.CreateCreate an identity matrix, explicit six-value matrix, or copy from FS_MATRIX
ResetReset to identity
MultiplyPost-multiply by another TPdfMatrix or six FS_MATRIX values
Translate / Scale / Rotate / SkewCompose common PDF-space transforms
HorizontalFlip / VerticalFlip / CentralFlipCompose axis flips
a, b, c, d, e, fRead-only matrix element properties
HandleRaw FS_MATRIX value for PDFium APIs

PDFium Helper Classes

ClassDescription
TPdfStreamAdapterWraps a seekable Pascal TStream as FPDF_FILEACCESS for custom document loading
TPdfXObjectOwns a reusable FPDF_XOBJECT created from another PDF page

Global Functions

FunctionDescription
Loaded: BooleanReturns True if the selected PDFium library is loaded
LoadLibraryManually loads the PDFium library
UnloadLibraryUnloads the PDFium library
DecodeDate(const Value: string; out DateTime: TDateTime; out DateTimeOffset: Integer): BooleanParses a PDF date string to TDateTime and UTC offset
SetPdfPrintMode(PrintMode: TPdfPrintMode): BooleanSelects the PDFium Windows printing output mode for subsequent print rendering
SetPdfPrintPaperHandlingDevMode(var DevMode: TDeviceMode; PrintPaperHandling: TPrintPaperHandling): BooleanMaps a PDF viewer-preference duplex hint into Windows DEVMODE.dmDuplex
V8FeaturesAvailable: BooleanReturns True when the loaded DLL exposes the PDFium V8 helper exports
XfaBStrHelpersAvailable: BooleanReturns True when the loaded DLL exposes the XFA FPDF_BSTR helper exports
GetRecommendedV8Flags: stringReturns PDFium recommended V8 command-line flags, or an empty string when the loaded DLL does not expose them
ValidatePdfUaStructureElements(const Elements: TPdfStructureElements): TPdfUaValidationIssuesValidates flattened TPdfStructureElement data for PDF/UA structure issues without loading pdfium.dll
ValidatePdfUaPageContentTagging(const Objects: TPdfPageContentMarkInfos; const Elements: TPdfStructureElements): TPdfUaValidationIssuesValidates that page text/image objects are tagged or marked as Artifacts
ValidatePdfUaRoleMapUsage(const Elements: TPdfStructureElements; const RoleMapKeys, RoleMapVals: TPdfUaNameArray): TPdfUaValidationIssuesValidates RoleMap key/value pairs resolution to standard ISO 32000-1 types
ClassifyStructType(const TypeName: WString; out HeadingLevel: Integer): TPdfContentFragmentKindClassifies a structure element type name into a TPdfContentFragmentKind and optional heading level
FormFieldTabOrderForPage(FormHandle: FPDF_FORMHANDLE; Page: FPDF_PAGE): TPdfIntegerArrayReturns page widget annotation indexes in form tab order
FocusedFormFieldTextForPage(FormHandle: FPDF_FORMHANDLE; Page: FPDF_PAGE): WStringReturns focused widget text for one form handle and page
NextFormFieldIndexForPage(FormHandle: FPDF_FORMHANDLE; Page: FPDF_PAGE; CurrentIndex: Integer; GoForward: Boolean): IntegerFinds the next or previous widget annotation index in page tab order
ClearFocusedFormField(FormHandle: FPDF_FORMHANDLE): BooleanClears the current focused form widget for a PDFium form handle
ComputeSpreadPages(DisplayMode: TPdfDisplayMode; PageNumber, PageCount: Integer; out LeftPageNo, RightPageNo: Integer)Computes left and right page numbers for two-page display modes
BuildReadingUnits(const Fragments: TPdfContentFragments): TPdfReadingUnitsConverts readable content fragments into sentence-level reading units
NextReadingUnitOfKind(const Units: TPdfReadingUnits; CurrentIndex: Integer; Kind: TPdfContentFragmentKind; GoForward: Boolean): IntegerFinds the next or previous reading unit of the requested semantic kind
BuildWordBoxes(const PageText: WString): TPdfWordBoxesSplits page text into TPdfWordBox records
WordBoxIndexAtCharIndex(const Words: TPdfWordBoxes; CharIndex: Integer): IntegerMaps a page character index to a word-box index
SpokenTextAppend(var Spoken: TPdfSpokenText; const SpokenPart: WString; Page, StartIndex: Integer; SourceCount: Integer = -1)Appends one mapped spoken-text run to a speech chunk
BuildSpokenTextFromWords(const Words: TPdfWordBoxes; FirstWord, LastWord: Integer): TPdfSpokenTextBuilds a spoken-text chunk from a word-box range
SpokenToPageChar(const Spoken: TPdfSpokenText; SpokenOffset: Integer; out Page, CharIndex: Integer): BooleanTranslates a spoken-text offset back to a page character index
EstimateSpokenWordIndex(const Words: TPdfWordBoxes; ElapsedMs: Cardinal; WordsPerMinute: Integer): IntegerEstimates current word index for engines that report no word-position signal
FPDF_RenderPageSkiaLow-level PDFium binding for rendering page content to an external SkCanvas
FPDF_FFLDrawSkiaLow-level PDFium binding for drawing form fields and popup annotations to an external SkCanvas
PointsToInches(Points: Double): DoubleConverts PDF points to inches
PointsToPixels(Points, PixelsPerInch: Double): DoubleConverts PDF points to pixels
PixelsToInches(Pixels, PixelsPerInch: Double): DoubleConverts pixels to inches
PixelsToPoints(Pixels, PixelsPerInch: Double): DoubleConverts pixels to PDF points
GetApplicationPath: stringReturns the executable directory used as the first PDFium DLL search root
IsWin64: BooleanReturns True when the current process targets Win64
BuildDllName(UseV8: Boolean): stringReturns pdfium.dll or pdfium.v8.dll for the requested V8 mode
FindDllInPath(const DllName, SearchPath: string): stringFinds a named PDFium DLL in one directory
FindDllInDllsTree(const DllName, StartPath, SubDir: string): stringSearches DLLs\Win32 or DLLs\Win64 folders below a start path
LoadPDFiumDll: stringResolves the PDFium DLL path using the component search policy

Global Variables

VariableTypeDefaultDescription
LibraryNamestring'pdfium.dll'Name of the standard PDFium DLL to load when EnableV8Engine is False
EnableV8EngineBooleanFalseSet to True before loading to select pdfium.v8.dll from the matching Win32 or Win64 DLLs folder

Common Usage Patterns

PDF Viewer Implementation

procedure TMainForm.OpenPDF(const FileName: string);
begin
  Pdf.FileName := FileName;
  Pdf.Active := True;
  PdfView.Pdf := Pdf;
  PdfView.Active := True;
  StatusBar1.SimpleText := Format('Loaded: %s (%d pages)',
    [ExtractFileName(FileName), Pdf.PageCount]);
end;

Create PDF with Compression

Pdf.CreateDocument;
Pdf.Compressed := True;
Pdf.Active := True;
Pdf.AddPage(0, 595, 842);
Pdf.AddText('Hello World!', 'Arial', 24, 100, 700, clBlack, $FF, 0.0);
Pdf.SaveAs('output.pdf');
Pdf.Active := False;

Text Extraction

Pdf.FileName := 'document.pdf';
Pdf.Active := True;
for I := 1 to Pdf.PageCount do
begin
  Pdf.PageNumber := I;
  Memo1.Lines.Add(Format('--- Page %d ---', [I]));
  Memo1.Lines.Add(Pdf.Text);
end;
Pdf.Active := False;

Form Field Processing

Pdf.FileName := 'form.pdf';
Pdf.Active := True;
Pdf.PageNumber := 1;
for I := 0 to Pdf.FormFieldCount - 1 do
begin
  FieldInfo := Pdf.FormFieldInfo[I];
  case FieldInfo.FieldType of
    fiTextField:
      Pdf.FormField[I] := 'New Value';
    fiCheckBox:
      Pdf.FormField[I] := 'Yes';
  end;
end;
Pdf.SaveAs('filled_form.pdf');
Pdf.Active := False;

Flatten a Filled Form

// Bake form values into permanent (non-editable) page content
Pdf.FileName := 'form.pdf';
Pdf.Active := True;
Pdf.FormField[0] := 'John Smith';
Pdf.FormField[1] := 'Yes';
Pdf.GenerateFormAppearances;          // step 1: refresh /AP from /V
Pdf.FlattenAllPages(FLAT_NORMALDISPLAY); // step 2: flatten all pages
Pdf.SaveAs('flattened.pdf');           // step 3: save
Pdf.Active := False;