There is a program provided by Apple to see most of the metadata in a file. It is nice to have the met data clearly arranged, but the catch is that you cannot delete it or I don't know how to delete it.
For example, there is a PDF file in front of me that contains the source, the author and my operating system version. I would like to change this. I tried to delete the source using "xattr -c".
It seems as if the information is in the file and not added attributes are from the system itself.
Does anyone know how to delete or change the metadata.
Many Thanks
Best Answer
Meta information and attributes is complex thing and I am not qualified to cover it extensively. Nevertheless. Distinction should be made between:
It is my understanding that question is about meta information one can see using ⌘ + i in Finder and
xattr
is not suited for that (it's for Extended File Attributes).If you remove extended attributes with
xattr -c my_file.pdf
it may seem that all attributes are removed (xattr my_file.pdf
returns nothing). However, Finder displays meta information in tact.Built-in
mdls
lists the metadata attributes for the specified file. The problem withmdls
is that attributes are in MacOS plist format which not match names of attributes one can see in Finder using ⌘ + i. Additionally it also displays mixed selection of meta information and extended file attributes as well as fact it allows listing but not editing.For deleting pdf meta information one can use
exiftool
and/orqpdf
(both are not built in).To remove all meta information in my_file.pdf using exiftool:
It removes meta information, but displays warning:
Pending ones needs linearizing this file with qpdf to remove artifacts (creates new file) might be an option:
...and then one can read something like Cleaning PDF metadata in depth and realize that nothing is certain except taxes and death.