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?
- 31,033
- 503
- 1
- 4
- 9
2 Answers
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.
- 37,517
Use hyperref's \hypersetup:
\documentclass{article}
\usepackage{hyperref}% http://ctan.org/pkg/hyperref
\hypersetup{pdfauthor={New Author}}
\begin{document}
test
\end{document}
This information should transfer from PS to PDF.
Consider the following document (click to enlarge):
Run this through the PDF Toolkit to dump_data the meta-data:
pdftk photo.pdf data_dump output info.txt
Apart from other things, info.txt includes:
InfoKey: Title InfoValue: A Photo InfoKey: Producer InfoValue: Acrobat Distiller 9.5.3 (Windows) InfoKey: Author InfoValue: An Author InfoKey: Keywords InfoValue: picture, person InfoKey: Subject InfoValue: Photo
To update only the author field, create a file new_info.txt containing
InfoKey: Author InfoValue: New Author
and re-insert this via the update_info:
pdftk photo.pdf update_info new_info.txt output photo_new.pdf
The "keys" with updated "values" are now updated in the meta-data (click to enlarge):
This may be specific to some PDF producers/versions.
- 603,163
-
Thanks for your answer. One more thing is actually i am converting emf to eps then eps to pdf. my metafile to eps converter (metafile2eps.exe) prints my name to eps header. If I can manipulate it, there will be no need for ps metadata manipulation. Am I right? – user706071 Aug 27 '13 at 20:54
-
@user706071: I'm not sure whether meta-data survives or can be transferred during the conversion from EMF to EPS. It does from PS to PDF. – Werner Aug 27 '13 at 20:58

