PDFium Delphi Component Docs

FPdfStandardsExecution unit

Enterprise edition: this unit ships in Lib\Enterprise and is linked by FPdfEnterprise and the PDFiumPasEnt / PDFiumLazEnt packages; see the edition matrix

Execution, repair, mapping, validation and bounded-processing primitives used by the standards workflows above the format-specific validators

Reviewed hierarchy planning

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 takes the input in any order along with unique page/object identities, keeps every eligible object exactly once, and puts parents before children

FontSize is an optional positive hint; zero falls back on object height, and a BodyFontSize of zero estimates the body size from the median eligible text size

Defaults are MaxNodes 100000, MaxTextCharacters 1048576, MaxHeadingCharacters 160, BodyFontSize 0, heading ratios 1.8/1.5/1.2, ParagraphGapRatio 0.8, ParagraphIndentRatio 1.5 and CaptionGapRatio 2

InferHeadings, GroupParagraphs and InferCaptions default to True, with Figure and Fig. prefixes; captions call for an adjacent described Figure and become its Caption child

Headings and captions carry a confidence of no more than 0.75 and paragraph containers no more than 0.8; MinimumConfidence filters the input and holds back weaker heuristic additions

Hard limits stand at 1000000 source objects/nodes, 16777216 text characters, 4096 heading characters, 32 nonempty caption prefixes and 4096 prefix characters altogether

Heading ratios must descend, within 1.01 through 100; body size runs 0 through 1000000, paragraph gap 0 through 10, and indent/caption ratios 0 through 100

Geometry, font hints, ratios, duplicate identities and expanded node budgets are all validated; these heuristics call for review and establish neither reading-order nor PDF/UA correctness

Exceptions and enumerations

TypeValues or purpose
EPdfStandardsExecutionException raised for invalid inputs, exceeded limits, failed conversions and unsupported execution states
TPdfMeasureFormatKindpmfkDecimal, pmfkFraction, pmfkPercentage
TPdfAutoTagObjectKindpatokText, patokImage, patokPath, patokForm, patokAnnotation
TPdfHistoricalEvidenceKindphekCertificate, phekOcsp, phekCrl
TPdfEInteractiveIssuesSet containing peiiExternalMultimedia, peiiAnnotationFlags, peiiMissingAppearance, peiiUnsupportedU3d, peiiEncryption, peiiInvalidSignature and peiiDocMdp

Measurement and geospatial types

TypePublic members
TPdfMeasureNumberFormatUnitLabel, ConversionFactor, FormatKind, Precision, FractionDenominator, Prefix, Suffix
TPdfMeasureNumberFormatsDynamic array of TPdfMeasureNumberFormat
TPdfMeasurementPropertiesRatio, X, Y, D, A, T, V, CY
TPdfGeoPointX, Y
TPdfGeoViewportPageIndex, Left, Bottom, Right, Top, Lpts, Gpts, CoordinateSystem
TPdfGeoViewportsDynamic array of TPdfGeoViewport
TPdfGeoViewportIndexesDynamic array of viewport indexes

FPdfDocumentRepair supplies a built-in document executor for automatic security and metadata repair and applies reviewed auto-tag plans to supported existing documents; other repair categories still require their own providers

PDF/A repair and text-semantics types

TypePublic members
IPdfARepairExecutorCaptureSnapshot, ApplyStep, Validate, RestoreSnapshot
TPdfARepairExecutionReportAppliedSteps, SkippedSteps, RolledBack, ValidationPassed, ErrorText
TPdfTextRepairItemPageIndex, ObjectIndex, FontName, ExtractedText, HasEmbeddedFont, HasToUnicode, HasActualText
TPdfTextRepairItemsDynamic array of TPdfTextRepairItem
TPdfTextRepairResultPageIndex, ObjectIndex, FontRepaired, ToUnicodeRepaired, ActualTextRepaired, PreservedPixels, ErrorText
TPdfTextRepairResultsDynamic array of TPdfTextRepairResult
IPdfTextSemanticsRepairProviderRepair

PDF/UA tagging and form-repair types

TypePublic members
TPdfAutoTagObjectPageIndex, ObjectIndex, Kind, Left, Bottom, Right, Top, Text, AlternateText, Confidence, FontSize
TPdfAutoTagObjectsDynamic array of TPdfAutoTagObject
TPdfAutoTagNodePageIndex, ObjectIndex, ParentIndex, Mcid, RoleName, Artifact, Confidence
TPdfAutoTagNodesDynamic array of TPdfAutoTagNode
TPdfUaFormFieldPageIndex, AnnotationIndex, FieldName, Tooltip, Contents, TabOrder
TPdfUaFormFieldsDynamic array of TPdfUaFormField
TPdfUaFormRepairPageIndex, AnnotationIndex, LabelText, TooltipText, ContentsText, StructRole, TabOrder, Confidence
TPdfUaFormRepairsDynamic array of TPdfUaFormRepair

External profile and historical-evidence types

TypePublic members
IPdfExternalProfileResolverResolve
TPdfExternalProfileRequestUri, ExpectedSha256, Colourants, MaxBytes
TPdfExternalProfileResultProfile, Sha256, ComponentCount, IsMulticolour
TPdfHistoricalEvidenceKind, Data, ProducedAt, ThisUpdate, NextUpdate
TPdfHistoricalEvidenceArrayDynamic array of TPdfHistoricalEvidence
TPdfHistoricalVriSignatureContents, EvidenceIndexes
TPdfHistoricalVrisDynamic array of TPdfHistoricalVri
TPdfHistoricalEvidenceReportValidEvidence, InvalidEvidence, VriOwnershipValid, ErrorText
IPdfHistoricalEvidenceValidatorValidate

PDF/VT, PDF/E, and PDF/R types

TypePublic members
TPdfDPartMetadataName, Value
TPdfDPartMetadataArrayDynamic array of TPdfDPartMetadata
TPdfDPartRecordObjectNumber, PageStart, PageEnd, GtsXid, GtsScope, Metadata
TPdfDPartRecordsDynamic array of TPdfDPartRecord
TPdfDPartQueryName, Value, MaxResults
TPdfDPartQueryResultsDynamic array of matching record indexes
TPdfEInteractiveFactsAllMultimediaEmbedded, AnnotationFlagsValid, AppearancesPresent, U3dVersionSupported, EncryptionAllowed, SignaturesValid, DocMdpAllowsChanges
TPdfRasterStripInfoWidth, Height, BytesPerPixel, RowStride, Generation, PageObjectNumber, ImageObjectNumber, ContentStreamCount, HasInheritedResources
TPdfRasterStripReportRowsCopied, PeakBufferBytes, BytesCopied

Top-level routines

RoutineDescription
ConvertPdfMeasurementApplies the selected conversion factor to a measurement value
FormatPdfMeasurementFormats decimal, fractional and percentage values with the configured prefix, unit label and suffix
PdfPageToGeoMaps a page point through a GeoPDF viewport into geographic coordinates
PdfGeoToPageMaps geographic coordinates back into a GeoPDF page viewport
QueryPdfGeoViewportsReturns viewport indexes matching a page and point
ExecutePdfARepairPlanExecutes automatic repair steps under a snapshot and rolls back when a step or validation fails
RepairPdfTextSemanticsCoordinates bounded font, ToUnicode and ActualText repairs through a caller provider
BuildPdfUa2AutoTagPlanBuilds confidence-filtered reading-order, role, artifact and MCID decisions
BuildPdfUa2FormRepairPlanBuilds form labels, tooltips, structure roles, tab order and confidence values
ResolvePdfXExternalProfileRetrieves bounded external ICC data and verifies the expected SHA-256 value
ValidatePdfHistoricalEvidenceChecks certificate, OCSP, CRL, time-window and VRI ownership evidence
QueryPdfDPartsEvaluates bounded DPM metadata queries
BuildPdfDPartResourceCacheKeyBuilds a stable scope-aware resource cache key for a DPart record
ValidatePdfEInteractiveFactsReports independent multimedia, annotation, U3D, encryption, signature and DocMDP failures
StreamPdfRasterStripCopies complete PDF/R rows under a strict caller memory ceiling