Core Components
- TPdf - Main PDF document handling component for opening, navigating, extracting text, and editing PDF documents
- TPdfView - Visual component for displaying and interacting with PDF pages
- TPdfReadingSession - Read-aloud orchestration component for host TTS engines and TPdfView word tracking
- TPdfThumbnailView - Scrollable thumbnail side panel for page navigation
- Native LCL platforms - Linux Qt6 and macOS Cocoa run native PDFium with correct LP64 bindings, platform font/file services and actual bitmap channel layouts; see native installation for qualified Free Pascal/LCL configurations and capability limits
Document Operations
- Document Loading - Load PDF files from disk, memory streams, complete byte arrays, zero-based
Index/Countbyte-array windows, or on-demand TStream adapters viaLoadCustomDocument. Compatible, strict, and recovery policies add bounded classic, hybrid, and xref-stream diagnostics without replacing PDFium's semantic parser- Verified Repaired Output -
SaveAsRepairedcreates a full single-revision copy and independently strict-loads its xref and page structure before returning bytes or atomically replacing a file- Typed Object Graph -
ExportObjectGraphemits bounded typed JSON for direct and object-stream values, whileSaveAsObjectGraphPatchedapplies validated top-level dictionary changes as a staged incremental revision and strict-loads the result before delivery- Password Protection - Open password-protected PDF documents and report effective
UserPermissionsfor the authenticated session- Document Creation - Build new PDF documents from scratch with
CreateDocument,AddPage,AddText,AddImage,AddPicture,AddJpegImage, andCreatePath- Document Saving - Save modified documents with various options (incremental, remove security) and explicit PDF target versions from PDF 1.0 through PDF 1.7
- PDF/A-1b Output -
SaveAsPdfA/SaveAsPdfAToStreampost-process the base save with an incremental update that injects an XMP metadata stream, an sRGB ICC OutputIntent, and an updated document catalog so the result is PDF/A-1b conformant. Custom ICC profiles are supported throughTPdfASaveOptions.IccProfileData- PDF/A Validation -
ValidatePdfAand the read-onlyPdfAConformanceproperty scan an open document for XMPpdfaidmarkers, OutputIntent with embedded ICC, encryption presence, and report the conformance level (pac1a,pac1b,pac2b,pac3b,pacNone, orpacUnknown) plus a list ofTPdfAValidationIssueentries describing each problem found- PDF Version Compliance Validator - When SaveAs targets PDF 1.0 through PDF 1.7 the writer rejects any dictionary entry, filter, annotation subtype, action type, font, colour space, or encryption parameter introduced after the chosen target version (e.g. JBIG2Decode, MarkInfo, OutputIntents, AES / AES-256, Polygon / Caret / Watermark / Redact annotations, JavaScript / Trans / SetState actions)
- Stream Compression - Automatic FlateDecode compression ensures all PDF streams are optimally compressed when saving; set
Compressed := Falseto opt out for debug pipelines- Scalable Batch Merge -
MergeFilesimports file-backed sources with per-source page ranges and passwords, keeps at most one source document open, and exposes progress, cancellation, stop or skip handling, rollback, form, outline, resource, and viewer-preference policies- Page Subset Import -
ImportPagesByIndexcopies an explicit zero-based index array from a source document, with InsertAt = 0 to insert before page 1 or InsertAt = PageCount to append. Pass an empty index array to import every source page- N-up Composition -
ImportNPagesToOnereturns a brand-newTPdfwhose pages are NumX×NumY composites of the source document's pages, sized in PDF user units (1 unit = 1/72 in)- Page Reordering -
MovePagesreorders pages in place using a zero-based index array and a destination index for the first moved page- Page Plan Validation -
ValidatePagePlanpreviews delete, move, insert, split, and merge mappings, inventories navigation, label, form, structure-tree, imported-feature, and signature effects, and rejects plans that would leave dangling targets or modify signed content without explicit authorisation- Two-pass Layout Generation -
GenerateLayoutmeasures and paginates wrapped text, rules, images, page XObjects, headers, and footers before atomically emitting native page objects, while stable{page}and{pages}placeholders preserve the measured page count- Disk-backed Paged Layout -
GeneratePagedLayoutwrites commands to caller-selected seekable storage, restores each page from compact non-contiguous segments, bounds retained page arrays with an LRU cache, and appends PDFium pages sequentially- Cross-page Table Layout -
TPdfLayoutTableresolves fixed, fractional, and content-sized columns once, repeats contiguous header rows, splits eligible body rows, keeps row-spanning groups intact, and emits captions, cell borders, links, and one continuous Table / TR / TH / TD semantic hierarchy across pages- Cached Layout Nodes - Layout plans are cached by complete constraint, content, font, style, source, and measurer identities, while
TPdfLayoutCachedNodebuilds repeated templates lazily and emits each placement from one reusable native Form XObject- Automatic Tagged PDF Layout -
GenerateTaggedLayoutemits native MCIDs, artifacts, a Document structure tree, ParentTree and IDTree mappings, headings, lists, figures with alternate text, table headers, and Link annotations with OBJR ownership from the same measured layout plan; item constraints keep blocks and headings together, enforce widow / orphan minima, and force physical page breaks- Marked-content Editing -
PageObjectMarks,AddPageObjectMark,SetPageObjectMarkParam,RemovePageObjectMarkParam, andRemovePageObjectMarkinspect and mutate BDC property lists through stable native marks- Bidi and Complex-script Text -
AddShapedTextconverts directional runs, contextual forms, ligatures, advances, and offsets into positioned CID Type 2 glyphs, while generated ToUnicode mappings andActualTextpreserve logical Unicode semantics- CID Type 2 Font Authoring -
AddCidType2Textembeds caller-supplied TrueType data with explicit CID-to-GID and ToUnicode mappings, safe optional subsetting, controlled full-font fallback, and extraction integrity checks- Unified Cache Byte Budget -
TPdf.CacheBudgetBytescoordinates parsed page scenes, thumbnails, structure data, text snapshots, and page-object snapshots through one measurable global LRU, whileTPdfTileCacheand the system-font cache can join a caller-selected governor- Host System-font Provider -
ConfigureSystemFontProviderroutes native missing-font requests through an application provider with byte validation, bounded LRU caching, optional shared byte governance, native fallback, table extraction, and lifecycle statistics- Form XObject Page Reuse -
CreateXObjectFromPagemanufactures a reusableTPdfXObjecthandle from any page of another document;InsertFormObjectFromXObjectinserts ONE copy of the wrapped page into the current page. Ideal for watermarks, template overlays, and "stamp one page onto many" workflows. The destination page object can be positioned, scaled, and rotated throughFPDFPageObj_SetMatrixand theTPdfMatrixhelpers- Page Management - Add, delete, and manipulate individual pages;
AddPage(0, ...)inserts the very first page and activates it immediately- Page Boxes - Read and write MediaBox, CropBox, BleedBox, TrimBox, and ArtBox on the current page
- Catalog Language - Read and write the document language stored in the catalog /Lang entry
- Trailer File IDs - Read permanent and changing trailer /ID entries as binary bytes
- Document JavaScript Actions - Enumerate document-level JavaScript name-tree action names and scripts
- Tagged PDF Structure Tree - Inspect logical structure elements, accessibility text, language, marked-content IDs, and hierarchy for tagged PDF pages
- Viewer Preferences - Read
PrintCopies,PrintPageRanges,PrintScaling, andPrintPaperHandlingfrom the document's viewer-preference dictionary; saved PDFs default to a Fit Height first-page open action
Text Operations
- Text Extraction - Extract text from PDF pages with character-level precision via
Text,TextInRectangle, indexedCharacter,CharacterRectangle, andCharacterOriginproperties- Structured Text Model -
GetStructuredTextbuilds a bounded page, block, line, and styled-span hierarchy from native character geometry, font metadata, text-object identity, Tagged PDF semantics, and physical-layout fallback ordering- Table Detection and Extraction -
ExtractTablesandExtractDocumentTablescombine native word boxes with transformed path rulings to detect bordered or whitespace-aligned tables, preserve merged spans, score confidence, mark page continuations, and emit CSV or JSON- Semantic Reflow and Responsive HTML -
BuildReflowDocumentcombines Tagged PDF semantics, physical-layout inference, and table extraction into a bounded reusable node tree whose safe HTML output preserves headings, paragraphs, lists, figures, page sections, and table spans- Searchable OCR Layer -
ApplyOcrSearchLayerpasses bounded top-down BGRA page renders to an application provider, maps confidence quads through native page geometry, and adds invisible searchable text without re-encoding scan images- Sentence-Level Reading Units - TPdf.ReadingUnits, TPdf.DocumentReadingUnits, TPdfView.ReadingUnits and BuildReadingUnits expose sentence-sized TPdfReadingUnit records for synchronised TTS listen-reading
- Visual Line Selection -
TPdfView.SelectLineAtselects the visual text line containing a one-based page and zero-based character index through the same line-boundary model used by triple-click selection andShift+HomeorShift+End- Word-Level Reading Highlighting -
TPdf.PageWordBoxes,TPdfView.PageWordBoxes,BuildWordBoxes,WordBoxIndexAtCharIndex,TPdfView.SelectWordBox,TPdfView.SelectWordSpan,TPdfView.TrackReadingWordAt,TPdfView.SetReadingWord,TPdfView.ClearReadingWord,ReadingWordColor,ReadingWordFollowMaps a page character offset to the containing TPdfWordBox, highlights it, and returns the word index; Highlights one TPdfWordBox as the current spoken word on TPdfView; Clears the current word-level reading cursor overlay on TPdfView; Controls the overlay colour used for the current word-level reading cursor; Controls whether TPdfView scrolls the current spoken word into view while tracking reading- Read-Aloud Session Orchestration -
TPdfReadingSession,TPdfSpokenText,SpokenTextAppend,BuildSpokenTextFromWords,SpokenToPageChar, andEstimateSpokenWordIndexcoordinate host TTS engines, spoken chunks, word-position callbacks, estimated pacing, pause/resume handling, and TPdfView word-cursor updates- Text Search - Find text with case-sensitive, whole word, and consecutive search options using
FindFirst,FindNext, andFindPrevious, or stream forward and backward matches across the complete document withTPdf.CreateDocumentSearch, page-space result rectangles, cooperative cancellation, and constant page-handle memory- Search Highlight Overlay -
TPdfView.HighlightSearchTextreplaces the current page's match overlay, whileAddSearchTextHighlightappends unique ranges for additional terms so several queries can remain visible together.ClearHighlightremoves the complete set; navigating to another page clears it automatically because character ranges are page-specific.HighlightColordefaults toclYellowand is published so applications can theme the overlay- Character Properties - Access font size, weight, angle, and positioning for individual characters with the
CharacterAngle,CharacterFontSize,CharacterFontWeight,CharacterGenerated,CharacterIsHyphen, andCharacterMapErrorindexed properties- European Character Support -
AddTextautomatically loads and caches the matching system TrueType font before creating a text object, so accented Czech, French, German, Spanish, Portuguese, Polish, and Turkish characters that PDFium's built-in standard fonts cannot represent now render correctly without any code change- Text Addition - Add new text to PDF pages with custom fonts, colours, transparency, and rotation
- Text Object Positioning - Set per-character positions for existing text objects through
SetTextPositionsandTPdfSingleArray- Font Information - Retrieve font properties including family name, embedding status, italic angle, ascent / descent, and raw font data on a per-page-object basis
Annotation Support
- Annotation Types - Support for text, link, highlight, underline, strikeout, and many other annotation types
- Annotation Creation - Create new annotations programmatically
- Annotation Editing - Modify existing annotation properties including colour, transparency, and content
- Link Annotations - Handle internal and external links with action support
Form Support
- Voice Form-Filling Accessors - FocusedFormFieldValue, FocusedFormFieldName and FocusedFormFieldDetails on TPdf and TPdfView expose the current logical form field value, name and TPdfFormFieldInfo for keyboard or voice-driven form filling
- Form Types - Support for AcroForm and XFA forms
- Form Fill - Interactive form filling with JavaScript support
- V8 DLL Selection - Set
EnableV8Enginebefore loading to usepdfium.v8.dllfrom the matchingDLLs\Win32orDLLs\Win64folder and query V8/XFA helper availability viaV8FeaturesAvailable,XfaBStrHelpersAvailable, andGetRecommendedV8Flags- Field Access - Read and write form field values by index or position
- Field Information - Access field type, flags, name, and other properties
- Field Flags - Update AcroForm field flags by index or position through
SetFormFieldFlags/SetFormFieldFlagsAt, including read-only, required, password, and multi-select flags- Form Flattening -
GenerateFormAppearancesregenerates the /AP appearance stream for every form widget on every page, andFlattenPage/FlattenAllPagesbake annotations and form fields into static page content (non-editable)- Form Widget Text Selection, Clipboard & Undo / Redo - On the focused AcroForm widget the view exposes
GetSelectedFormText,CopySelectedFormTextToClipboard,CutSelectedFormTextToClipboard,PasteFormTextFromClipboard,SelectAllFormText, andFormUndo/FormRedo/FormCanUndo/FormCanRedo. The editor handlesCtrl+A,Ctrl+C,Ctrl+Insert,Ctrl+X,Shift+Delete,Ctrl+V, andShift+Insert; cut and paste reject read-only fields or sessions without form-fill or modify permission- Document Edit Transactions and Undo / Redo -
BeginEditTransaction,CommitEditTransaction, andRollbackEditTransactiongroup arbitrary page, object, annotation, attachment, and metadata edits, whileUndoEdit,RedoEdit, and portable edit journals use bounded SHA-256-verified bidirectional deltas- Crash Recovery and Commit-Driven Autosave - checksummed recovery packages bind source and recovered fingerprints to a bounded edit journal, while atomic autosave refreshes an explicit sidecar after commit, undo, or redo without rewriting the source PDF
Image Operations
- Image Extraction - Extract bitmaps from PDF pages with the indexed
Bitmapproperty; iterateBitmapCountto save every image to disk- JPEG Insertion -
AddJpegImagetakes a TStream of raw JPEG bytes and embeds the image as a /DCTDecode XObject without re-encoding- Picture Support -
AddPictureaccepts aTPictureobject with automatic format conversion through the registered VCL/LCL graphic classes- Direct Image Insertion -
AddImage(FileName)recognises any format registered with the VCL or LCL graphics units (BMP, PNG via PngImage, JPG, ...) and shares the AddPicture pipeline.AddImage(TBitmap)skips the TPicture intermediary, which simplifies callers that already hold a TBitmap from rendering or batch generation work- Image ICC Profile - Image page objects expose their embedded ICC profile data when present (binding for
FPDFImageObj_GetIccProfileDataDecoded)- Thumbnail Generation - Generate current-page thumbnail bitmaps via the
Thumbnailproperty or render any one-based page throughTPdf.RenderPageThumbnailwithout changingPageNumber, with a revision-aware LRU bounded by entry and pixel-byte ceilings- Parsed Page Scene Cache -
TPdf.RenderPageByIndex,RenderPageThumbnail, andExtractThumbnailreuse bounded LRU-cached PDFium page scenes while page edits, page-tree changes, form state, and document teardown invalidate stale entries
Helper Units
- Async Infrastructure -
FPdfAsynccombines structured cooperative cancellation with removable callbacks and deadline sources, configurableTPdfFuture<T>result dispatch, and a reusableTPdfAsyncExecutorwith fixed workers, four FIFO priority lanes, bounded-queue backpressure, per-task handles, timing diagnostics, aggregate statistics, and graceful shutdown- Stream Adapter -
TPdfStreamAdapterbridges a PascalTStreamto PDFium'sFPDF_FILEACCESScallbacks soLoadCustomDocumentreads blocks on demand instead of buffering the entire PDF in memory- Progressive Download Sessions -
TPdfProgressiveDocumentkeeps PDFium's native availability provider alive, feeds document, form, and page hints intoTPdfRangeRequestScheduler, coalesces missing ranges, preempts background transfers for page-critical bytes, bounds request sizes and retries, cancels redundant transports, and opens a linearised page before the complete PDF arrives- Bounded Stream Inspection -
TPdfStreamInspectorinventories physical stream objects, exposes safe raw windows and ordered general-filter decoding, reports image and attachment native-access paths, and enforces source, output, dictionary, count, and expansion-ratio budgets- Content Stream Normalisation -
TPdf.SaveAsNormalizedContenttokenises logical page content, removes comments, validates state and container balance, preserves unsupported operators and inline-image data, and coalesces safe/Contentsarrays- Fast Web View Output -
TPdf.SaveAsLinearizedwrites first-page objects ahead of later pages, emits two cross-reference sections, and builds page-offset plus shared-object hint tables so an HTTP Range client can open a requested page without downloading the complete file- Object Stream Output -
TPdf.SaveAsObjectStreampacks eligible values into bounded PDF 1.5+ ObjStm groups, keeps opening-critical objects direct, and writes adaptive type-2 xref entries for smaller files without sacrificing random access- Dirty-object Incremental Save -
TPdf.BeginIncrementalSaveandCommitIncrementalSavecompare stable semantic snapshots, preserve every previous encrypted or unencrypted byte, inherit R5, R6, or R7 security parameters, append only changed objects, strictly reopen each result, and use a durable side file plus atomic replacement for file commits- Optional Content Control -
TPdf.InspectOptionalContentinventories layers, configurations, usage metadata, radio groups, order, locks, OCMD policies, and visibility expressions, whileSaveAsOptionalContentConfiguredwrites deterministic layer states that PDFium applies through its native rendering context- Bounded Working Storage -
TPdfRandomAccessStorekeeps small data in memory, spills once to a private delete-on-close temporary file at a caller-selected ceiling, and supplies positioned reads without changing the shared cursor;TPdf.SaveMemoryLimitapplies the same policy to core save post-processing, while default open-action and page-label catalog updates use fixed-size windows and a sparse lazy object index- Native Version Query -
TPdf.PdfVersionreusesFPDF_GetFileVersionparser state for header and catalog semantics, with one eight-byte header guard to reject malformed catalog downgrades- Matrix Geometry Toolkit -
FPdfMatrixwraps PDFium'sFS_MATRIXwith post- and pre-composition, pivot-aware transforms, stretch / contain / cover rectangle fitting, scale-aware invertibility diagnostics, decomposition, non-mutating inverse helpers, vector and quadrilateral mapping, one-allocation point or rectangle batches, in-place variants, and one-pass transformed bounds- Cancellable Progressive Rendering -
TPdf.RenderPageProgressivedrives PDFium'sFPDF_RenderPageBitmap_Start+RenderPage_Continueloop and polls anIPdfCancellationTokenbetween iterations via theIFSDK_PAUSEcallback so long high-DPI renders can abort mid-page instead of blocking until completion. Returns aTPdfProgressiveStatusofprsDone,prsCancelled, orprsFailed- Zero-Copy Render Path -
RenderPage/RenderTile/RenderPageProgressivewrite PDFium output directly into the destinationTBitmap's DIB buffer instead of staging through an internal buffer, saving one width × height × 4 bytes memory copy per render - most noticeable at high DPI (thumbnail panels, print-quality export, batch export). A per-scanline fallback path is preserved when the destination DIB cannot be wrapped safely- Low-Vision Bitmap Transforms - InvertPdfBitmap, GrayscalePdfBitmap and DuotonePdfBitmap transform rendered 32-bit TBitmap pixels in place for inverted, greyscale, or two-colour low-vision views
- Live Low-Vision Viewing -
TPdfView.OptionssupportsreInvertandreNightDuotone, withNightDuotoneInkandNightDuotonePapercontrolling the live night palette before overlays are painted
Drawing Operations
- Path Drawing - Create paths with lines, Bezier curves, and closed shapes
- Object Removal - Remove page objects and regenerate page content from TPdf or TPdfView
- Fill and Stroke - Configure fill mode, colours, transparency, and stroke properties
- Blend Modes - Support for various PDF blend modes
- Line Styles - Configure line cap, line join, and stroke width
Digital Signatures
- Signature Detection - Detect and enumerate digital signatures in PDF documents
- Signature Information - Access signature contents, byte range, sub-filter, reason, and time
- MDP Permissions - Query document modification detection and prevention permissions
- Post-signature revision analysis -
AnalyzeSignatureRevisionsclassifies original-byte incremental changes against DocMDP and FieldMDP, identifies validation-material updates, and reports shadow definitions or unresolved compressed objects without resaving the document- PDF 2.0 elliptic-curve profiles - PAdES validation identifies NIST, Brainpool, Ed25519, and Ed448 signatures, checks curve-to-digest congruence and AlgorithmIdentifier parameters, and reports unsupported native cryptography independently from invalid combinations
Attachment Support
- Attachment Access - Read, create, modify, and delete embedded file attachments
- Bounded Batch Extraction -
ReadAttachmentMetadatainventories attachments once andExtractAttachmentsToStreamswrites one decoded payload at a time under per-file, aggregate, chunk, and cancellation controls- Attachment Names - Access attachment filenames
- Attachment Types - Read embedded file MIME subtype values when present
- Bookmarks - Navigate document bookmarks with hierarchical support via the
Bookmarksarray,BookmarkChildren,HasBookmarkChildren, andBookmarkFromtraversal helpers- Named Destinations - Access named destinations by index or name through
Destination,DestinationByName, andDestinationCount- Page Labels - Retrieve page labels for each page via
PageLabel; useful when documents use Roman numerals for front matter- Web Links - Detect and navigate web links on pages with
WebLink,WebLinkCount, andTPdfView.WebLinkAtPos- Link Annotations - Access link annotations with action and destination information through
LinkAnnotation,LinkAnnotationCount, andTPdfView.LinkAnnotationAtPos- Safe Link Click Handling - TPdfView raises
OnAnnotationLinkClick/OnWebLinkClickevents before automatic goto / URI handling, with launch actions disabled by default. Link click detection runs only when the gesture is a click rather than a drag, using a fresh MouseDown anchor so panning gestures still flow through the existing scroll path unchanged
Rendering
- High-Quality Rendering - Render pages to device context, bitmap, or tile through
RenderPage/RenderTile, with zero-copy direct writes into the destination DIB buffer- Cancellable Progressive Rendering -
RenderPageProgressivedrives PDFium's progressive loop and polls anIPdfCancellationTokenbetween iterations, returningprsDone,prsCancelled, orprsFailed. The bitmap holds the partial work done so far when cancelled- Parallel Page Rendering -
RenderPagesParallelcaptures the current document once, gives each worker an independently loaded PDFium module and document, preserves request order, and bounds per-page plus aggregate retained output memory- Secure Content Redaction -
SaveAsRedactedapplies/Redactrectangles to an isolated snapshot, conservatively removes intersecting top-level page objects and overlapping annotations, paints opaque replacements, removes embedded attachments, and writes a sanitised single-revision result without changing the loaded document- Render Options - LCD text optimisation (
reLcd), annotations (reAnnotations), greyscale, and printing mode flags- Skia Hooks - Low-level
FPDF_RenderPageSkiaandFPDF_FFLDrawSkiabindings are available when callers provide an external SkCanvas (depends on bundled DLL exports)- Print Mode Selection - Set EMF, text-only, PostScript, pass-through, image-mask, and Type 42 PDFium print modes via
SetPdfPrintModewithTPdfPrintMode- Async Overlay - TPdfView can display an opt-in loading overlay while application-owned workers render with separate TPdf instances
- Page Rotation - Support for 0, 90, 180, and 270 degree rotation (
ro0,ro90,ro180,ro270)- Transparency Detection -
Transparentproperty reports whether any object on the current page has transparency, including blend modes and partial alpha
Viewing (TPdfView)
- Display Modes -
dmSingleContinuous,dmTwoPageContinuous, anddmTwoPageContinuousWithCover(the cover page stands alone, then continues with two-page spreads). The unit-levelComputeSpreadPageshelper exposes the spread-page maths without instantiating a viewer- Fit Mode -
FitModechooses how the page sits in the viewport:pfmNone(manual zoom),pfmActualSize(100%),pfmFitPage(whole page fits in the viewport),pfmFitWidth(page width matches viewport width), andpfmFitHeight(page height matches viewport height). The active fit mode is re-applied automatically on Resize and when the current page changes; setting Zoom directly cancels the active fit mode (FitMode reverts topfmNone), matching the standard PDF viewer convention- Zoom Control - Variable zoom with
PageZoom,PageWidthZoom,PageHeightZoom, andActualSizeZoomper-page helpers- Page Colour -
PageColorsets the PDF page background independently of the surrounding control'sColor. It defaults toclWhite, keeping pages paper-white whatever theme the host application uses. A dark-mode viewer can keep its scroll area dark whilst displaying the PDF page in white, or another colour chosen by the application- Interactive Text Selection - End-user drag-to-select text on PDF pages, with hit-test auto-switching between selection and pan: clicking on a character starts a selection drag, clicking on whitespace pans. Double-click selects the word, triple-click selects the line,
Ctrl+Aselects the page (both pages in spread mode),Ctrl+Ccopies asCF_UNICODETEXT,Shift+arrowsextend selection, hover over text switches the cursor tocrIBeam, and dragging into a viewer edge auto-scrolls the page. New publishedSelectionColorandOnSelectionChange; new publicHasSelection,SelectedText,SelectionCharCount,ClearSelection,SelectAll,CopySelectionToClipboard. Spread display modes select across both visible pages with CR/LF joining. A default right-click Copy popup is auto-attached when the host has not assigned its ownPopupMenu. Gated by the v1.17.0AllowUserTextSelectionflag for kiosk hosts- Coordinate Mapping - Convert between viewer device coordinates and PDF page coordinates with
DeviceToPage/PageToDevice, including overloads that take aTRectand return aTPdfRectangle- Text Selection and Hit Testing - Resolve characters under viewer points with
CharacterIndexAtPosand paint text selection highlights viaPaintSelection- Mouse & Keyboard - Full input device support with mouse drag scrolling, PgUp / PgDn / Ctrl+Home / Ctrl+End shortcuts, and wheel-up / wheel-down page navigation. Ctrl+wheel is reserved for application zoom and skipped by the navigation handler
- User Input Lock-Down -
AllowUserPageChangecontrols keyboard page shortcuts,ChangePageOnMouseScrollingcontrols wheel page jumps, andAllowUserTextSelectioncontrols mouse / keyboard text-selection input. All three default to True; flip them False to lock down kiosks, preview panes, or read-only embeddings without subclassing- Async Render Overlay -
AsyncRendering,LoadingText, andLoadingColordraw a small "Loading..." indicator over the rendered page so applications using their own worker for long renders share a consistent visual affordance. Defaults preserve existing behaviour.TPdfnow serialises render and page-unload calls per instance; applications still own worker dispatch and must avoid mutating a document while a render is in flight- Safe Link Click Handling -
LinkOptionsis a published set that controls automatic behaviour for the four PDF link action types:loAutoGoto(page jump),loAutoOpenURI(ShellExecute),loAutoLaunch(ShellExecute), andloAutoEmbeddedGoto(reserved). Defaults enableloAutoGotoandloAutoOpenURIonly;loAutoLaunchandloAutoEmbeddedGotostay off so a stray click cannot run an arbitrary program.OnAnnotationLinkClickandOnWebLinkClickfire before any automatic action and let the application mark the event Handled or redirect it- Form Interaction - Interactive form editing within the viewer, plus the v1.23.0 selection / Undo / Redo helpers
- Visual Styling -
PageShadowSize,PageShadowColor, andPageBorderColorpaint an optional drop shadow under the page rectangle and a one-pixel border around it;SmoothScrollnow animates line/page scrollbar commands in timer-driven segments while thumb tracking remains immediate- Thumbnail Navigation -
TPdfThumbnailView(unitFPdfThumbnail) renders one page thumbnail per row in a scrollable side panel with hover and selection highlighting plus click-to-go navigation. Designed to sit next to a TPdfView. Properties:CurrentPageIndex,ThumbnailWidth,ThumbnailHeight,TextColor,HoverColor,SelectionColor,BorderColor; event:OnPageClick
Compression
- Automatic Compression - When the
Compressedproperty is True (default), all PDF streams are ensured to be FlateDecode compressed when saving- Post-Processing - The compression engine scans saved PDF data and compresses any uncompressed streams using zlib maximum compression
- Cross-Reference Rebuild - Automatically rebuilds the xref table when stream compression changes byte offsets
- Zero Overhead - If all streams are already compressed, the data passes through without modification
Security
- Password Support - Open password-protected PDF documents
- Permissions - Read document and user permissions; the
SecurityAuditdemo combines permissions, attachments, document JavaScript, URI / Launch links, signatures, XFA, and V8 availability into a read-only risk surface with TXT / JSON report save and TXT copy actions- Bounded DER Toolkit -
FPdfAsn1encodes low and high tag numbers, typed values, sorted SET OF collections, and canonical time or string forms; its zero-copy reader windows, typed decoders, and resource-limited validator support CMS, PAdES, certificate, and timestamp workflows- Signature-specific long-term validation -
TPadesDssOptions.Vriswrites hash-keyed indirect VRI dictionaries while shared certificate, OCSP, and CRL streams are content-hash deduplicated and PAdES B-LT or B-LTA signing creates the new signature's VRI automatically- Remote and interrupted signing -
PreparePadesRemoteSignaturepersists the SHA-256 document digest, exact ByteRange, placeholder coordinates, and prepared-PDF fingerprint for HSM or cloud signing, whileCompletePadesRemoteSignaturerejects modified, reused, oversized, or digest-mismatched sessions before writing output- Signature revision policy analysis -
AnalyzeSignatureRevisionsreconstructs classic, hybrid, and xref-stream revision chains, applies DocMDP and FieldMDP per signature, and fails closed on malformed, shadow, compressed, or over-budget changes- Ambiguity-resistant signature profiles - PAdES validation counts required keys only at the top signature-dictionary level, rejects duplicates and inconsistent Sig or DocTimeStamp profiles, and requires ByteRange to exclude exactly the direct hexadecimal Contents token
- Multi-signature evidence export -
BuildPadesEvidenceReportcorrelates PDFium facts, CMS policy, trust and timestamp status, certificate-path hashes, DSS/VRI coverage, and revision decisions with bounded JSON and CSV output- Archival timestamp renewal -
RenewPadesArchiveTimestampappends an RFC 3161 Document Time-stamp over the exact existing signature history, optionally refreshes the complete DSS first, and validates the resulting B-LTA chain before output- Asynchronous trust validation -
ValidatePadesTrustandValidatePadesTrustAsyncverify original-byte detached signatures, signer and TSA chains, optional online revocation evidence, and RFC 3161 timestamp tokens with staged progress, bounded retrieval, and cooperative cancellation- Qualified trust -
TPdfEuropeanTrustedListparses only caller-authenticated ETSI trusted lists, reauthenticates cached XML, accepts caller-owned update sources, and supplies offline qualified-service evaluation throughQualifiedTrustEvaluator- Security Removal - Save documents with security removed (when authorised)
Printing
- Print Modes - Choose between EMF, text-only, PostScript Level 2 / 3, PostScript pass-through, EMF image-mask, and Type 42 print modes through the global
SetPdfPrintModefunction- Viewer Preferences - Surface document author intent through
PrintCopies,PrintPageRanges(one-based page ranges),PrintScaling, andPrintPaperHandling;SetPdfPrintPaperHandlingDevModemaps the duplex hint into WindowsDEVMODE.dmDuplex- N-up Printing - The Delphi, C++Builder, and Lazarus
PrintPreferencesdemos show N-up sheet composition (1 / 2 / 4 / 9 pages per sheet) with odd / even page filtering, greyscale rendering, optional 1-pixel cell borders, PDF author print preferences, and duplex intent mapping viaSetPdfPrintPaperHandlingDevMode
Shipped Demos
The
Demo\Delphi,Demo\CBuilder, andDemo\Lazarustrees ship runnable sample projects that exercise the live API surface across all three IDE families. Highlights:
- PDFViewer / MultiPageViewer / SplitView - End-to-end TPdfView usage: load, navigate, zoom, rotate, two-page spread, cover-aware layouts, and Delphi / C++Builder / Lazarus side-by-side PDF comparison with synchronised commands; the viewer demos are also practical speed tests for multi-gigabyte PDFs, where 2.x GB documents can reach a usable first view almost immediately while page rendering stays responsive
- ViewerInteractionLab - Delphi, C++Builder, and Lazarus focused TPdfView interaction samples for display modes, fit modes, page colours, rotation, search highlighting, text selection, selected-text preview, clipboard actions, and DeviceToPage coordinate feedback
- SearchAndSelect - Delphi, Lazarus, and C++Builder focused workflow samples for all-page search result listing, previous / next match navigation, double-click result jumping,
HighlightSearchText, match-case / whole-word search,AllowUserTextSelection,SelectedText,SelectAll,CopySelectionToClipboard,ClearSelection, and spread display modes- PreflightReport - Reusable
FPdfPreflightReportobjects collect PDF/A, PDF/UA, PDF/E, PDF/X, PDF/R, and PDF/VT results with status, Info / Warning / Error severity, lookup, search, filtering, deterministic aggregation, stable SHA-256 fingerprints, TXT / HTML / Markdown / JSON / CSV output, and SARIF 2.1.0 / JUnit XML / NDJSON / XML automation formats; Delphi, Lazarus, and C++Builder demos plus console workflows provide previews, batch routing, summaries, report attachments, and CI exit-code gating- ContentExtractionLab - Delphi, Lazarus, and C++Builder unified content inventory workflow for document metadata, page text, page objects, images, attachments, links, annotations, bookmarks, and font / character metrics with TXT / JSON export, all / none category selection, source-PDF save, and report copy actions
- WatermarkStamp - Delphi, Lazarus, and C++Builder reusable Form XObject workflow for centred watermarks, corner stamps, and page number labels across a multi-page target PDF
- CreatePDF - Build a multi-page PDF from scratch with text, images, paths, tables, and watermark composition; includes a "European Text" option to write accented Czech / French / German / Spanish / Portuguese / Polish / Turkish text for verifying font selection and Unicode handling
- ExtractText / ExtractImages / ContentExtractionLab - Save extracted text (including per-page separated output) or embedded images to disk; or generate a multi-category content inventory report in one pass
- FormFill - Read AcroForm field metadata, write values, regenerate /AP appearances, and save either the editable or the flattened result
- FontProperties - Inspect indexed character / font metadata through both TPdf and TPdfView in Delphi, C++Builder, and Lazarus
- MergePDF / SplitPDF - Combine multiple source PDFs (with per-file page range selection, optional output path, run log, cancel button, and merge completion summary) or split one PDF into per-page output files
- PDFtoJpg / BatchExport - Delphi, C++Builder, and Lazarus one-shot or batched multi-file PDF to JPG conversion with per-file overall progress, per-page current progress, DPI / quality / password inputs, and a cooperatively-cancellable batch backed by
IPdfCancellationToken- StandardsLab - Delphi, C++Builder, and Lazarus workflow samples for PDF/A, PDF/UA, PDF/E, PDF/X, PDF/R, and PDF/VT validation, issue reporting, and standards-oriented save outputs
- PrintPDF / PrintPreferences - Delphi, C++Builder, and Lazarus standard PDF printing with preview, page ranges, copies, collate, progress, and cancellation (PrintPDF), plus Delphi, C++Builder, and Lazarus N-up sheet composition with odd / even filtering and PDF author print preferences (PrintPreferences)
- SecurityAudit - Delphi, C++Builder, and Lazarus read-only risk-surface samples for permissions, attachments, JavaScript actions, URI / Launch links, web links, signatures, XFA state, V8 / XFA helper availability, and TXT / JSON audit reports
- Attachment - Create PDFs, add / list / extract / delete / save embedded file attachments with MIME subtype display
- ImageToPDF - Delphi, C++Builder, and Lazarus image batch conversion into one PDF, one image per page, with preview and per-image progress
The Delphi, C++Builder, and Lazarus regression suites cover 147 (Pas) / 123 (C++) cases sharing the same fixture PDFs so behaviour stays byte-aligned across all three IDE families
Platform Support
- Delphi - Delphi XE5 (RAD Studio XE5) through Delphi 13.1 Florence (RAD Studio 13.1)
- C++Builder - C++Builder XE5 (RAD Studio XE5) through C++Builder 13.1 Florence
- Lazarus - Free Pascal / Lazarus support
- Win32 / Win64 - Both 32-bit and 64-bit Windows platforms
Page-aligned comparison detects inserted, deleted and moved pages, with resource-limited Unicode text changes and several visual regions; overlays allow these differences to be exported
Transactional navigation merging keeps outline hierarchy, styles, URI actions and remapped destinations when selected pages are imported or reordered
Optional Tesseract OCR makes scanned pages searchable, with explicit dependency diagnostics, cancellation support and resource allowances
Transactional AcroForm merging of selected pages offers explicit naming policies and isolated resources; the optional barcode backend generates Code128, QR, DataMatrix and PDF417 and recognises greyscale images