ExifTool Forum

General => Metadata => Topic started by: hmorgan25 on August 25, 2015, 04:10:22 PM

Title: issue writing metdata to pdf
Post by: hmorgan25 on August 25, 2015, 04:10:22 PM
My apologies for probably a very simple question... I am trying to write metadata (new tag) to a plain Jane pdf file.

I have the exiftool and the .ExifTool_config in the same directory (Windows 8.1).

Here is the contents of the config file...
--------------------------------------------------------------

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::Exif::Main' => {
        0xd000 => {
            Name => 'MailedDate',
            Writable => 'string',
            WriteGroup => 'IFD0',
        },
    },
);
1; #end

--------------------------------------------------------------

Here is my command...

exiftool -config .ExifTool_config -MailedDate="8/15/2015 17:00:00" test.pdf


also tried... with a Plus sign...

C:\tools\exiftool>exiftool -config .ExifTool_config -MailedDate+="8/15/2015 17:00:00" test.pdf

Warning: Shift value for IFD0:MailedDate is not a number
Nothing to do.

Can anyone shed light on the issue? this is a new pdf file with no existing metadata/xmp tags at all.

thank you very much.

Title: Re: issue writing metdata to pdf
Post by: hmorgan25 on August 25, 2015, 04:55:05 PM
I found in another post on how to add the metadata, but it's not showing up in Acrobat XI Pro under the custom tab of file properties. So I used the -keywords section which worked fine. so no need to really answer this question. 
Title: Re: issue writing metdata to pdf
Post by: Phil Harvey on August 26, 2015, 07:42:02 AM
I don't know where to start.  I have a number of questions:

1) Why are you trying to create a custom user-defined tag in the first place? 

2) Why are you trying to write EXIF to a PDF file?  (You should probably write either native PDF metadata or XMP.)

3) Can you write this tag with Acrobat?  If so, where does it store this information (see FAQ 3 (https://exiftool.org/faq.html#Q3)

4) Why are you using +=?  This syntax is for adding items to a list or incrementing a numerical value.

- Phil
Title: Re: issue writing metdata to pdf
Post by: hmorgan25 on August 26, 2015, 11:07:40 PM
1) I am trying to add xmp data to a pdf, your tool came up as a way to do so.
2) since it's xml base info, I figured your tool would be able to do that. and since i'm not an expert in this area, I probably am going about it incorrectly
3) Yes, I can write it with acrobat, and it shows up under the Custom tab in the file properties in reader/acrobat full.
4) I was using + originally to add something new, not as an operational function.

Remember, my preface to the post was insinuating that I'm not an expert or close to it in this field. So, my apologies for throwing into a place of unstartability.

Also, the ability to edit/add/replace keywords worked fine and was preferable actually.
Title: Re: issue writing metdata to pdf
Post by: Phil Harvey on August 27, 2015, 07:53:49 AM
OK, thanks.

You should follow the example for the XMP-xxx tags in the sample config file, and put your MailedDate there.  You just need to change "xxx" to the prefix you want, and set the proper NAMESPACE URI (you'll need to look at the original XMP from a file written by Acrobat using "exiftool -xmp -b FILE" to determine what this should be).  If you get this right, then your first command should work.

- Phil