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建置經信心篩選的閱讀順序、角色、成品與 MCID 決策
BuildPdfUa2FormRepairPlan建置表單標籤、工具提示、結構角色、定位順序與信心值
ResolvePdfXExternalProfile擷取有界的外部 ICC 資料,並驗證預期的 SHA-256 值
ValidatePdfHistoricalEvidence檢查憑證、OCSP、CRL、時間窗與 VRI 擁有權證據
QueryPdfDParts評估有界的 DPM 中繼資料查詢
BuildPdfDPartResourceCacheKey為 DPart 記錄建置穩定且感知範圍的資源快取索引鍵
ValidatePdfEInteractiveFacts分別回報多媒體、註解、U3D、加密、簽章與 DocMDP 的失敗
StreamPdfRasterStrip在嚴格的呼叫端記憶體上限下複製完整的 PDF/R 列