PDFium Component Docs

CreationDate Egenskap

Denna API-post behåller identifierare, signaturer, kodblock och PDF-termer i ursprunglig form.
Komponent: TPdf  ·  Enhet: PDFium
Original creation timestamp from the document Info dictionary.

Syntax

property CreationDate: WString; // read only

Beskrivning

CreationDate returns the /CreationDate post från dokumentets informationsordbok (PDF 1.7-specifikationens avsnitt 14.3.3) som den råa PDF-datlitteralen. Värdet formateras som D:YYYYMMDDHHmmSSOHH'mm' — for example D:20231201090000Z for 09:00 UTC on 1 December 2023, or D:20260514103015+08'00' for 10:30:15 in UTC+08:00 (PDF 1.7 spec section 7.9.4).

The string is empty when Active is False, när dokumentet inte deklarerar någon Info-ordbok, eller när ingen /CreationDate entry was written. Most authoring tools record this timestamp at the moment the PDF is first produced and then leave it untouched; ModifiedDate reflects later edits. Comparing CreationDate to ModifiedDate is a quick way to identify whether a PDF has been edited since its initial export.

Parsing the date string requires stripping the D: prefix, decoding the fixed-width fields, then interpreting the trailing timezone offset (the apostrophe is part of the literal syntax). PDFiumPas exposes the raw text so callers can apply their preferred conversion: build a TDateTime, formatera med språkspecifika regler eller mata in i ett regex-/parsersteg som hanterar de olika trunkeringar som producenter använder.

Anmärkningar

Exempel

var Created, Modified: WString;
Created := Pdf1.CreationDate;
Modified := Pdf1.ModifiedDate;
if (Created <> '') and (Created <> Modified) then
  Log.Add('Document edited since creation');

Se även

ModifiedDate, Author, Producer, MetaText