Error updating XMP in PDF

Started by Joakim Lundberg, August 04, 2014, 11:59:56 AM

Previous topic - Next topic

Joakim Lundberg

Hi,

I have a slight problem when updating the XMP meta data in some PDF files (not all). The issue is that after inserting the new XMP data some tools (e.g. Adobe Acrobat Pro) does not read the XMP data (neither the new nor the original data).

Using Exiftool 9.69 on OSX and the command is basically the following:
   
Quoteexiftool -config "config.txt" -tagsfromfile "newXMP.xml" "-xmp:all>all:all" "result.pdf"

The config.txt above can be seen here (no issues with this IMHO): https://www.dropbox.com/s/cgqfvikzpexrp7m/config.txt
The newXMP.xml can be downloaded here (also no issues with this IMHO): https://www.dropbox.com/s/3vtenmovxqkgibh/newXMP.xml
The result PDF file can be downloaded here: https://www.dropbox.com/s/jrxadbe1evly539/result.pdf

The output is ok from the above call, 1 file updated and the result file looks alright, but for some reason Adobe Acrobat Pro (among others) can not read the XMP in this result file. In fact no XMP is read from the result file. If I delete the updated trailing bits from exiftool in the result file the old XMP data is read accordingly so there seem to be some issue with the new appended data at the end (from the original %%EOF).

Is there any obvious error in my handling above that are causing this error? Any hints would be appreciated!

Kind regards Joakim

Phil Harvey

Hi Joakim,

Thanks for reporting this.

This is likely to be a very tricky problem, and will take some time for me to investigate.  I will take a look at it as soon as I get the time, probably in a few weeks after I am back from my vacation.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

Well, I found time to look at this while I am around this week.

The problem is unfortunately Adobe's inconsistent use of xmpMM:Manifest.  Originally their utilities wrote this as an unordered list (rdf:Bag), but apparently now it is being written as an ordered list (rdf:Seq).  ExifTool writes this as an unordered list, but doesn't remove the old ordered elements, which results in invalid XMP.  It will take some work to fix this, but expect ExifTool 9.70 to deal with this properly.

Thanks for this report.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).