SetInformation

Document properties

Description

Set the properties of the selected document

For the CreationDate and ModDate (modification date) properties, the format of the date should be:

D:YYYYMMDDHHmmSSOHH'mm'

where

YYYY shall be the year

MM shall be the month (01-12) DD shall be the day (01-31) HH shall be the hour (00-23)

mm shall be the minute (00-59) SS shall be the second (00-59)

O shall be the relationship of local time to Universal Time (UT) using a +, - or Z character

HH followed by APOSTROPHE (U+0027) (') shall be the absolute value of the offset from UT in hours (00-23)

mm followed by an optional APOSTROPHE (U+0027) (') shall be the absolute value of the offset from UT in minutes (00-59)

Syntax

Delphi

Function TPDFlib.SetInformation(Key: Integer; Const NewValue: WideString): Integer;

ActiveX

Function PDFlib::SetInformation(Key As Long, NewValue As String) As Long

DLL

int DLSetInformation(int InstanceID, int Key, const wchar_t * NewValue);

Parameters

KeyThe property to set: 0 = PDF Version 1 = Author 2 = Title 3 = Subject 4 = Keywords 5 = Creator 6 = Producer 7 = CreationDate 8 = ModDate 9 = XMP dc:subject
NewValueThe new value of the specified property

When Key is 0, NewValue selects the full-save PDF target version. For PDF 1.3, 1.4, 1.5, 1.6, and 1.7 targets, SaveToFile, SaveToString, and SaveToStream keep the emitted file within that selected version. If the document still contains a feature that requires a newer PDF version, saving fails and LastErrorCode returns 602

Updating an Info dictionary field replaces only that field, even when other fields reference the same string or stream object; automatic ModDate updates during saving preserve a shared CreationDate value

Initializing XMP for an information update or automatic save timestamp preserves existing XMP properties and custom namespaces, including XML without an xpacket wrapper; the same synchronization is available in Windows Free Pascal builds

Return values

0The specified information could not be set. Use the LastErrorCode function to determine the reason for failure
1The specified information was set successfully