PDFium Component Docs

CreationDate プロパティ

この API エントリでは識別子、シグネチャ、コードブロック、PDF 用語を元の表記のまま保持します。
コンポーネント: TPdf  ·  ユニット: PDFium
Original creation timestamp from the document Info dictionary.

構文

property CreationDate: WString; // read only

説明

CreationDate は文書 Information dictionary から /CreationDate entry を raw PDF date literal として返します (PDF 1.7 spec section 14.3.3)。値は D:YYYYMMDDHHmmSSOHH'mm' 形式で、たとえば 2023-12-01 の 09:00 UTC なら D:20231201090000Z、UTC+08:00 の 10:30:15 なら D:20260514103015+08'00' です (PDF 1.7 spec section 7.9.4)

ActiveFalse のとき、文書に Info dictionary がないとき、または /CreationDate entry が書かれていないときは string は空です。多くの authoring tool はこの timestamp を PDF が最初に生成された時点で記録し、その後は変更しません。ModifiedDate は後の編集を反映します。CreationDate と ModifiedDate を比べると、初回 export 以降に PDF が編集されたかをすばやく判定できます

date string を parse するには、D: prefix を取り除き、固定長 field を decode し、最後の timezone offset を解釈します。apostrophe は literal syntax の一部です。PDFiumPas は raw text を公開するので、caller は好みの変換を適用できます。TDateTime を作る、locale-specific rule で format する、あるいは producer が使うさまざまな truncation に対応した regex / parser に渡す、といった方法です

備考

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

関連項目

ModifiedDate, Author, Producer, MetaText