Super User Asked by su1980 on December 27, 2021
Under the “Get Info” screen of the PDF file, More Info, How do I remove the metadata for “Encoding Software” and “Where From” ?
If I open this PDF in Acrobat XI Pro (Mac) and open File/Properties/Description/Additional Metadata then:
— “Encoding Software” does show up but can’t be deleted.
— “Where From” is nowhere to be found. It’s not searchable in the PDF at all either.
Where is this problem metadata stored?
How can this problem metadata be deleted? (without having to resort to “Remove Hidden Information” which deletes ALL the Metadata, even the fields I want to keep).
pip install pypdf2
import pprint
from PyPDF2 import PdfFileReader, PdfFileMerger
if __name__ == '__main__':
file_in = open('old.pdf', 'rb')
pdf_reader = PdfFileReader(file_in)
metadata = pdf_reader.getDocumentInfo()
pprint.pprint(metadata)
pdf_merger = PdfFileMerger()
pdf_merger.append(file_in)
pdf_merger.addMetadata({
'/Producer': 'Leave empty to remove',
})
file_out = open('new.pdf', 'wb')
pdf_merger.write(file_out)
file_in.close()
file_out.close()
code courtesy: https://stackoverflow.com/a/58222282/1895600
old.pdf
python override.py
A new file will be created with the "Encoding software" value as provided in the script above.
Cheers !?
Answered by mayankcpdixit on December 27, 2021
The Where From metadata is a Mac filesystem attribute rather than a property of the PDF. It can be removed using this command:
xattr -d com.apple.metadata:kMDItemWhereFroms FILE_NAME
For more information check this question https://apple.stackexchange.com/questions/110239/where-is-the-where-from-meta-data-stored-when-downloaded-via-chrome
Answered by Jozef Legény on December 27, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP