PDFium Delphi Component Docs

FPdfProduction unit

Bounded production workflows for graphics, document content, interactive packages, and embedded media

Exception and enumerations

DeclarationValues or purpose
EPdfProductionException raised for invalid production input, exhausted safety budgets, unsupported operations, and rejected backend output
TPdfColourSpacepcsDeviceGray, pcsDeviceRGB, pcsDeviceCMYK, pcsICCBased, pcsSeparation, pcsDeviceN
TPdfSvgPathCommandKindspcMoveTo, spcLineTo, spcCubicTo, spcQuadraticTo, spcClosePath
TPdfReplacementModeprmNativeTextObject, prmRedactAndRelayout
TPdfBarcodeKindpbkCode128, pbkQr, pbkDataMatrix, pbkPdf417
TPdfPortfolioFieldTypeppftText, ppftNumber, ppftDate, ppftFileName, ppftDescription, ppftSize, ppftModDate, ppftCreationDate

Colour conversion declarations

The optional LittleCMS backend implements buffer transformation; FPdfDocumentColour uses it for original document operators and image components, reporting completeness explicitly

DeclarationPublic fields or members
TPdfColourBufferSpace: TPdfColourSpace, Components: Integer, BitsPerComponent: Integer, Samples: TBytes, IccProfile: TBytes
TPdfOutputIntentIdentifier: string, RegistryName: string, Info: string, Components: Integer, IccProfile: TBytes
TPdfColourConversionOptionsMaxInputBytes: Integer, MaxOutputBytes: Integer, PreserveOnFailure: Boolean, class function Default: TPdfColourConversionOptions
TPdfColourConversionReportConverted: Boolean, PreservedOriginal: Boolean, InputBytes: Integer, OutputBytes: Integer, ErrorMessage: string

Font and SVG declarations

DeclarationPublic fields or members
TPdfGlyphInfoGlyphID: Cardinal, UnicodeValue: Cardinal, Width: Integer
TPdfGlyphInfosDynamic array of TPdfGlyphInfo
TPdfFontSubsetOptionsMaxFontBytes: Integer, MaxGlyphs: Integer, MinimumSavingPercent: Integer, class function Default: TPdfFontSubsetOptions
TPdfFontSubsetReportApplied: Boolean, PreservedOriginal: Boolean, GlyphCount: Integer, OriginalBytes: Integer, SubsetBytes: Integer, ErrorMessage: string
TPdfSvgPathCommandKind: TPdfSvgPathCommandKind, Values: array[0..5] of Double
TPdfSvgPathCommandsDynamic array of TPdfSvgPathCommand

Styled replacement and XFA declarations

DeclarationPublic fields or members
TPdfStyledSpanPageIndex: Integer, ObjectIndex: Integer, CharacterStart: Integer, Text: WideString, StyleID: Integer
TPdfStyledSpansDynamic array of TPdfStyledSpan
TPdfRegexMatchStartIndex: Integer, Length: Integer, Replacement: WideString
TPdfRegexMatchesDynamic array of TPdfRegexMatch
TPdfStyledReplacementMode: TPdfReplacementMode, PageIndex: Integer, FirstObjectIndex: Integer, LastObjectIndex: Integer, FirstCharacter: Integer, CharacterCount: Integer, Replacement: WideString, StyleID: Integer, LastPageIndex: Integer
TPdfStyledReplacementsDynamic array of TPdfStyledReplacement
TPdfXfaBindingSomPath: string, Value: string
TPdfXfaBindingsDynamic array of TPdfXfaBinding

Barcode and Portfolio declarations

DeclarationPublic fields or members
TPdfBarcodeRectLeft: Double, Top: Double, Right: Double, Bottom: Double
TPdfBarcodeRectsDynamic array of TPdfBarcodeRect
TPdfBarcodeResultKind: TPdfBarcodeKind, Text: string, Bounds: TPdfBarcodeRect, Confidence: Double
TPdfBarcodeResultsDynamic array of TPdfBarcodeResult
TPdfPortfolioFieldName: string, DisplayName: string, FieldType: TPdfPortfolioFieldType, Order: Integer, Visible: Boolean, Editable: Boolean
TPdfPortfolioFieldsDynamic array of TPdfPortfolioField
TPdfPortfolioValueFieldName: string, Value: string
TPdfPortfolioValuesDynamic array of TPdfPortfolioValue
TPdfPortfolioItemFileName: string, Description: string, Values: TPdfPortfolioValues, EmbeddedData: TBytes
TPdfPortfolioItemsDynamic array of TPdfPortfolioItem
TPdfPortfolioFields: TPdfPortfolioFields, Items: TPdfPortfolioItems, SortField: string, SortAscending: Boolean

RichMedia declarations

DeclarationPublic fields
TPdfRichMediaAssetName: string, MimeType: string, Data: TBytes, IsExternal: Boolean, ActivationCondition: string, DefaultView: string
TPdfRichMediaAssetsDynamic array of TPdfRichMediaAsset
TPdfRichMediaExtractedName: string, MimeType: string, Size: Int64, Sha256: string
TPdfRichMediaExtractedArrayDynamic array of TPdfRichMediaExtracted

Backend interfaces

InterfaceMethodPurpose
IPdfColourTransformfunction Transform(const Source: TPdfColourBuffer; TargetSpace: TPdfColourSpace; const TargetProfile: TBytes; out Target: TPdfColourBuffer): BooleanConverts a validated source buffer to the requested colour space and profile
IPdfFontSubsetBackendfunction Subset(const FontProgram: TBytes; const Glyphs: TPdfGlyphInfos; out SubsetProgram: TBytes): BooleanBuilds a font program containing the requested glyph closure
IPdfRegexEnginefunction FindMatches(const Text, Pattern, Replacement: WideString; MaxMatches: Integer): TPdfRegexMatchesReturns bounded regular-expression matches and replacement text
IPdfBarcodeProviderfunction Generate(Kind: TPdfBarcodeKind; const Text: string; ModuleSize: Double; out Rects: TPdfBarcodeRects): BooleanGenerates barcode module rectangles for a supported symbology
function Recognise(const Pixels: TBytes; Width, Height, Stride: Integer; MaxResults: Integer): TPdfBarcodeResultsRecognises bounded barcode results from a caller-owned pixel buffer

Default option factories

MemberPurpose
class function TPdfColourConversionOptions.Default: TPdfColourConversionOptionsReturns bounded colour conversion defaults with source preservation enabled
class function TPdfFontSubsetOptions.Default: TPdfFontSubsetOptionsReturns bounded font and glyph limits with a minimum saving threshold

Top-level routines

SignatureDescription
function ConvertPdfColourBuffer(const Source: TPdfColourBuffer; TargetSpace: TPdfColourSpace; const TargetProfile: TBytes; Transform: IPdfColourTransform; const Options: TPdfColourConversionOptions; out Target: TPdfColourBuffer; out OutputIntent: TPdfOutputIntent; out Report: TPdfColourConversionReport): BooleanRuns a colour buffer through a caller transform and builds matching OutputIntent data whilst preserving the source on failure
function SubsetExistingPdfFont(const FontProgram: TBytes; const UsedGlyphs: TPdfGlyphInfos; Backend: IPdfFontSubsetBackend; const Options: TPdfFontSubsetOptions; out ResultProgram: TBytes; out GlyphClosure: TPdfGlyphInfos; out Report: TPdfFontSubsetReport): BooleanBuilds a sorted unique glyph closure and accepts a subset only when it is valid and smaller
function ParsePdfSvgPath(const Data: string; MaxCommands: Integer = 100000): TPdfSvgPathCommandsParses bounded move, line, cubic, quadratic, and close commands with relative-coordinate support
function ExportPdfSvgPath(const Commands: TPdfSvgPathCommands): stringSerialises path commands to absolute SVG path syntax
procedure TransformPdfSvgPath(var Commands: TPdfSvgPathCommands; A, B, C, D, E, F: Double)Applies an affine matrix to every coordinate in a parsed SVG path
function BuildStyledRegexReplacementPlan(const Spans: TPdfStyledSpans; const Pattern, Replacement: WideString; Engine: IPdfRegexEngine; MaxCharacters: Integer = 16 * 1024 * 1024; MaxMatches: Integer = 100000): TPdfStyledReplacementsMaps regular-expression matches back to styled page-object spans and selects native or redaction-based replacement
function MergePdfXfaDatasets(const Packets: TXfaPacketList; const Bindings: TPdfXfaBindings; MaxPacketBytes: Integer = 32 * 1024 * 1024): TXfaPacketListMerges escaped SOM leaf bindings whilst preserving every untouched XFA packet
function RewritePdfXfaPacketStreams(Source, Destination: TStream; const Packets: TXfaPacketList; MaxTotalPacketBytes: Int64 = 256 * 1024 * 1024): BooleanAppends transactionally replaced XFA packet streams to an unencrypted PDF
function GeneratePdfBarcode(Kind: TPdfBarcodeKind; const Text: string; ModuleSize: Double; Provider: IPdfBarcodeProvider = nil): TPdfBarcodeRectsGenerates built-in Code 128-B vectors and delegates two-dimensional symbologies to a provider
function RecognisePdfBarcodes(const Pixels: TBytes; Width, Height, Stride: Integer; Provider: IPdfBarcodeProvider; MaxResults: Integer = 256): TPdfBarcodeResultsDelegates barcode recognition whilst enforcing image geometry and result bounds
procedure ValidatePdfPortfolio(const Portfolio: TPdfPortfolio; MaxItems: Integer = 100000; MaxEmbeddedBytes: Int64 = 1024 * 1024 * 1024)Validates field definitions, values, item counts, and embedded payload budgets
procedure SortPdfPortfolio(var Portfolio: TPdfPortfolio)Creates a deterministic Collection view using the configured sort field and direction
function ExtractPdfRichMediaAssets(const Assets: TPdfRichMediaAssets; const OutputDirectory: string; MaxAssetBytes: Int64 = 256 * 1024 * 1024; MaxTotalBytes: Int64 = 1024 * 1024 * 1024): TPdfRichMediaExtractedArrayWrites embedded assets without executing content, resolving external references, or permitting directory escape

FPdfBarcodeZXing offers an optional provider for barcode generation and recognition

Safety model

All high-volume APIs enforce caller-visible limits before allocating or writing output

Platform codecs, colour engines, font subsetters, regular-expression engines, matrix barcode libraries, and recognisers are explicit interfaces so hosts can select their audited backend

FPdfStyledEdit applies these plans to a checked source snapshot, with previews, native-font reuse or explicit fallback, limited fitting and transactional save/reopen checks