Adding custom metadata values to a PDF file

Package hyperref

Package hyperref supports the setting of arbitrary keys in the PDF information dictionary (see manual):

\documentclass{article}
\usepackage{hyperref}

\hypersetup{
  pdfinfo={
    RecordOffice={my office},
    AccessionNumber={42},
  }
}

\begin{document}
Hello World.
\end{document}

However, these keys are not standardized, thus most tools will not show them. But you can extract them via a PDF library.

Package hyperxmp

The PDF format also supports XMP (eXtensible Metadata Platform). More keywords are standardized there. See package hyperxmp of Scott Pakin.


There is also pdfx package. Here you have to add metadata as a separate .xmp file.

\documentclass{article}

\usepackage{lipsum}
\usepackage[a-1b]{pdfx}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.xmpdata}
\Keywords{pdfTeX\sep PDF/X-1a\sep PDF/A-b} 
\Title{Sample LaTeX input file} 
\Author{LaTeX project team} 
\Org{TeX Users Group}
\Doi{123456789} 
\end{filecontents*}
\begin{document}
\lipsum

\end{document}

Tags:

Pdf

Metadata