TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When writing a referee report for a journal, it would be preferrable to have the resulting PDF file generated by pdflatex be completely anonymous.

Does one need to take special actions to ensure this? For example, if any references to file names with their paths are included anywhere in the resulting file, that will result in information (my home directory is /home/mariano/... for example)

share|improve this question
I don't think any original path names are included in the PDF. You might want to clear all PDF info fields, so that the reader doesn't even know that the PDF got created by pdftex. – Martin Scharrer Jan 23 '13 at 21:09
Please have a look at this question: Are comments safely hidden once the document is compiled? and especially at that answer: Are comments safely hidden once the document is compiled? – Keks Dose Jan 23 '13 at 21:18
Usually no, except maybe the PDF metadata as already mentioned. One way to demonstrate this is to uncompress the PDF and then examine it, either manually (for small test documents) or using eg grep for known directory names etc. – cyberSingularity Jan 24 '13 at 0:58
See this blog post to see how to use pdftk to strip metadata from PDF files. – Aditya Jan 27 '13 at 23:00
Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – Martin Schröder Feb 27 '14 at 14:13

pdfTeX and luaTeX write additional information into the resulting PDF as documented in pdftex-pdfkeys.pdf:

  1. The Document Catalog contains an additional key PTEX.Fullbanner which contains the full version of pdftex/luatex, i.e. "This is pdfTeX, Version 3.1415926-2.4-1.40.13 (TeX Live 2012) kpathsea version 6.1.0)". This key can be seen in some version of Adobe Reader and Adobe Acrobat (Document Properties -> Advanced).

For every included image theses keys are added to the XObject containing the image:

  1. PTEX.FileName is the filename as seen by pdfTeX, e.g. "./sample2e.pdf"
  2. PTEX.PageNumber is the page number of an included PDF
  3. PTEX.InfoDict is a copy of the Info Dictionary (e.g. Title, Author, etc.) of an included PDF.

There is currently no way to disable the writing of these keys.

If you want to remove these keys from a PDF, the easiest way is probably a conversion to PostScript followed by a conversion to PDF.

share|improve this answer
Is there a flag to turn this off somewhere? This is one way to leak personal information, I guess. – Mariano Suárez-Alvarez Jan 23 '13 at 23:00
+1 for investigating! Do you know if anything of this is preserved when piping the PDF through the pdf2ps | ps2pdf route as suugested by Mariano? – Daniel Jan 24 '13 at 6:49
Are there any (free) tools to examine this information? – Daniel Jan 24 '13 at 6:57
Could you at least post a summary of the linked document. A full answer to the question should also include a way to avoid this additional information or an explanation why this is not possible. – Martin Scharrer Jan 24 '13 at 9:28
@KeksDose: Answers on this side should be mostly self-contained. Also this doesn't answer the question. It's just points out an issue which has to be solved. – Martin Scharrer Jan 24 '13 at 10:02

I guess the path you see is not really written in your PDF, but it is the relative path where the PDF is currently located. Apart from general information of the PDF producer ("LaTeX with hyperref package", etc.) I see no private information when examining the file with Adobe Acrobat Pro. (In this sense, PDFs produced with PDFLaTeX and XeLaTeX are more anonymous than those produced by, say, MS Word.)

However, if you wish to erase even that, you can try


(for all keys described in § 3.9 of the hyperref package documentation).

Using Werner's suggestion---of which I was completely unaware---you can accomplish the same directly with the PDFTeX engine, thus:

  /Title ()
  /Creator ()
  /Producer ()
  /Author ()
  /Subject ()
  /Keywords ()

Yet I'm a bit puzzled with this slashed syntax (instead of the TeX backslash).

share|improve this answer
Technically you don't need hyperref to set meta data. pdfTeX internally supports this. See Is hyperref really the best way to add metadata to a TeX file? – Werner Jan 24 '13 at 15:25
Just a small comment on the /Title () syntax. This is just the PDF syntax, it is not anyhow related to TeX – Vincent Fourmond Jan 1 '15 at 19:08

First of all, PDF is not like DOC or XLS – I have never encountered an path names or other "hidden" information in it that reveals details about my computer or environment. Apparently I was wrong, pdftex und luatex do write extra information into the PDF's object catalog! See answer of Martin for details.

Nevertheless, at times we all face a bit of paranoia. A simple, albeit brute-force approach in this case is to just rasterize the complete PDF (here using ImageMagick):

convert -density 300 report.pdf report-anonymized.pdf

The disadvantage is, of course, that the resulting PDF can become fairly big and that it is no longer possible to select text in it.

A bit less drastic is the conversion PS and back to PDF, as suggested by Mariano (here using Ghostscript):

pdf2ps report.pdf - | ps2pdf - report-anonymized.pdf

This also leads to a complete recoding of the PDF. (I use this approach frequently to "sanitze" PDF with transparencies generated by OpenOffice, on which pdflatex often chokes).

share|improve this answer
One can also covert to PS and back to PDF, which is less drastic and I think should kill most private information, f there is any to kill. – Mariano Suárez-Alvarez Jan 23 '13 at 21:12
@MarianoSuárez-Alvarez: Good point, thanks. I have edited the answer accordingly. – Daniel Jan 23 '13 at 21:53
IIRC ps2pdf also accepts pdf as input (it's just a frontend to GhostScript), so you could try with only one step. – Martin Schröder Jan 24 '13 at 11:21

PDF meta-data can be about either the main document or included PDFs.

Main PDF

We can remove the main PDF meta-data from the Document Catalog. If you are not using the hyperref package you can use the following tex code (credit to NVaughan/Werner):

\pdfinfo{ /Creator ()  /Producer () /ModDate ()  /CreationDate () } 

(You can also zero-out Title,Author, Subject, and Keywords but these aren't usually set, at least by MiKTeX.) If you are using the hyperref package then it will write some of these fields again. It will write Creator and Producer with values, Subject and Keywords that are usually blank, and Author and Title which it may autopopulate. So you will have to at least do either

\hypersetup{pdfinfo={ Creator={}, Producer={}, ModDate={...}, CreationDate={...} }}


\pdfinfo{ /ModDate ()  /CreationDate () }
\hypersetup{pdfinfo={ Creator={}, Producer={} }}

If you are using pdfTeX version 1.40.17 or greater (included in MiKTeX already), then the following will remove the trailer ID (often a hash of content and timestamp) and the PTEX.Fullbanner

\pdftrailerid{} %Remove ID
\pdfsuppressptexinfo15 %Suppress PTEX.Fullbanner and info of imported PDFs

For earlier versions of pdfTeX you will have to post-process to get rid of these field (see perl example below).

Included PDFs

For removing meta-data from included PDFs, the line above works for pdfTeX 1.40.17

\pdfsuppressptexinfo15 %Suppress PTEX.Fullbanner and info of imported PDFs

(See the full bit mask options for pdfsuppressptexinfo.) Otherwise, you can post-process the PDF to at least remove the file-names using:

perl -pe 's|(/PTEX.FileName \()([^\)]+)|$1 . " " x length($2)|ge' orig.pdf > orig.anon.pdf

This post-processing will not remove the PTEX.PageNumber (likely harmless) or PTEX.InfoDict (which you may want to ensure doesn't contain anything sensitive).

Edited 2016-05-25 to include options for newer versions of pdfTeX.

share|improve this answer

I can think of two possibilities, none unfortunately pdfLaTeX-based. First, I can add to the reply by @daniel by mentioning PStill with its PDF to raster plugin PDF2R. This converts the pdf to a raster pdf similarly to what was mentioned for ImageMagick. A second option would be to generate a PS-file and then use ps2pdf to generate the PDF.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.