20

Is there a way to change the properties that are added to PDF docs? For instance, when I go the Properties panel in Acrobat, I see:

Application: LaTeX with hyperref package

PDF Producer: PdfTeX-1.40.11

PTEX.Fullbanner: This is pdfTeX Version 3.1415926-1.40.11-22 (TeX Live 2010)

These are the only ones I see with my version of Acrobat, but there might be more embedded in the PDF.

I am wondering if there are settings to control the values of the properties that are embedded in the PDF doc. I recall a case where Acrobat had embedded the login userid in it, but I don't see that here on my Mac. I would like to customize all these properties, unless of course they are necessary (I am assuming that the list of fonts is required in order to be able to display the PDF properly).

There most likely is a way to do this with Acrobat Pro, but that would require me to do this separately for each file.

2

2 Answers 2

20

There are at least two ways of doing this.


Option 1: During production of the LaTeX document and using the hyperref package. In the manual it mentions you can set the following document property information:

  • Title field (via pdftitle)
  • Author field (via pdfauthor)
  • Subject field (via pdfsubject)
  • Creator field (via pdfcreator)
  • Producer field (via pdfproducer)
  • Keywords field (via pdfkeywords)
  • and many others.

To that effect, you could use

\documentclass{minimal}
\usepackage[%
  pdftitle={My Title},%
  pdfauthor={My Author},%
  pdfsubject={My Subject},%
  pdfproducer={My Producer},%
  pdfkeywords={keyword1,keyword2}]{hyperref}
\begin{document}
  This is just some dummy text.
\end{document}

Option 2: You can modify/update the PDF document properties during post-production via the PDF Toolkit using the following command line execution:

pdftk <inputfile> update_info <pdf_info> output <outputfile>

The text file <pdf_info> looks like a key-value list for each of the fields you intend to update.

1
  • 8
    You should set these settings using \hypersetup{..} and not as package options. It avoids the overhead and potential troubles with LaTeX's option handling routine. Jul 16, 2011 at 22:46
15

You can change the Creator and Producer fields with hyperref:

\documentclass{article}

\usepackage{hyperref}

\hypersetup{
    pdfcreator={Hello},
    pdfproducer={World}
}

\begin{document}

Hello World

\end{document}

The third field is more interesting and requires more investigation. It certainly can be seen inside the PDF file, but Evince and pdfinfo don't show it… The field is also mentioned in the pdfTeX manual.

Let's look at the pdfTeX source code. In src/texk/web2c/pdftexdir/pdftex.web we see

pdf_str_entry_ln("PTEX.Fullbanner", pdftex_banner);

and

@d pdfTeX_banner=='This is pdfTeX, Version 3.1415926',pdftex_version_string

where

@d pdftex_version_string=='-1.40.11' {current \pdfTeX\ version}

pdf_str_entry_ln outputs its arguments directly:

procedure pdf_str_entry(s, v: str_number); {print out an entry in
dictionary with string value to PDF buffer}
…

procedure pdf_str_entry_ln(s, v: str_number);
begin
    if v = 0 then
        return;
    pdf_str_entry(s, v);
    pdf_print_nl;
end;

So, the text is hardcoded, and you're out of luck with this field on the TeX side — unless you edit the source code.

4
  • 1
    I don't think that the "banner" can be controlled by the user.
    – egreg
    Jul 16, 2011 at 22:27
  • Thanks for digging up that. I am not sure why I am unable to reset this with \pdfinfo{/PTEX.Fullbanner (My LaTeX)} Jul 17, 2011 at 0:51
  • 2
    @peter-grill: You will only add another entry for /PTEX.Fullbanner to the info dict, thus ending with two identical keys in the dictionary. There is no way to suppress the writing of the key by pdfTeX. Jul 17, 2011 at 11:34
  • 4
    Since pdfTeX version 1.40.17, shipped with TeX Live 2016, you can suppress the banner entry using \pdfsuppressptexinfo=1, cf. the pdfTeX manual, page 22.
    – diabonas
    Jun 7, 2016 at 23:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .