TPDFlibEntCompliance

Editions

Description

TPDFlibEntCompliance (unit PDFlibEntCompliance) descends from TPDFlibSmallBusiness and is the first Enterprise feature class of the chain. It implements the Enterprise methods for compliance work: PDF/A conversion, PDF/A, PDF/UA and Arlington validation, validation pipelines over a file, a stream or a memory buffer, preflight and validation reports, audit evidence with its signed envelopes, and the Arlington model.

It belongs to the Enterprise edition, which includes every Small Business class as well. TPDFlibEntRedact descends from it and adds the next feature group.

Syntax

Delphi

TPDFlibEntCompliance = Class(TPDFlibSmallBusiness);

Key members

CreateAuditEvidenceAudits the file InputFileName against the policy PolicyJSON and returns the single-file JSON evidence object
CreateAuditEvidenceBatchAudits the files of the JSON request RequestJSON against the policy PolicyJSON and returns the JSON batch envelope with one evidence object per file
CompareAuditEvidenceCompares the evidence objects OldJSON and NewJSON and returns the JSON that separates the source, policy and library version changes and the checks that differ
SignAuditEvidenceSigns the evidence object EvidenceJSON with the identity in PFXFileName, opened with PFXPassword, and the digest DigestAlgorithm; returns the signed envelope as JSON
VerifyAuditEvidenceEnvelopeVerifies the envelope EnvelopeJSON against the trust policy TrustPolicyJSON and returns the verification result as JSON
ConvertToPDFAConverts the selected document to the PDF/A target TargetMode with the whole-page transparency fidelity policy and 300 DPI, on a private copy; the converted document replaces the selected one when it passed the implemented PDF/A checks
ConvertToPDFAExConverts the selected document to the PDF/A target TargetMode with the explicit transparency fidelity policy FidelityPolicy and the raster resolution DPI
GetPDFAConversionReportReturns the report the last ConvertToPDFA or ConvertToPDFAEx call left: what the conversion did and what still stands in the way
CheckFilePDFUAComplianceOpens a validation pipeline over the file and runs the PDF/UA reader task TargetPart (0 to 4) on it; returns the handle of the issue list, or 0 when no finding was reported
RunPDFUAValidationPipelineTaskRuns the PDF/UA reader validation TargetPart (0 to 4) with Options against the parsed document of the pipeline; returns the handle of the issue list, or 0 when no finding was reported
GetPDFUAReadValidationCoverageJSONReturns the coverage statement of the PDF/UA reader checks for the target part TargetPart (0 to 4)
GetWCAGMappingJSONReturns the static JSON cross-reference of the PDF/UA rules to the WCAG success criteria
GetPDFAReadValidationCoverageJSONReturns the coverage statement of the PDF/A read checks for the target mode TargetMode (0 to 11)
CheckFileComplianceValidates the file against the standard that ComplianceTest selects, one of PDF/A, PDF/UA, PDF/X, PDF/VT, PDF/R, PDF/VCR and PDF/E; the value 8 is run as a task of a validation pipeline. Returns the handle of the issue list, or 0 when no finding was reported
BeginValidationPipelineOpens the file InputFileName as a validation pipeline and returns its ID
BeginValidationPipelineFromStreamOpens the caller-owned stream Source as a validation pipeline without taking ownership of the stream, and returns its ID
BeginValidationPipelineFromBufferOpens the ByteCount bytes at Buffer as a validation pipeline, copied when CopyBuffer is True, and returns its ID
RunValidationPipelineTaskRuns the compliance audit ComplianceTest (1 to 8) with Options against the parsed document of the pipeline; returns the handle of the issue list, or 0 when no finding was reported
CreateValidationPipelineReportRuns the PDF/A and PDF/UA checks selected by ComplianceTests on the pipeline and returns the combined structured report in the format ReportFormat selects
GetValidationPipelineParseCountReturns how many initial PDF parses the pipeline performed
ReleaseValidationPipelineReleases the pipeline with the validation context it holds; returns 1
LoadArlingtonModelCreates the Arlington model from the definition files in ModelDirectory, keeps it in the instance and returns its model ID
GetArlingtonModelDefinitionCountReturns the number of object definitions of the loaded model ModelID
GetArlingtonModelRuleCountReturns the number of rules of the loaded model ModelID
GetArlingtonValidationCoverageJSONReturns the coverage of the most recent Arlington validation; before the first one it returns a JSON object with the status not-checked
ValidateArlingtonSyntaxOpens the file as a pipeline, validates its object syntax with the model and releases the pipeline; returns the handle of the issue list, or 0 when no finding was reported
ValidateArlingtonPipelineSyntaxValidates the object syntax of the parsed document of the pipeline with the model and records the coverage; returns the handle of the issue list, or 0 when no finding was reported
ReleaseArlingtonModelReleases the model and invalidates its ID; returns 1
CreatePreflightReportBuilds the plain-text preflight report for the file from the PDF/A and PDF/UA checks that ComplianceTests selects
CreatePreflightReportExBuilds the preflight report and converts it to the format ReportFormat selects: 1 JSON, 2 HTML, 3 CSV and any other value plain text
SavePreflightReportBuilds the plain-text preflight report and writes it to ReportFileName as UTF-8 without a byte order mark
SavePreflightReportExBuilds the preflight report in the format ReportFormat selects and writes it to ReportFileName as UTF-8 without a byte order mark
ComparePreflightReportsCompares the two text reports line by line and returns the diff
CreateValidationReportBuilds the structured PDF/A and PDF/UA validation report for the file in the format ReportFormat selects and returns it
SaveValidationReportBuilds the structured validation report and writes it to ReportFileName as UTF-8 without a byte order mark
VerifyConvertedPDFUAProtected override that ConvertToPDFUA and ConvertToPDFUAEx call after a conversion to check the converted bytes against PDF/UA for the target mode; ComplianceIssues receives the issues

Remarks

The pipeline methods share one parsed document: a BeginValidationPipeline* method returns the pipeline ID, RunValidationPipelineTask, RunPDFUAValidationPipelineTask and CreateValidationPipelineReport work on that document, and ReleaseValidationPipeline frees it. CheckFilePDFUACompliance and ValidateArlingtonSyntax open and release a pipeline of their own in one call.

ConvertToPDFA and ConvertToPDFAEx convert a private snapshot of the selected document. The converted document replaces the selected one only when it passed the implemented PDF/A checks; otherwise the original is retained and GetPDFAConversionReport says why. A valid target mode is 1 to 11, a fidelity policy 0 to 2 and a resolution 36 to 1200 DPI.

VerifyConvertedPDFUA is declared in the Protected section. When it fails after a conversion, the conversion is rejected, LastErrorCode is set to 409 and the original document is retained.

Applications normally create TPDFlibEnterprise and get the methods of this class through them. The same methods on a plain TPDFlib return 0, an empty string or False and set LastErrorCode to PDFLIB_ERROR_ENTERPRISE_REQUIRED. An Enterprise method called on TPDFlibSmallBusiness is rejected the same way, because that edition does not carry it.

See also

TPDFlibSmallBusiness, TPDFlibEntRedact, TPDFlibEnterprise