PDFium Delphi Component Docs

FPdfStandardsExecution 单元

Enterprise 版:本单元随 Lib\Enterprise 交付,由 FPdfEnterprise 与 PDFiumPasEnt / PDFiumLazEnt 包链接;参见版本矩阵

供格式专用验证器之上的标准工作流使用的执行、修复、映射、验证和有界处理原语

经过审阅的层次规划

TPdfTagCaptionPrefixes= array of WideString;
  TPdfAutoTagHierarchyOptions= record
    MaxNodes, MaxTextCharacters, MaxHeadingCharacters: Integer;
    BodyFontSize, Heading1Ratio, Heading2Ratio, Heading3Ratio: Double;
    ParagraphGapRatio, ParagraphIndentRatio, CaptionGapRatio: Double;
    InferHeadings, GroupParagraphs, InferCaptions: Boolean;
    CaptionPrefixes: TPdfTagCaptionPrefixes;
    class function Default: TPdfAutoTagHierarchyOptions; static;
  end;

function BuildPdfUa2HierarchyPlan(const Objects: TPdfAutoTagObjects;
  const Options: TPdfAutoTagHierarchyOptions;
  MinimumConfidence: Double= 0.5): TPdfAutoTagNodes;

BuildPdfUa2HierarchyPlan 接受任意输入顺序和唯一的页面/对象身份,每个符合条件的对象恰好保留一次,并且父节点排在子节点之前

FontSize 是可选的正数提示;为零时回退到对象高度,BodyFontSize 为零时从中位符合条件文本大小估计正文大小

默认值:MaxNodes 100000、MaxTextCharacters 1048576、MaxHeadingCharacters 160、BodyFontSize 0、标题比例 1.8/1.5/1.2、ParagraphGapRatio 0.8、ParagraphIndentRatio 1.5、CaptionGapRatio 2

InferHeadings、GroupParagraphs 和 InferCaptions 默认为 True,插图说明前缀为 Figure 和 Fig.;说明文字要求相邻存在已描述的 Figure,并成为其 Caption 子节点

标题和说明文字的置信度至多 0.75,段落容器至多 0.8;MinimumConfidence 用于过滤输入并抑制较弱的启发式补充

硬上限为 1000000 个源对象/节点、16777216 个文本字符、4096 个标题字符、32 个非空说明前缀和合计 4096 个前缀字符

标题比例必须在 1.01 到 100 之间递减;正文大小为 0 到 1000000,段落间距为 0 到 10,缩进/说明比例为 0 到 100

几何、字体提示、比例、重复身份和扩展节点预算都会被校验;这些启发式结果需要人工审阅,不能确立阅读顺序或 PDF/UA 的正确性

异常与枚举

TypeValues or purpose
EPdfStandardsExecution在输入无效、超出限制、转换失败或执行状态不受支持时引发的异常
TPdfMeasureFormatKindpmfkDecimal, pmfkFraction, pmfkPercentage
TPdfAutoTagObjectKindpatokText, patokImage, patokPath, patokForm, patokAnnotation
TPdfHistoricalEvidenceKindphekCertificate, phekOcsp, phekCrl
TPdfEInteractiveIssues包含 peiiExternalMultimedia、peiiAnnotationFlags、peiiMissingAppearance、peiiUnsupportedU3d、peiiEncryption、peiiInvalidSignature 和 peiiDocMdp 的集合

测量与地理空间类型

TypePublic members
TPdfMeasureNumberFormatUnitLabel, ConversionFactor, FormatKind, Precision, FractionDenominator, Prefix, Suffix
TPdfMeasureNumberFormatsTPdfMeasureNumberFormat 的动态数组
TPdfMeasurementPropertiesRatio, X, Y, D, A, T, V, CY
TPdfGeoPointX, Y
TPdfGeoViewportPageIndex, Left, Bottom, Right, Top, Lpts, Gpts, CoordinateSystem
TPdfGeoViewportsTPdfGeoViewport 的动态数组
TPdfGeoViewportIndexes视口索引的动态数组

FPdfDocumentRepair 为自动安全与元数据修复提供内置的文档执行器,并把审阅过的自动打标签计划应用到受支持的既有文档;其余修复类别仍需要各自的提供器

PDF/A 修复与文本语义类型

TypePublic members
IPdfARepairExecutorCaptureSnapshot, ApplyStep, Validate, RestoreSnapshot
TPdfARepairExecutionReportAppliedSteps, SkippedSteps, RolledBack, ValidationPassed, ErrorText
TPdfTextRepairItemPageIndex, ObjectIndex, FontName, ExtractedText, HasEmbeddedFont, HasToUnicode, HasActualText
TPdfTextRepairItemsTPdfTextRepairItem 的动态数组
TPdfTextRepairResultPageIndex, ObjectIndex, FontRepaired, ToUnicodeRepaired, ActualTextRepaired, PreservedPixels, ErrorText
TPdfTextRepairResultsTPdfTextRepairResult 的动态数组
IPdfTextSemanticsRepairProviderRepair

PDF/UA 标记与表单修复类型

TypePublic members
TPdfAutoTagObjectPageIndex, ObjectIndex, Kind, Left, Bottom, Right, Top, Text, AlternateText, Confidence, FontSize
TPdfAutoTagObjectsTPdfAutoTagObject 的动态数组
TPdfAutoTagNodePageIndex, ObjectIndex, ParentIndex, Mcid, RoleName, Artifact, Confidence
TPdfAutoTagNodesTPdfAutoTagNode 的动态数组
TPdfUaFormFieldPageIndex, AnnotationIndex, FieldName, Tooltip, Contents, TabOrder
TPdfUaFormFieldsTPdfUaFormField 的动态数组
TPdfUaFormRepairPageIndex, AnnotationIndex, LabelText, TooltipText, ContentsText, StructRole, TabOrder, Confidence
TPdfUaFormRepairsTPdfUaFormRepair 的动态数组

外部配置文件与历史证据类型

TypePublic members
IPdfExternalProfileResolverResolve
TPdfExternalProfileRequestUri, ExpectedSha256, Colourants, MaxBytes
TPdfExternalProfileResultProfile, Sha256, ComponentCount, IsMulticolour
TPdfHistoricalEvidenceKind, Data, ProducedAt, ThisUpdate, NextUpdate
TPdfHistoricalEvidenceArrayTPdfHistoricalEvidence 的动态数组
TPdfHistoricalVriSignatureContents, EvidenceIndexes
TPdfHistoricalVrisTPdfHistoricalVri 的动态数组
TPdfHistoricalEvidenceReportValidEvidence, InvalidEvidence, VriOwnershipValid, ErrorText
IPdfHistoricalEvidenceValidatorValidate

PDF/VT、PDF/E 与 PDF/R 类型

TypePublic members
TPdfDPartMetadataName, Value
TPdfDPartMetadataArrayTPdfDPartMetadata 的动态数组
TPdfDPartRecordObjectNumber, PageStart, PageEnd, GtsXid, GtsScope, Metadata
TPdfDPartRecordsTPdfDPartRecord 的动态数组
TPdfDPartQueryName, Value, MaxResults
TPdfDPartQueryResults匹配记录索引的动态数组
TPdfEInteractiveFactsAllMultimediaEmbedded, AnnotationFlagsValid, AppearancesPresent, U3dVersionSupported, EncryptionAllowed, SignaturesValid, DocMdpAllowsChanges
TPdfRasterStripInfoWidth, Height, BytesPerPixel, RowStride, Generation, PageObjectNumber, ImageObjectNumber, ContentStreamCount, HasInheritedResources
TPdfRasterStripReportRowsCopied, PeakBufferBytes, BytesCopied

顶层例程

RoutineDescription
ConvertPdfMeasurement对测量值应用选定的转换因子
FormatPdfMeasurement使用配置的前缀、单位标签和后缀格式化十进制、分数和百分比值
PdfPageToGeo通过 GeoPDF 视口把页面点映射为地理坐标
PdfGeoToPage把地理坐标映射回 GeoPDF 页面视口
QueryPdfGeoViewports返回与页面和点匹配的视口索引
ExecutePdfARepairPlan在快照下执行自动修复步骤,并在某个步骤或验证失败时回滚
RepairPdfTextSemantics通过调用方提供方协调有界的字体、ToUnicode 和 ActualText 修复
BuildPdfUa2AutoTagPlan构建经置信度过滤的阅读顺序、角色、Artifact 和 MCID 决策
BuildPdfUa2FormRepairPlan构建表单标签、工具提示、结构角色、Tab 键顺序和置信度值
ResolvePdfXExternalProfile获取有界的外部 ICC 数据并验证期望的 SHA-256 值
ValidatePdfHistoricalEvidence检查证书、OCSP、CRL、时间窗口和 VRI 归属证据
QueryPdfDParts执行有界的 DPM 元数据查询
BuildPdfDPartResourceCacheKey为 DPart 记录构建稳定的、感知作用域的资源缓存键
ValidatePdfEInteractiveFacts报告独立的多媒体、注释、U3D、加密、签名和 DocMDP 失败项
StreamPdfRasterStrip在严格的调用方内存上限下复制完整的 PDF/R 行