Adding Custom Properties in PDF

Started by uvishwakarma, December 12, 2014, 09:01:57 AM

Previous topic - Next topic

uvishwakarma

I am so sorry Phil for the confusion. I already posted my intended PDF file and again posting the same. You can check in Acrobat application, all custom tags are visible there along with array kind of tags (AuthoritativeDomain):

I did tried XMP::pdfx but it was not showing in the Acrobat custom properties but when I use PDF::Info it does shows custom tags in the Acrobat custom tags list.

Please suggest.

Regards,
Umesh

Phil Harvey

Using the -v3 option you can see what is going on inside this PDF file:

[...]
  + [Info directory with 15 entries]
  | 0)  Author = (Ali Fattahi)
  |     - Tag 'Author', direct object
  | 1)  AuthoritativeDomain_1_ = (yahoo.com)
  |     - Tag 'AuthoritativeDomain#5B1#5D', direct object
  | 2)  AuthoritativeDomain_2_ = (google.com)
  |     - Tag 'AuthoritativeDomain#5B2#5D', direct object
  | 3)  CreateDate = (D:20120824160310+05'30')
  |     - Tag 'CreationDate', direct object
  | 4)  CrossMarkDomains_1_ = (yahoo.com)
  |     - Tag 'CrossMarkDomains#5B1#5D', direct object
  | 5)  CrossMarkDomains_2_ = (google.com)
  |     - Tag 'CrossMarkDomains#5B2#5D', direct object
  | 6)  CrossmarkDomainExclusive = (true)
  |     - Tag 'CrossmarkDomainExclusive', direct object
  | 7)  CrossmarkMajorVersionDate = (2010-04-23)
  |     - Tag 'CrossmarkMajorVersionDate', direct object
  | 8)  ElsevierWebPDFSpecifications = (6.4)
  |     - Tag 'ElsevierWebPDFSpecifications', direct object
  | 9)  Keywords = (Integer programming; Facilities planning and design; U-shaped assem[snip]
  |     - Tag 'Keywords', direct object
  | 10) ModifyDate = (D:20141213200458+05'30')
  |     - Tag 'ModDate', direct object
  | 11) Subject = (Testing)
  |     - Tag 'Subject', direct object
  | 12) Title = (Testing)
  |     - Tag 'Title', direct object
  | 13) Doi = (00.0000/j.xxxx.2014.10.036)
  |     - Tag 'doi', direct object
  | 14) Robots = (noindex)
  |     - Tag 'robots', direct object
[...]


To write these PDF Info AuthoritativeDomain tags, you need a config file like this:

%Image::ExifTool::UserDefined = (
  'Image::ExifTool::PDF::Info' => {
     doi => {
         Writable => 'string',
     },
     'AuthoritativeDomain#5B1#5D' => {
         Name => 'AuthoritativeDomain1',
         Writable => 'string',
     },
     'AuthoritativeDomain#5B2#5D' => {
         Name => 'AuthoritativeDomain2',
         Writable => 'string',
     },
  },
);   
1; # end


and the command is:

exiftool -authoritativedomain1=google.com -authoritativedomain2=yahoo.com FILE

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

uvishwakarma

Spot on!!! Worked perfectly, you are a true champion!!!

Thanks Phill for listening to all my queries, it does requires too much patience, really appreciated.

Regards,
Umesh