Skip to content

1.2.1 Metadata

Felix Schütt edited this page Jul 6, 2017 · 5 revisions

We can add various bits of metadata in our document. For this purpose, we have to create an "Info" dictionary and refer to this object in the trailer dictionary to it with the name /Info.

All entries of this dictionary are optional (some are required for PDF standards):

Name Pzurpose Type Example entry Required?
Title Document title String (My holiday journey) yes
Author Document author String (Mr. Bean) no
Subject Keywords for searching String (holiday plans canne) no
Creator The PDF program who created the file String (Adobe Indesign) no
Producer The PDF library who wrote the file String (printpdf v.0.5.0) no
CreationDate When the document was originally created DateString (see below) (D:20170705215328+02'00') yes
ModDate When the document was last modified DateString (D:20170705215328+02'00') yes
Trapped If the document requries trapping Boolean true yes
GTS_PDFXVersion The exact version identifier of the PDF String (PDF/X-3:2002) yes

Es können zwei Zeitstempel angegeben werden:

/CreationDate Erstellungsdatum des Dokuments /ModDate Zeitpunkt der letzten Änderung Zeitstempel werden ebenfalls als String angegeben, es wird aber ein bestimmtes Format erwartet. Der String sollte mit D: beginnen. Danach folgt direkt aneinander gehängt:

die vierstellige Jahreszahl der Monat als zweistellige Zahl (01-12) der Tag als zweistellige Zahl (01-31) die Stunde als zweistellige Zahl (00-23) die Minute als zweistellige Zahl (00-59) die Sekunde als zweistellige Zahl (00-59) Darauf wiederum folgt die Zeitzone. Ist die Zeit in UTC (GMT), so reicht ein einfaches Z. Ansonsten folgt:

ein Plus oder Minus, je nach Art der Abweichung die Stundenabweichung als zweistellige Zahl ein Hochkomma die Minutenabweichung als zweistellige Zahl ein Hochkomma Als Beispiel nehmen wir den 30. Juli 2010 12:00 nach Mitteleuropäischer Sommerzeit (UTC+2):

(D:20100630120000+02'00') (D:20100630100000Z) Bei neuen Dokumenten empfehle ich, beide Felder mit dem aktuellen Datum und der aktuellen Zeit zu bestücken. Manche Programme verwenden diese Informationen, um Dokumente zeitlich zu ordnen. Zudem empfehle ich, die Lokalzeit zu verwenden.

Beispiel

1 0 obj << /Title (Hallo Welt) /Author (Peter Muster) /Subject (Wir begrüssen die Welt) /Keywords (Hallo Welt Beispiel Begrüssung) /Creator (MeinWiki) /Producer (MeinPDFGenerator) /CreationDate (D:20110628115000+02'00') /ModDate (D:20110628115000+02'00')

trailer << /Info 1 0 R ...

Clone this wiki locally