PDFium Delphi Component Docs

FPdfProduction 单元

面向图形、文档内容、交互包和嵌入式媒体的有界生产工作流

异常与枚举

声明取值或用途
EPdfProduction在生产输入无效、安全预算耗尽、操作不受支持或后端输出被拒绝时引发的异常
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

颜色转换声明

可选的 LittleCMS 提供器实现缓冲区转换接口,FPdfDocumentColour 将其应用于原始文档操作符和图像分量,并明确报告是否转换完整

声明公开字段或成员
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

字体与 SVG 声明

声明公开字段或成员
TPdfGlyphInfoGlyphID: Cardinal, UnicodeValue: Cardinal, Width: Integer
TPdfGlyphInfosTPdfGlyphInfo 的动态数组
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
TPdfSvgPathCommandsTPdfSvgPathCommand 的动态数组

保留样式替换与 XFA 声明

声明公开字段或成员
TPdfStyledSpanPageIndex: Integer, ObjectIndex: Integer, CharacterStart: Integer, Text: WideString, StyleID: Integer
TPdfStyledSpansTPdfStyledSpan 的动态数组
TPdfRegexMatchStartIndex: Integer, Length: Integer, Replacement: WideString
TPdfRegexMatchesTPdfRegexMatch 的动态数组
TPdfStyledReplacementMode: TPdfReplacementMode, PageIndex: Integer, FirstObjectIndex: Integer, LastObjectIndex: Integer, FirstCharacter: Integer, CharacterCount: Integer, Replacement: WideString, StyleID: Integer, LastPageIndex: Integer
TPdfStyledReplacementsTPdfStyledReplacement 的动态数组
TPdfXfaBindingSomPath: string, Value: string
TPdfXfaBindingsTPdfXfaBinding 的动态数组

条码与 Portfolio 声明

声明公开字段或成员
TPdfBarcodeRectLeft: Double, Top: Double, Right: Double, Bottom: Double
TPdfBarcodeRectsTPdfBarcodeRect 的动态数组
TPdfBarcodeResultKind: TPdfBarcodeKind, Text: string, Bounds: TPdfBarcodeRect, Confidence: Double
TPdfBarcodeResultsTPdfBarcodeResult 的动态数组
TPdfPortfolioFieldName: string, DisplayName: string, FieldType: TPdfPortfolioFieldType, Order: Integer, Visible: Boolean, Editable: Boolean
TPdfPortfolioFieldsTPdfPortfolioField 的动态数组
TPdfPortfolioValueFieldName: string, Value: string
TPdfPortfolioValuesTPdfPortfolioValue 的动态数组
TPdfPortfolioItemFileName: string, Description: string, Values: TPdfPortfolioValues, EmbeddedData: TBytes
TPdfPortfolioItemsTPdfPortfolioItem 的动态数组
TPdfPortfolioFields: TPdfPortfolioFields, Items: TPdfPortfolioItems, SortField: string, SortAscending: Boolean

RichMedia 声明

声明公开字段
TPdfRichMediaAssetName: string, MimeType: string, Data: TBytes, IsExternal: Boolean, ActivationCondition: string, DefaultView: string
TPdfRichMediaAssetsTPdfRichMediaAsset 的动态数组
TPdfRichMediaExtractedName: string, MimeType: string, Size: Int64, Sha256: string
TPdfRichMediaExtractedArrayTPdfRichMediaExtracted 的动态数组

后端接口

接口方法用途
IPdfColourTransformfunction Transform(const Source: TPdfColourBuffer; TargetSpace: TPdfColourSpace; const TargetProfile: TBytes; out Target: TPdfColourBuffer): Boolean将已验证的源缓冲区转换到请求的色彩空间和配置文件
IPdfFontSubsetBackendfunction Subset(const FontProgram: TBytes; const Glyphs: TPdfGlyphInfos; out SubsetProgram: TBytes): Boolean构建包含请求字形闭包的字体程序
IPdfRegexEnginefunction FindMatches(const Text, Pattern, Replacement: WideString; MaxMatches: Integer): TPdfRegexMatches返回有界的正则表达式匹配和替换文本
IPdfBarcodeProviderfunction Generate(Kind: TPdfBarcodeKind; const Text: string; ModuleSize: Double; out Rects: TPdfBarcodeRects): Boolean为受支持的码制生成条码模块矩形
function Recognise(const Pixels: TBytes; Width, Height, Stride: Integer; MaxResults: Integer): TPdfBarcodeResults从调用方拥有的像素缓冲区识别有界的条码结果

默认选项工厂方法

成员用途
class function TPdfColourConversionOptions.Default: TPdfColourConversionOptions返回启用源保留的有界颜色转换默认值
class function TPdfFontSubsetOptions.Default: TPdfFontSubsetOptions返回带最小节省阈值的有界字体和字形限制

全局函数与过程

函数签名说明
function ConvertPdfColourBuffer(const Source: TPdfColourBuffer; TargetSpace: TPdfColourSpace; const TargetProfile: TBytes; Transform: IPdfColourTransform; const Options: TPdfColourConversionOptions; out Target: TPdfColourBuffer; out OutputIntent: TPdfOutputIntent; out Report: TPdfColourConversionReport): Boolean让颜色缓冲区经过调用方转换,构建匹配的 OutputIntent 数据,并在失败时保留源
function SubsetExistingPdfFont(const FontProgram: TBytes; const UsedGlyphs: TPdfGlyphInfos; Backend: IPdfFontSubsetBackend; const Options: TPdfFontSubsetOptions; out ResultProgram: TBytes; out GlyphClosure: TPdfGlyphInfos; out Report: TPdfFontSubsetReport): Boolean构建排序的唯一字形闭包,并且只在子集有效且更小时接受
function ParsePdfSvgPath(const Data: string; MaxCommands: Integer = 100000): TPdfSvgPathCommands解析有界的移动、直线、三次、二次和闭合命令,并支持相对坐标
function ExportPdfSvgPath(const Commands: TPdfSvgPathCommands): string将路径命令序列化为绝对 SVG 路径语法
procedure TransformPdfSvgPath(var Commands: TPdfSvgPathCommands; A, B, C, D, E, F: Double)对已解析 SVG 路径中的每个坐标应用仿射矩阵
function BuildStyledRegexReplacementPlan(const Spans: TPdfStyledSpans; const Pattern, Replacement: WideString; Engine: IPdfRegexEngine; MaxCharacters: Integer = 16 * 1024 * 1024; MaxMatches: Integer = 100000): TPdfStyledReplacements把正则表达式匹配映射回带样式的页面对象范围,并选择原生或基于涂黑的替换
function MergePdfXfaDatasets(const Packets: TXfaPacketList; const Bindings: TPdfXfaBindings; MaxPacketBytes: Integer = 32 * 1024 * 1024): TXfaPacketList合并转义的 SOM 叶子绑定,同时保留每个未改动的 XFA 包
function RewritePdfXfaPacketStreams(Source, Destination: TStream; const Packets: TXfaPacketList; MaxTotalPacketBytes: Int64 = 256 * 1024 * 1024): Boolean把事务性替换的 XFA 包流追加到未加密 PDF
function GeneratePdfBarcode(Kind: TPdfBarcodeKind; const Text: string; ModuleSize: Double; Provider: IPdfBarcodeProvider = nil): TPdfBarcodeRects生成内置的 Code 128-B 矢量,并把二维码制委托给提供方
function RecognisePdfBarcodes(const Pixels: TBytes; Width, Height, Stride: Integer; Provider: IPdfBarcodeProvider; MaxResults: Integer = 256): TPdfBarcodeResults在强制图像几何和结果边界的前提下委托条码识别
procedure ValidatePdfPortfolio(const Portfolio: TPdfPortfolio; MaxItems: Integer = 100000; MaxEmbeddedBytes: Int64 = 1024 * 1024 * 1024)验证字段定义、值、条目数量和嵌入载荷预算
procedure SortPdfPortfolio(var Portfolio: TPdfPortfolio)使用配置的排序字段和方向创建确定性的 Collection 视图
function ExtractPdfRichMediaAssets(const Assets: TPdfRichMediaAssets; const OutputDirectory: string; MaxAssetBytes: Int64 = 256 * 1024 * 1024; MaxTotalBytes: Int64 = 1024 * 1024 * 1024): TPdfRichMediaExtractedArray写出嵌入资产,不执行内容、不解析外部引用,也不允许目录逃逸

FPdfBarcodeZXing 提供可选的条码生成和识别提供器

安全模型

所有高吞吐 API 都会在分配或写出输出之前强制执行调用方可见的限制

平台编解码器、颜色引擎、字体子集化器、正则表达式引擎、矩阵条码库和识别器都是显式接口,宿主可以选择自己审计过的后端

FPdfStyledEdit 针对已验证的源快照执行这些计划,支持预览、字体复用或显式后备、受限适配,以及事务式保存/重新打开验证