PDFium Component Docs

פונקציית ReadPdfVersionInfo

Unit: FPdfCompress
קוראת הצהרות גרסה ומטא־נתונים של הרחבות מפתחים מזרם PDF ניתן לחיפוש

Syntax

function ReadPdfVersionInfo(Source: TStream; out Info: TPdfVersionInfo; out ErrorText: string): Boolean;

TPdfVersionInfo fields

HeaderVersionVersion from the %PDF-M.m header, encoded as 13 through 17
CatalogVersionVersion from the catalog /Version name when present
CoreVersionEffective core version, always the higher of header and catalog versions
AdobeBaseVersionADBE developer-extension /BaseVersion
AdobeExtensionLevelPositive ADBE /ExtensionLevel
HasCatalogVersionTrue when a valid top-level catalog /Version exists
HasDeveloperExtensionsTrue when the catalog contains a top-level /Extensions dictionary
HasAdobeExtensionTrue when a valid ADBE extension dictionary exists

Description

Returns True only when the header, latest trailer, document catalog and every declared developer-extension entry are structurally readable

The catalog and extension scan follows the current startxref, /Prev and hybrid /XRefStm chain, including active type 2 entries in object streams, while ignoring superseded, freed and unreferenced object bodies

Within one hybrid revision, supplemental /XRefStm entries take precedence over classic compatibility-table placeholders for the same object number

PDF name #xx escapes are decoded during key and value matching, and extension levels must be complete positive integer tokens

The function leaves core-version and developer-extension declarations separate because an extension does not change the ISO core version

Example

Info: TPdfVersionInfo;
ErrorText: string;
if ReadPdfVersionInfo(Stream, Info, ErrorText) then
  Memo1.Lines.Add(Format('PDF 1.%d', [Info.CoreVersion mod 10]));

See Also

TPdf.PdfVersion, TPdf.SaveAs