PDF File Comments (original) (raw)
The following comments are supported for PDF files:
Value | Meaning |
---|---|
CMNT_SZARTIST | [0] Person who created the image. Corresponds to the Author key in Document Information dictionary. |
CMNT_SZSOFTWARE | [9] Name and version of software package used to create the PDF file. |
If you are using the nag version of LTKRN, this comment is fixed and cannot be changed. Corresponds to the Producer key in the Document Information dictionary. | |
CMNT_SZTITLE | [175] Title of the image. |
CMNT_SUBJECT | [263] Subject of the document. This will sometimes have entries that are also in CMNT_KEYWORDS. |
CMNT_KEYWORDS | [264] Keywords, separated by comma or semicolon. Note that the space characters (if present), are part of the keyword. |
CMNT_CREATOR | [265] The name of the application that created the original file used as a source for the PDF file. |
CMNT_CREATIONDATE | [266] Date and time the file was originally created (YYYY-MM-DDTHH:MM:SS[+/-hh:mm]). |
CMNT_MODIFICATIONDATE | [267] Date and time of the last file modification (YYYY-MM-DDTHH:MM:SS[+/-hh:mm]). |
The PDF comments come from the Document Information Dictionary stored in the Info PDF object. The object is optional and there is only one such object per file. Therefore, all the pages in the PDF file will have the same comments.
The two date comments (CMNT_CREATIONDATE
and CMNT_MODIFICATIONDATE
) have an optional "+/-hh:mm" suffix indicating the local time zone. The suffix will either be +hh:mm
or -hh:mm
, depending on whether the local time is ahead or behind UTC. For example:
- A document created on January 30, 2022 at 2:33 PM (EST time) would have
CMNT_CREATIONDATE
set to 2022-01-30T14:33:00-05:00. That is because EST is 5 hours behind UTC and the daylight savings time is not in effect in January. - A document created in August at the same location should show 2022-08-30T14:33:00-04:00. In August, the suffix would be -04:00 because daylight savings time is in effect, and EST is only 4 hours behind UTC.
- If the document was created in UTC time or the timezone is unknown, the time offset suffix might be missing altogether. A document created at the same time in a UTC time zone would show a date of 2022-08-30T14:33:00
CMNT_CREATOR
and CMNT_SZSOFTWARE
seem a bit confusing because they both seem to represent the name of the software that created the PDF file. But they are slightly different. For example, if the PDF file was created by converting a DOCX file created in Microsoft Word, then:
- CMNT_CREATOR should be set to "Microsoft Word x.y"
- CMNT_SZSOFTWARE should be set to "PDF Creator v.w"
This information can also be obtained using L_ReadFileMetaDataItems or L_ExtractXMPMetadata.
See Also
Functions
LEADTOOLS Raster Imaging C API Help