[Tex/LaTex] Removing Author name in ps2pdf

ps2pdf

I'm converting EPS to PDF via Ghostscript's ps2pdf.bat in Windows.
But the author of PDFs are my system name. I changed my user name from Windows, but when I look at the properties of the PDF, my name is there. How can I remove it?

Best Answer

I would suggest exiftool for this purpose; as far as I know it is the only free tool that can manipulate not only InfoDictionary, but also XMP metadata and provides a very convenient interface.

To just clear the author field:

exiftool -Author= file.pdf

To get rid of all metadata:

exiftool -all:all= file.pdf

Note, however, that exiftool does not really delete the metadata in the InfoDictionary, but just updates it with a newer version. In fact, you could restore the original data with:

exiftool -pdf-update:all= file.pdf

To really remove confidential data, you should remove all metadata with exiftool (which removes the XMP metadata and also the reference to the InfoDictionary) and then use a size optimizing tool that removes unreferenced objects from the PDF to get rid of the still present InfoDictonary. I frequently use qpdf for this purpose:

exiftool -all:all= file.pdf
qpdf --linearize file.pdf file-really-no-meta.pdf

The result is, as far as I know, a truly metadata-free PDF.

Some background on PDF metadata

PDF metadata comes in two forms:

(a) The "classical" InfoDictionary, which contains a limited number of key/value pairs. This is the kind of metadata also written by pdflatex; the hyperref package provides a convenient interface to set certain values of this metadata.

(b) The newer XMP packets, which contain RDF data streams (an XML description), which so far is mostly used by Adobe Products (Acrobat since version 5.0). Whenever you edit a PDF file in Acrobat (probably also any other Adobe products) it silently creates the XMP metadata set and initializes it with values from the InfoDictionary. Afterwards, only the XMP metadata is used. So it is important to remove the XMP metadata as well.