Skip to content
Math Solves Everything
  • Matlab
  • Math
  • Linear Algebra
  • Calculus
  • Tex/LaTex
  • GIS

[Tex/LaTex] How to generate PDF metadata from LaTeX

metadatamiktexpdfpdftex

I am writing a document using LaTeX and generating PDF. Can anybody tell me how I can generate the PDF metadata, e.g. author or title, from LaTeX? On Windows XP, I am using MikTex's texify to generate the PDF. On linux, I am using pdflatex to generate the PDF. Any answers for either platform would be much appreciated!

Best Answer

Use the hyperref package, included in pretty much every latex distribution these days.

\usepackage[pdftex,
            pdfauthor={Your Name},
            pdftitle={The Title},
            pdfsubject={The Subject},
            pdfkeywords={Some Keywords},
            pdfproducer={Latex with hyperref, or other system},
            pdfcreator={pdflatex, or other tool}]{hyperref}

Related Solutions

[Tex/LaTex] Image quality of pdf file generated from latex

Try \usepackage{lmodern}. When you switch to the T1 encoding, the only available fonts (I assume) for your distribution are the bitmap Computer Modern fonts (caveat: I'm simplifying). Loading the Latin Modern fonts will fix that — they are largely identical in appearance.

[Tex/LaTex] 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.

Related Question
  • [Tex/LaTex] Missing Author and Keywords in PDF Metadata when creating PDF/A using pdfx