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);
int DLSetInformationA(int InstanceID, int Key, const char* NewValue);
Parameters
| Key | The 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 |
|---|---|
| NewValue | The 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 that field alone, even when other fields point at the same string or stream object; the automatic ModDate update made during saving leaves a shared CreationDate value intact
AppendToFile, AppendToStream, AppendToString and SaveChanges do not update ModDate automatically when the document holds signature fields, so that the update does not count as a change to the document against its signatures; a ModDate set here is written as usual
Initialising XMP for an information update or an automatic save timestamp preserves existing XMP properties and custom namespaces, XML without an xpacket wrapper included; the same synchronisation is available in Windows Free Pascal builds
Return values
| 0 | The specified information could not be set. Use the LastErrorCode function to determine the reason for failure |
|---|---|
| 1 | The specified information was set successfully |