Apologies if this has been asked before. I'm after a way of batch editing the metadata (title, author, keywords mainly) of a lot of PDF files. I can edit them individually but I've got over 100 files to edit (for Calibre) and I can't find any programs that will allow me to do it.
Is it possible to write a script using EXIFTOOL or Ghostscript?
Update : This is what I've got so far ...
import exiftool
import csv
files = csv.csv2sequence('metadata.csv')
for file in files:
filename = file[0]
set_title = '-title=' +file[1]
set_author = '-author=' +file[2]
set_creator = '-creator=' +file[3]
set_producer = '-producer=' +file[4]
with exiftool.ExifTool() as et:
et.execute(set_title,filename)
et.execute(set_author,filename)
et.execute(set_creator,filename)
et.execute(set_producer,filename)
... with the metadata stored in a csv file. However, I get this error when I run it ...
TypeError: sequence item 0: expected a bytes-like object, str found
... from the exiftool.py file. Not sure what this is ...