Take the 2-minute tour ×
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.

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
1  
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
2  
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
2  
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 at 14:13
add comment

5 Answers

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
2  
+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
    
@MarianoSuárez-Alvarez: Not yet. –  Martin Schröder Jan 24 '13 at 7:30
2  
@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
show 8 more comments

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

\usepackage{hyperref}
\hypersetup{
  pdfinfo={
  pdfproducer={},
  Title={},
  Subject={},
  Author={},
  }
}

(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:

\pdfinfo{
  /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
3  
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
add comment

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
1  
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
add comment

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
add comment

For ConTeXt the answer, which is not implemented at time of writing, will be:

\disabledirective[backend.ptex]

See the mailing list thread for details.

share|improve this answer
add comment

Your Answer

 
discard

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.