As I understand it, embedding (as metadata) the typesetting engine that was used to produce a PDF document is good practice.
Here is an example of how this can be done using the hyperref
package:
\hypersetup{pdfcreator={pdflatex 1.40.14}}
However, hardcoding this information is error-prone. What if, between now and the final version of my document, I decide to switch typesetting engine, or what if a new version gets released, and I forget to update the metadata?
If possible, I'd like to avoid hardcoding the typesetting engine (name and version) used… Is there an easy way of accessing that information during a run of that engine on my tex
file?
Best Answer
pdfTeX
The TeX compiler pdfTeX already sets some keys as default:
Some of these entries can be overwritten via
\pdfinfo
or via\hypersetup
ifhyperref
is loaded. A nice feature of pdfTeX is, that if it detects the setting of standard keys in\pdfinfo
, then pdfTeX suppresses its setting to avoid duplicate keys in the same dictionary with different values. Therefore it is possible for the user orhyperref
to override the setting of pdfTeX.The default of
hyperref
's values are (line breaks added for better readability):Also the other entries can be set by
hyperref
(pdfcreationdate
,pdfmoddate
, ...)Version number of pdfTeX
Since the version number scheme of pdfTeX has changed in the past, the algorithm for the versions specification is quite complex, from
hpdftex.def
:Other drivers
Package
hyperref
also sets information entries with the other drives. But it can happen, that the driver insists of its setting for some of the keys (/Creator
, ...).