PDFium Delphi Component Docs

PDF standards helper units

These units expose the stream-level injectors, validators, signing operations and support records used by the corresponding TPdf convenience methods

Use them when a workflow already owns source and destination streams or needs validation options and result details that are independent of a TPdf instance

FPdfPdfCommon

FunctionPurpose
AnsiCountDictKeyTokensCounts one decoded name key at the top level of a raw PDF dictionary whilst skipping nested values, strings and comments
TPdfParserResourceBudgetDefines process-wide recursion, token, object, decoded-byte, expansion-ratio, allocation and deadline limits; Default returns the library defaults
ConfigurePdfParserResourceBudgetValidates and atomically replaces the process policy used by later custom parser operations
GetPdfParserResourceBudgetReturns a thread-safe value snapshot of the current process policy
ResetPdfParserResourceBudgetRestores the default process policy
PdfParserStartTick, PdfParserDeadlineReachedProvide wrap-safe deadline checkpoints for custom parser implementations

FPdfAssocFiles

procedure InjectAssociateFiles(Source: TStream; Dest: TStream; const Options: TAssocFilesOptions);

Public typePurpose
TPdfAFRelationshipISO 32000-2 AFRelationship values afSource, afData, afAlternative, afSupplement, afUnspecified, afEncryptedPayload, afFormData and afTemplate, including the PDF 2.0 additions
TAssociateFileOne associated file with FileName, Description, payload Content, Relationship and optional MIMEType
TAssocFilesOptionsAssociated-file Files list and catalog or page TargetPage, with defaults from TAssocFilesOptions.Default
EPdfAssocFilesErrorRaised by InjectAssociateFiles when the source has no readable trailer or catalog, or when TargetPage is negative or does not name a page in page-tree order; the destination stream is left unmodified

FPdfPades

FunctionPurpose
InjectPadesDssMarkersAdds DSS certificate, OCSP, CRL and VRI material through an incremental update
RenewPadesArchiveTimestampAppends a document timestamp and reports the resulting archive level and timestamp metadata
ValidatePadesCompliance, ValidatePadesTrustValidate top-level signature-entry cardinality, exact ByteRange and Contents-token exclusion, cryptographic integrity, trust, revocation and timestamp evidence
AnalyzePadesSignatureRevisionsClassifies later revisions, object changes, FieldMDP effects and modification risks
BuildPadesEvidenceReport, BuildPadesEvidenceReportBytesBuild bounded multi-signature evidence from a stream or an existing immutable source-byte capture
EvaluatePadesSignatureAlgorithm, InspectPadesSignatureAlgorithmInspect CMS and certificate algorithm parameters and evaluate their supported security status, applying the PDF 2.0 elliptic-curve profile and the ETSI TS 119 312 RSA signature suites
VerifyCmsAlgorithmProtectionChecks the CMS algorithm-protection signed attribute against the signer digest and signature algorithms
SignPadesBytesAppends a local PAdES signature with optional RFC 3161 timestamping
PreparePadesRemoteSignature, CompletePadesRemoteSignaturePrepare and complete a bound fixed-width remote-signing placeholder workflow
SavePadesRemoteSigningRequest, LoadPadesRemoteSigningRequestPersist or restore the request metadata required to complete remote signing

Public PAdES types

AreaTypes
Levels and validationTPadesLevel (plUnknown, plNone, plB_B, plB_T, plB_LT, plB_LTA), TPadesValidationIssue, TPadesValidationIssues, TPadesValidationSourceStatus (pvssUnavailable, pvssOriginalBytes, pvssIncomplete), TPadesValidationResult
CryptographyTPadesCryptoStatus (pcsNotChecked, pcsValid, pcsInvalid, pcsUnsupported, pcsIndeterminate), TPadesSignatureAlgorithmFamily (psafUnknown, psafRsa, psafEcdsa, psafEd25519, psafEd448), TPadesSignatureAlgorithmInfo, TPadesSignatureValidation, TPadesSignatureValidations
Trust validationTPadesTrustNetworkPolicy (ptnpOffline, ptnpOnline), TPadesTrustValidationStage, TPadesTrustValidationProgress, TPadesTrustValidationProgressEvent, TPadesTrustValidationOptions, TPadesTrustValidationAsyncStatus, TPadesTrustValidationCompletion, TPadesTrustValidationReply
Revision analysisTPadesRevisionAnalysisStatus (prasNotChecked, prasNoLaterChanges, prasAllowed, prasDisallowed, prasSuspicious, prasIndeterminate), TPadesRevisionDecision (prdAllowed, prdDisallowed, prdSuspicious, prdIndeterminate), TPadesFieldMdpAction (pfmaNone, pfmaAll, pfmaInclude, pfmaExclude, pfmaUnknown), TPadesRevisionChangeKind, TPadesRevisionRisk, TPadesRevisionRisks, TPadesFieldNames, TPadesRevisionObjectChange, TPadesRevisionObjectChanges, TPadesSignatureRevisionAnalysis, TPadesSignatureRevisionAnalyses, TPadesRevisionAnalysisReport
Evidence reportsTPadesHashStrings, TPadesObjectNumbers, TPadesEvidenceReportOptions, TPadesEvidenceMaterialKind, TPadesValidationMaterialEvidence, TPadesValidationMaterialEvidences, TPadesVriEvidence, TPadesVriEvidences, TPadesSignatureEvidence, TPadesSignatureEvidences, TPadesEvidenceReport
DSS and archive timestampsTPadesDssMaterial, TPadesDssMaterials, TPadesDssIndexes, TPadesDssVri, TPadesDssVris, TPadesDssOptions, TPadesArchiveTimestampOptions, TPadesArchiveTimestampReport
SigningTPadesSeedValueConstraint, TPadesSeedValueConstraints, TPadesSignatureFieldOptions, TPadesSignOptions, TPadesRemoteSignOptions, TPadesRemoteByteRange, TPadesRemoteSigningRequest

TPadesValidationResult provides the archive Level, the Issues set, SourceStatus, IntegrityStatus and the per-signature Signatures array, with IsCompliant, IsCompliantAt, IsCryptographicallyValid and DocTimeStampCount counting Document Time-stamp dictionaries; option records provide a static Default initialiser

TPadesSignatureAlgorithmInfo reports Family, DigestAlgorithmOid, SignatureAlgorithmOid, PublicKeyAlgorithmOid, CurveOid, DigestParametersPresent, DigestParameterBits, SignatureParametersPresent, PublicKeyParametersPresent, PublicKeyParametersAreNamedCurve and PolicyStatus; TPadesSignatureValidation adds IsDocumentTimeStamp, CoveredRevisionLength, the ByteRangeStatus, CmsSignatureStatus, AlgorithmPolicyStatus, SigningCertificateStatus, CertificateTrustStatus, QualifiedTrustStatus, RevocationStatus, TimeStampStatus, TimeStampSignatureStatus, TimeStampTrustStatus and TimeStampRevocationStatus verdicts, NativeSignatureError, NativeTrustError, SignerCertificateSha256, CertificateChainSha256 and the nested AlgorithmInfo and QualifiedTrust evidence

TPadesTrustValidationStage walks ptvsStarting, ptvsReadingSource, ptvsParsingSignatures, ptvsCryptographicIntegrity, ptvsCertificateChain, ptvsAiaRetrieval, ptvsOcspRetrieval, ptvsCrlRetrieval, ptvsTimestampToken and ptvsCompleted; TPadesTrustValidationProgress carries Stage, SignatureIndex, SignatureCount and Percent; TPadesTrustValidationOptions selects the NetworkPolicy, CheckRevocation, CheckTimeStamps, UrlRetrievalTimeoutMs, QualifiedTrustEvaluator, CancellationToken and OnProgress; TPadesTrustValidationAsyncStatus is ptvasSuccess, ptvasCancelled, or ptvasFailure, and TPadesTrustValidationCompletion returns the async Status, Validation, ErrorMessage, ErrorClassName and CancellationReason

TPadesRevisionChangeKind classifies prckCrossReference, prckSignature, prckValidationMaterial, prckFormField, prckAnnotation, prckPageContent, prckDocumentStructure, prckMetadata, prckActiveContent, prckDeletedObject, prckCompressedObject and prckUnknown; TPadesRevisionRisk spans prrMalformedRevisionChain, prrDuplicateObjectDefinition, prrUnreferencedObjectDefinition, prrSignatureObjectRedefined, prrPageContentChanged, prrDocumentStructureChanged, prrActiveContentAdded, prrFieldMdpUnresolved, prrCompressedObjectUnresolved, prrCoveredRevisionNotFound and prrResourceLimitExceeded

TPadesRevisionObjectChange reports RevisionIndex, ObjectNumber, Generation, Offset, ObjectStreamNumber, ObjectStreamIndex, Kind, Decision, IsAuthoritative and IsRedefinition; TPadesSignatureRevisionAnalysis adds SignatureIndex, SignatureObjectNumber, CoveredRevisionLength, CoveredRevisionIndex, DocMdpPermission, FieldMdpAction, FieldNames, LaterRevisionCount, Status, Risks and Changes; TPadesRevisionAnalysisReport aggregates SourceStatus, RevisionCount, SignatureCount, Status, Risks, Signatures and ErrorMessage

TPadesEvidenceMaterialKind selects pemkCertificate, pemkOcsp, or pemkCrl; TPadesValidationMaterialEvidence reports Kind, ObjectNumber, StoredLength and Sha256 for each stored stream; TPadesVriEvidence is keyed by Key and ObjectNumber and lists CertificateObjectNumbers, OcspObjectNumbers and CrlObjectNumbers

TPadesSignatureEvidence captures SignatureIndex, SignatureObjectNumber, IsDocumentTimeStamp, SubFilter, ByteRangeA, ByteRangeB, ByteRangeC, ByteRangeD, ContentsSha256, VriKey, SignaturePolicyOid, CommitmentTypeOid, HasMatchingVri, VriEvidenceIndex, TimeStampTokenSha256, TimeStampPolicyOid, TimeStampGenTime, TimeStampNonce, NativeFactsAvailable, NativeReason, NativeTime, NativeDocMdpPermission and the nested Validation and Revision

TPadesEvidenceReport aggregates SourceLength, PdfiumSignatureCount, DssCertificateCount, DssOcspCount, DssCrlCount, DssVriCount, StoredValidationBytes, IsTruncated, Validation, RevisionAnalysis, Signatures, ValidationMaterials and VriEntries, bounded by TPadesEvidenceReportOptions with TrustOptions, MaxSourceBytes, MaxSignatures, MaxRevisionChangesPerSignature, MaxValidationMaterials, MaxStoredValidationBytes and MaxVriEntries

TPadesDssMaterial stores one DerBytes certificate, OCSP or CRL payload; TPadesDssVri selects document-level material through SignatureContents, CertIndexes, OcspIndexes and CrlIndexes; TPadesDssOptions accepts Certs, Ocsps, Crls, Vris, EsicExtensionLevel and IncludeVri; TPadesArchiveTimestampOptions carries TsaUrl, Nonce, ContentsSize, UpdateDss and the nested DssOptions; TPadesArchiveTimestampReport reports SourceLevel, ResultLevel, PreviousDocTimeStampCount, ResultDocTimeStampCount, SourceLength, ResultLength, DssUpdated, GenTime, PolicyOid and Nonce

TPadesSeedValueConstraint constrains psvcFilter, psvcSubFilter, psvcVersion, psvcReasons, psvcLegalAttestation, psvcAddRevocationInfo or psvcDigestMethod; TPadesSignatureFieldOptions constrains FieldName, RequiredSeedValues, Reasons, LegalAttestations, AcceptableCertificates, CertificateRequired, LockAction, LockFields and CertificationPermission; TPadesSignOptions carries CertificateThumbprint, PaddingScheme, Reason, LegalAttestation, Location, ContactInfo, Name, SigningTimeUtc, CommitmentTypeOid, ContentsSize, Level, TsaUrl, Nonce, the SignaturePolicyOid, SignaturePolicyHash, SignaturePolicyUri and SignaturePolicyDocument group, and nested FieldOptions; TPadesRemoteSignOptions mirrors the remote-safe subset Reason, LegalAttestation, Location, ContactInfo, Name, SigningTimeUtc, CommitmentTypeOid, ContentsSize and FieldOptions; TPadesRemoteSigningRequest binds FormatVersion, PreparedFingerprint, DocumentDigest, ByteRange, ContentsHexOffset and ContentsSize

TPadesTrustValidationOptions.QualifiedValidationTime selects the trusted-list service-history evaluation time, with zero selecting the current time

TPadesSignatureValidation also carries RevocationReason: TPdfCmsRevocationReason, NativeRevocationError: Cardinal, TimeStampRevocationReason: TPdfCmsRevocationReason and NativeTimeStampRevocationError: Cardinal. Signature diagnostics come from its detached CMS check; timestamp diagnostics come from the attached token check, Document Time-stamps included, and never stand in for the signature's own diagnostics

Reasons fall back to pcrrNone and native errors to zero when revocation is disabled or the corresponding CMS check is never reached. These defaults do not establish success; inspect RevocationStatus and TimeStampRevocationStatus. ValidatePadesTrustAsync preserves these fields in its completion result, and TPadesSignatureEvidence.Validation retains them for TPadesEvidenceReport.ToJson and ToCsv

The diagnostic fields are appended to the public TPadesSignatureValidation record, enlarging it. Rebuild applications and packages that exchange this record, or records containing it, against the updated units; previously compiled binaries do not share the new record layout

FPdfPdfa

procedure InjectPdfAMarkers(Source: TStream; Dest: TStream; const Options: TPdfASaveOptions);
function ValidatePdfACompliance(Source: TStream): TPdfAValidationResult;
function ReadPdfAInfoFieldPresence(const PdfData: TBytes): TPdfAMetadataFields;
function ComparePdfAInfoAndXmp(const Info: TPdfAMetadataValues; Packet: TPdfXmpPacket): TPdfAMetadataReport;
function SynchronizePdfAInfoToXmp(const Info: TPdfAMetadataValues; Packet: TPdfXmpPacket): TPdfAMetadataFields;

Public typePurpose
TPdfAConformanceDetected or requested PDF/A part and conformance level
TPdfAValidationIssue, TPdfAValidationIssuesIndividual preflight findings and their set representation
TPdfANameArrayString list used by name-based validation findings
TPdfAMetadataField, TPdfAMetadataFieldsThe eight ISO 19005-1 Table 1 Info-to-XMP mappings (pamfTitle, pamfAuthor, pamfSubject, pamfKeywords, pamfCreator, pamfProducer, pamfCreationDate, pamfModDate) and their set representation
TPdfAMetadataValuesUnicode Info values Title, Author, Subject, Keywords, Creator, Producer, CreationDate and ModDate with key presence tracked by Present independently from empty text
TPdfAMetadataState, TPdfAMetadataComparison, TPdfAMetadataComparisons, TPdfAMetadataReportTyped per-field equivalence evidence with states pamsNotRequired, pamsEquivalent, pamsXmpMissing, pamsXmpTypeMismatch, pamsValueMismatch, pamsInvalidInfoDate, pamsInvalidXmpDate, per-field Field, State, InfoValue, and XmpValue, report-level HasXmpPacket, XmpParseError, MismatchFields and the Comparisons array, and aggregate status
TPdfAValidationResultConformance, the Issues set and IsCompliant result
TPdfASaveOptionsMetadata, identifiers, ICC profile bytes in IccProfileData, output intent and conformance settings with Default values

InjectPdfAMarkers uses sparse latest-revision lookup and bounded source copying for valid classic, xref-stream, hybrid and object-stream layouts, whilst retaining the compatibility parser for unsupported or malformed cross-reference data

The incremental revision preserves root and Info generations, source xref style, trailer identifiers, encryption refusal behaviour, and Level A downgrade semantics

FPdfPdfe

procedure InjectPdfEMarkers(Source: TStream; Dest: TStream; const Options: TPdfESaveOptions);
function ValidatePdfECompliance(Source: TStream): TPdfEValidationResult;

Public typePurpose
TPdfEConformanceDetected or requested PDF/E conformance
TPdfEValidationIssue, TPdfEValidationIssuesPDF/E structural and content findings, including top-level AcroForm /XFA and indirect /NeedAppearances true; ordinary AcroForm fields and embedded engineering assets remain permitted
TPdfEValidationResultConformance, the Issues set and IsCompliant result
TPdfESaveOptionsPDF/E Version, metadata, document identifiers and defaults

FPdfPdfr

FunctionPurpose
InjectPdfRMarkersWrites PDF/R identification and restricted catalog and Info structures
ValidatePdfRComplianceValidates a stream with the default raster-document limits
ValidatePdfRComplianceWithOptionsValidates a stream with caller-selected resolution, geometry, strip and encryption requirements
ValidatePdfRPageFactsValidates already-collected page geometry, object counts, image characteristics and filters

Public types are TPdfRConformance, TPdfRValidationIssue, TPdfRValidationIssues, TPdfRValidationResult with its Issues set and IsCompliant result, TPdfRStringArray, TPdfRValidationOptions, TPdfRPageFacts, and TPdfRSaveOptions

TPdfRValidationOptions tunes MinimumResolutionDpi, MaximumResolutionDpi, GeometryTolerancePoints, RequireFullPageStrip and RequireEncryptedPdf20Profile; TPdfRSaveOptions carries StripInfoOptionalEntries and StripCatalogOptionalEntries to clear source Info or catalog entries that §6.4.3 or the §6.3 white list would otherwise reject; TPdfRPageFacts records PageNumber, MediaWidth, MediaHeight, the ImageLeft, ImageBottom, ImageRight and ImageTop bounds, ImageCount, TextObjectCount, PathObjectCount, FormObjectCount and ShadingObjectCount, raster geometry PixelWidth, PixelHeight, HorizontalDpi, VerticalDpi and BitsPerPixel, plus ColorSpace and the Filters chain for each page

FPdfPdfua

FunctionPurpose
InjectPdfUaMarkersAdds PDF/UA identification, language, title, MarkInfo, viewer preference and XMP markers
ValidatePdfUaComplianceValidates PDF/UA-1 or PDF/UA-2 markers and structure, optionally using original bytes for XMP checks
PdfUaIsStandardStructTypeTests a structure type name against the ISO standard set, including numbered headings
PdfReadRoleMapPairsExtracts direct or indirect RoleMap keys and values into parallel arrays

Public types are TPdfUaConformance, TPdfUaValidationIssue, TPdfUaValidationIssues, TPdfUaValidationResult with its Issues set and IsCompliant result, TPdfUaSaveOptions, and TPdfUaNameArray

The PDFium unit also exposes TPdfUaLanguageSource, TPdfUaLanguageContentKind, TPdfUaLanguageResolution, TPdfUaLanguageSpan, TPdfUaLanguageSpans, TPdfUaLanguageCoverageOptions and TPdfUaLanguageCoverageReport for bounded effective-language evidence

TPdfUaUnicodeObjectCoverage, TPdfUaUnicodeObjectCoverages, TPdfUaUnicodeCoverageOptions and TPdfUaUnicodeCoverageReport provide bounded object-scoped direct Unicode and ActualText extraction evidence

ValidatePdfUaPageContentTagging cross-checks native page-object marks against page-scoped structure MCIDs and reports both untagged real content and Artifact content exposed in the structure tree

TPdfUaSaveOptions.Default selects PDF/UA-1 defaults, whilst TPdfUaSaveOptions.PdfUa2 selects the PDF/UA-2 profile

TPdfUaSaveOptions carries DocumentTitle, Language, the Author, Subject, Keywords, Creator and Producer metadata, CreationDate and ModDate, the DocumentId and InstanceId UUIDs, the Part, Revision, Amd and Corr identifiers, and the EnsureMarkInfo and EnsureDisplayDocTitle switches to inject the required catalog entries when the source lacks them

FPdfPdfvt

procedure InjectPdfVTMarkers(Source: TStream; Dest: TStream; const Options: TPdfVTSaveOptions);
function ValidatePdfVTCompliance(Source: TStream): TPdfVTValidationResult;
function ReadPdfVTDPartEvidence(Source: TStream): TPdfVTDPartEvidence;

Public typePurpose
TPdfVTConformance, TPdfVTTrappedStatePDF/VT conformance and inherited PDF/X trapped-state selection across ptvUnspecified, ptvTrue and ptvFalse, with ptvUnspecified normalised to ptvFalse at write time
TPdfVTValidationIssue, TPdfVTValidationIssues, TPdfVTValidationResultValidation findings, the Issues set, conformance and IsCompliant result
TPdfDpmEntry, TPdfDpmEntries, TDpmTargetDocument Part Metadata entries with Name, Value and IsNestedDict, placed at the dptRoot or dptLeaf target
TPdfVTDPartEvidenceBounded document-part hierarchy and printing-condition evidence with PageCount, RecordLevel and RecipientRecordCount
TPdfVTSaveOptionsPDF/X base, ICC profile bytes in IccProfileData, output intent through OutputCondition, OutputConditionIdentifier, RegistryName and OutputIntentInfo, Trapped state, metadata, identifiers, DPart, DPM through DpmEntries placed by DpmTarget, and default settings

FPdfPdfx

procedure InjectPdfXMarkers(Source: TStream; Dest: TStream; const Options: TPdfXSaveOptions);
function ValidatePdfXCompliance(Source: TStream): TPdfXValidationResult;

Public typePurpose
TPdfXConformance, TPdfXTrappedStatePDF/X variant and Info dictionary trapped-state selection across ptUnspecified, ptTrue, ptFalse and ptUnknown, with ptUnspecified omitting the entry
TPdfXValidationIssue, TPdfXValidationIssues, TPdfXValidationResultValidation findings, the Issues set, conformance and IsCompliant result
TPdfXSaveOptionsConformance, ICC profile bytes in IccProfileData, output intent through OutputCondition, OutputConditionIdentifier, RegistryName and OutputIntentInfo, Trapped state, metadata, identifiers and defaults

Policy for RSA-PSS parameters

TPadesRsaPssParameters provides Valid, HashAlgorithmOid, MaskGenAlgorithmOid, MaskGenHashAlgorithmOid, SaltLength and TrailerField; CMS and SPKI restrictions are reported separately by TPadesSignatureAlgorithmInfo.SignaturePss and PublicKeyPss

InspectPadesSignatureAlgorithm requires CMS PSS parameters but accepts an empty SEQUENCE using RFC defaults; it refuses malformed DER, duplicate or out-of-order explicit fields, unsupported integer encodings and oversized parameter blocks

EvaluatePadesSignatureAlgorithm checks that the CMS digest agrees with the PSS hash; a PSS-only key refuses PKCS #1 v1.5, and restricted keys require matching hash, MGF hash and trailer plus a signature salt no shorter than the key minimum

Another supported MGF1 hash may be valid; unknown algorithms are Unsupported, weak MGF hashes Indeterminate and broken hashes Invalid

Parameter blocks cannot exceed 16 KiB, and salt/trailer values must be nonnegative 32-bit integers; this structural policy adds to the crypto backend checks but establishes neither RSA key strength nor EMSA-PSS signature validity

When assembling algorithm evidence yourself, set SignaturePss and SignatureParametersPresent; the PSS OID alone is insufficient

Related API

The TPdf.SaveAsPdfA, SaveAsPdfE, SaveAsPdfR, SaveAsPdfUa, SaveAsPdfVT, SaveAsPdfX and PAdES methods provide document-instance wrappers around these units