property ModifiedDate: WString; // read only
ModifiedDate returns the /ModDate entry from the document Information
dictionary (PDF 1.7 spec section 14.3.3) as the raw PDF date literal. PDF stores the
timestamp as a literal date string formatted as
D:YYYYMMDDHHmmSSOHH'mm' — for example
D:20260514103015+08'00' means 14 May 2026 10:30:15 in UTC+08:00. The
D: prefix and trailing apostrophe are part of the literal syntax
(PDF 1.7 spec section 7.9.4).
The string is empty when Active is False, when the
document Info dictionary is missing, or when no /ModDate was written.
Producers update this entry on each save / incremental update; comparing
ModifiedDate with CreationDate is a quick way to detect whether the file
has been edited since the original render.
The returned value is the raw literal, not a parsed TDateTime. Strip
the D: prefix, optional timezone, and trailing apostrophe before calling
EncodeDateTime; alternatively use a regular expression that captures
(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})([+-Z])(\d{2})'(\d{2})'.
+08'00') — not the colon form ISO-8601 uses.D: prefix — the format orders correctly by
lexical comparison up to and including the seconds field.
var Raw: WString;
Raw := Pdf1.ModifiedDate;
if Raw <> '' then
begin
// e.g. "D:20260514103015+08'00'"
Memo1.Lines.Add('Last modified: ' + Raw);
end;