Write XMP Metadata to PDF pages with Exiftool

Started by T1m0, April 15, 2015, 08:44:01 AM

Previous topic - Next topic

T1m0

Hi,

I would like to write XMP data to one or more pages of a PDF document.
My goal is that I can get additional information to certain PDF pages afterwards.

Looking at the PDF specification I saw that each PDF has a root, which has pages, which have kids, which can hold metadata.
Exiftool provides tags for that: https://exiftool.org/TagNames/PDF.html

So my first try to reach the pages' metadata was:

%Image::ExifTool::UserDefined = (
  'Image::ExifTool::PDF::Root::Pages::Kids::Metadata' => {
     'XMP' => {
      Name => 'pageXMP',
         Writable => 'string',
     },
  },
);   
1; # end

like you do in https://exiftool.org/forum/index.php/topic,6208.msg30710.html#msg30710
Result: Can't locate Image/ExifTool/PDF/Root/Pages/Kids.pm in @INC (you may need to install the Image::ExifTool::PDF::Root::Pages::Kids module)

So what am I doing wrong?; or is accessing pages with exiftool isn't as easy as I'm hoping?

Thanks in advance and good day.
T1m0

Phil Harvey

Sorry, but ExifTool supports writing only file-level XMP in PDF documents.  Even if you got your UserDefined tag to work, there is no way to specify which page to write this to.

- 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 ($).