ExifTool Forum

ExifTool => Newbies => Topic started by: drramimagdi on March 31, 2022, 07:56:54 PM

Title: how to add pdf 'title' metadata to match filename for mutiple pdf files
Post by: drramimagdi on March 31, 2022, 07:56:54 PM
if it's possible...
i have several pdf files
i want their metadata 'title' to be the same as the filename
can this be done?
Title: Re: how to add pdf 'title' metadata to match filename for mutiple pdf files
Post by: StarGeek on April 01, 2022, 12:59:49 AM
The basic command would be either
exiftool "-Title<Filename" /path/to/files/
if you wanted to include the extension or
exiftool "-Title<Basename" /path/to/files/
for the filename without the extension, but requires version 12.22+

But you may have to write to multiple title tags.  It's been a while since I checked but Adobe Reader would read any of the following four tags for "Title".  It may be different for other software.
XMP-dc:Title
XMP-pdf:Title
XMP-xmp:Title
PDF:Title

You'll have to test and see if the above command works for you or not.  Otherwise you can replace Title with one or more of these tags that include the group location.  For example, you could use this to cover everything
exiftool "-XMP-dc:Title<Basename" "-XMP-pdf:Title<Basename" "-XMP-xmp:Title<Basename" "-PDF:Title<Basename" /path/to/files/
Title: Re: how to add pdf 'title' metadata to match filename for mutiple pdf files
Post by: drramimagdi on April 01, 2022, 05:48:28 AM
many thanks. it works perfectly