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 use native PDFium, correct LP64 bindings, platform font and file services, and actual bitmap channel layouts; see native setup for the qualified Free Pascal/LCL configurations and capability boundaries
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- Per-feature Availability - See the edition matrix and bounded
QueryPdfFeatureProfilescopes;QueryFeatureStatusandQueryPdfFeaturedistinguish minimum edition, actual implementation linkage, native exports, configured providers and document prerequisites without running the operation- 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 and PDF 2.0
- 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 or PDF 2.0 the writer rejects any dictionary entry, filter, annotation subtype, action type, font, color 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 authorization- 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- Windows Variable Font Defaults -
AddTextcan read an exact installed variable TrueType family's original default-instance program through optional DirectWrite, avoiding GDI substitution and preserving text and rendering through native save-time subsetting in the verified Segoe UI Variable and Bahnschrift profiles- Variable Font Instances -
InstantiatePdfVariableFontpins requested axes and source defaults through optional HarfBuzz, producing static TrueType programs with retained glyph IDs for CID embedding and portable subsetting, including selected TrueType Collection faces- Native Font-program Subsetting -
TPdfHarfBuzzSubsetBackendadds optional retained-ID subsetting and native dependency closure, including verified CBDT/CBLC payload preservation; native PDFium bitmap-font embedding remains a separate unsupported profile- 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, including borders and shaded cells drawn as filled rectangles by word processors, 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 (Small Business and Enterprise editions)- Structured OCR and Reflow -
FPdfOcrLayoutpreserves explicit provider lines, blocks and reviewed tables, adapts legacy word providers, maps optional preprocessing back to source geometry and builds structured text or safe HTML reflow (Small Business and Enterprise editions)- Reviewable OCR Semantics -
TPdfOcrSemanticReviewproposes headings, list markers, simple table/header grids and optional geometric reading order, retains independent source snapshots and provider/reviewer provenance, and requires explicit approval before applying semantics to structured text or HTML reflow (Small Business and Enterprise editions)- Source-bound OCR Objects -
BindPdfOcrReviewedSourceverifies reviewed PDF byte identities and binds accepted OCR words to unique native invisible objects with exact owned text and captured page quadrilaterals, rejecting generated-separator confusion and overlapping duplicates (Small Business and Enterprise editions)- Sentence-Level Reading Units - TPdf.ReadingUnits, TPdf.DocumentReadingUnits, TPdfView.ReadingUnits and BuildReadingUnits expose sentence-sized TPdfReadingUnit records for synchronized 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, colors, 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 color, 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
- Encrypted Typed Form Writes - Permission-checked AESV3 and legacy RC4/AESV2 single and batch transactions retain original credentials and security parameters, with bounded private staging and native candidate verification
- 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;AddJpegImageDeferredandAddJpegImageFileproduce the same XObject but read only the 8 KiB header at insert time and pull the rest of the bytes through the stream at render and save time, so large or numerous scans never land in memory as a whole copy- Picture Support -
AddPictureaccepts aTPictureobject with automatic format conversion through the registered VCL/LCL graphic classes- Direct Image Insertion -
AddImage(FileName)recognizes 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
- Existing-Document Repair -
FPdfDocumentRepairapplies reviewed text, heading, figure, list and table tags with Unicode metadata and header relationships, and supplies a built-in executor for automatic PDF/A security and metadata repairs, with independent output bytes, finite limits and reopen validation (Enterprise edition)- 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- Isolated native workers - FPdfNativeWorker runs a trusted PDF worker in a verified Windows LPAC/job or Free Pascal Linux namespace/seccomp profile, with backend-specific memory and CPU limits, bounded read-only private-profile inventories, native-call deadlines/cancellation, crash recovery, bounded response framing and atomic output publication; the built-in worker inspects, renders BGRA, extracts text and saves unsigned unencrypted documents
- 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 linearized 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 Normalization -
TPdf.SaveAsNormalizedContenttokenizes 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 R2 through 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, grayscale, 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, colors, 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, supports bounded partial geometry and explicit isolated-transparency rasterization, paints opaque replacements, removes embedded attachments and unused sensitive resources, and verifies the selected saved-output composition profile without changing the loaded document (Enterprise edition)- Active-content Sanitisation -
SaveAsSanitisedand both publicSanitiseActiveContentPdfStreamoverloads strip selected active content and prune unreachable bodies; the actual Enterprise implementation must be linked before stream access (Enterprise edition)- Render Options - LCD text optimization (
reLcd), annotations (reAnnotations), grayscale, 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 math 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 Color -
PageColordecouples the rendered PDF page background from the surrounding control'sColor. Default isclWhite, so PDF pages now render as paper-white regardless of the host application's theme. Dark-mode viewers can keep the scroll area dark while leaving the actual PDF page white (or any color the application picks)- 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 behavior.TPdfnow serializes 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 behavior 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 (Enterprise edition)- 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 (Enterprise edition)- 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 (Enterprise edition)- 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 (Enterprise edition)- 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 (Enterprise edition)- LDAP certificate evidence - OpenSSL online verification can retrieve anonymous binary AIA certificates and CRLs through Windows or optional FPC Unix OpenLDAP backends with shared request, payload and timeout budgets; downloaded certificates remain untrusted until chain validation succeeds
- Qualified trust -
TPdfEuropeanTrustedListparses only caller-authenticated ETSI trusted lists, reauthenticates cached XML, accepts caller-owned update sources, and supplies offline qualified-service evaluation throughQualifiedTrustEvaluator(Enterprise edition)- Security Removal - Save documents with security removed (when authorized)
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, grayscale 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 synchronized 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 colors, 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 / PreflightReportCli - 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 (Enterprise edition)- 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 centered 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 (PDF/A and PDF/UA: every edition; PDF/R: Small Business and Enterprise; PDF/X, PDF/E and PDF/VT: Enterprise)
- 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
- WorkflowConsole - Delphi console workflow exercising scan OCR, PDF/R raster transport inspection, two-source semantic review, bounded JSON / HTML manifests, and optional Enterprise cross-workflow evidence (Small Business and Enterprise editions; Enterprise evidence features require Enterprise)
- XfaLab - Delphi and Lazarus static XFA packet inspection and runtime capability detection (optional static XFA-to-AcroForm flattening: Small Business and Enterprise)
The Delphi, C++Builder, and Lazarus regression suites cover 1257 (Pas) / 515 (C++) cases sharing the same fixture PDFs so behavior stays byte-aligned across all three IDE families
Platform Support
- Delphi - Delphi XE5 (RAD Studio XE5) through Delphi 13.2 Florence (RAD Studio 13.2)
- C++Builder - C++Builder XE5 (RAD Studio XE5) through C++Builder 13.2 Florence
- Lazarus - Lazarus 3.8+ with Free Pascal 3.2.2 (default) and 3.3.1
- Win32 / Win64 - Both 32-bit and 64-bit Windows platforms
Since 3.267.0, source-bound semantic review retains comparison selections and effective page mapping; exact-byte PDF/R validation combines raw and native checks on one snapshot, scan HTML streams through node/text/output/depth budgets, and Enterprise HTML evidence exposes the complete JSON operation context
Since 3.268.0, shared reports support caller-owned output streams and Windows artifact manifests, business inputs use spill-capable snapshots, raster diagnostics identify processed pages and their issues, and Enterprise evidence supports typed/read-only operations and stream byte verification
Business document workflows combine owned-input scan processing, structured/reflow outputs, semantic-review JSON/HTML and XFA migration assessment in Small Business; Enterprise adds cross-workflow byte identity and context evidence
Form merge supports repeated selected pages through independent or compatible shared passes, with persistent checkbox/radio states, bounded font matching and reused compatible font objects
Document assets reads and writes Collection schema, typed values, embedded files and presentation settings, and discovers RichMedia resources with page/annotation provenance without executing scripts or retrieving external files
Existing-font optimization combines explicit CIDToGIDMap coverage across shared embedded TrueType programs, preserves composite dependencies and glyph IDs, and reports uncertain resources while producing an actually smaller rebuilt PDF
Existing structure editing changes roles and metadata, inserts containers and reorders nodes while retaining nested Form, annotation and widget references; Enterprise reviewed tagging can supplement unmarked top-level objects in an existing tree while preserving declared ParentTree ownership, annotations and widgets
(Small Business and Enterprise editions) Semantic comparison optionally compares standard document metadata and internal link destinations through mapped page identities, independently of appearance pixels
Aligned comparison identifies inserted, deleted and moved pages, with optional similarity matching for moved-and-modified text pages, bounded Unicode text changes and multiple visual regions; overlays make those changes exportable
Transactional navigation merge retains outline hierarchy, styles, URI actions and remapped page destinations through selected and reordered page imports
Optional Tesseract OCR adds searchable text to scanned pages with explicit dependency diagnostics, cancellation and resource budgets (Small Business and Enterprise editions)
Transactional selected-page AcroForm merging supports explicit name policies and resource isolation; the optional barcode provider generates Code128, QR, DataMatrix and PDF417 and recognizes grayscale images
Reviewed text resource repair embeds supplied TrueType programs, writes explicit ToUnicode and ActualText mappings, isolates shared font descriptors and verifies native persistence and pixels
(Enterprise edition) Concrete document repair providers integrate complete color conversion and reviewed structure edits with exact-byte postvalidation, stable object-identity ordering and cancellation-safe rollback
RTL-only document core provides owned native snapshots, Unicode text, raw BGRA pixels and staged page operations without VCL/LCL or Graphics; TPdf.CreateCoreSnapshot integrates the classic component and pins its native module
Original image component decoding converts DCT/JPX source channels through ICC profiles without a rendered RGB round trip, including bounded JPX sources up to 24-bit precision, embedded or shared colour/opacity channels and four-component CMYK
Styled paragraph reflow measures mixed-style words, wraps inside reviewed bounds, supports left/center/right alignment and verifies saved order, text and pixels
Owned Form paragraph reflow selects local child text explicitly, retains original internal stream and MCR/ParentTree identities, preserves nonselected owned peers and supports separate local/page/structure semantic reviews through repeated full saves
Saved shaped paragraph sources expose actual glyph-style paths and logical line anchors for repeated horizontal Arabic or mixed Hebrew/Arabic/Latin reshaping, preserving source typography and existing mapped structure ownership
Owned paragraph source inspection follows the selected deepest Form and local indexes, sharing the editing workflow's source and structure checks, preserving caller state and reserving the remaining work budget for style and logical-text reads
Styled editing supports independent nested Form instance origins, selected ordinary per-Do child-object batches with bounded nested invocation paths and preserved external semantic ownership, reviewed unique-MCID text with maintained ActualText, and preserved character/word spacing with native pixel checks
Reviewed shared Form structure repair assigns independent streams and ParentTree namespaces to internally tagged page invocations, retaining explicit logical owners, original graphics and structure metadata through full native saves
Internal Form object batches edit qualified unique streams and ordinary containers with owned peers while preserving their original object identities, namespace bindings, complete local declarations and independent shared resources