THotPDF.GetLoadedPDFAVersion Method
Returns the PDF/A part and conformance level that a loaded document declares in its XMP metadata, such as PDF/A-1b, PDF/A-2u, PDF/A-4 or PDF/A-4f. For a document being built with PDFACompliance, it returns the profile that will be written
Declaration
function GetLoadedPDFAVersion: AnsiString;
Unit
HPDFDoc
Parameters
| Name | Purpose |
|---|---|
| This member does not expose explicit parameters | |
Return value
PDF/A- followed by the pdfaid:part number and, when present, the pdfaid:conformance letter in lower case. Returns an empty string when the document carries no PDF/A identification
| XMP identification | Result |
|---|---|
pdfaid:part 1, pdfaid:conformance B | PDF/A-1b |
pdfaid:part 2, pdfaid:conformance U | PDF/A-2u |
pdfaid:part 3, pdfaid:conformance A | PDF/A-3a |
pdfaid:part 4, no pdfaid:conformance | PDF/A-4 |
pdfaid:part 4, pdfaid:conformance E or F | PDF/A-4e or PDF/A-4f |
Usage notes
- The identification is read from the catalog
/Metadatastream after its filters are decoded, so compressed packets are handled; open an encrypted file with theLoadFromFileorLoadFromStreamoverload that takes a password so the stream is decrypted first - Both XMP serializations are accepted: child elements such as
<pdfaid:part>2</pdfaid:part>and RDF attribute shorthand such aspdfaid:part="2", in anyrdf:Descriptionof the packet - Properties are matched through the PDF/A identification namespace
http://www.aiim.org/pdfa/ns/id/(or itshttps://spelling), so a packet that binds it to a prefix other thanpdfaidis recognised as well - The result reports what the file declares; it does not validate the file against the declared part. Use
GetLoadedPDFAIssuesfor a structural check - Call
GetLoadedPDFARevisionto read thepdfaid:revedition year, which PDF/A-4 requires (2020) and earlier parts do not define; it returns an empty string when the property is absent IsLoadedPDFAreturns true whenever this method returns a non-empty value