Author Topic: Tag not showing with -a -G1 -s  (Read 316 times)

RobBenjamin

  • Newbie
  • *
  • Posts: 4
Tag not showing with -a -G1 -s
« on: January 08, 2019, 10:33:36 PM »
Running exiftool -a -G1 -s filename doesn't return tag that was updated.

I have a pdf file that another program creates tags in.  I created a config file with the tags and updated one of the tags.  If I open the file in Acrobat the correct data shows, however it does not when I use the -a -G1 -s options.

Config file 'se.config':

Code: [Select]
%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::pdfx' => {
        JobNum => {},
PeriodEndDate => {},
PeriodStartDate => {},
ProjectNum => {},
ReportBy => {},
ReportCodes => {},
ReportDated => {},
ReportNum => {},
ReportTitle => {},
    },
);
1; # end


I then update the tag:

exiftool -config se.config -v2 -ReportNum=999  2077.PDF
Code: [Select]
Writing XMP-pdfx:ReportNum
======== 2077.PDF
Rewriting 2077.PDF...
  Editing tags in: PDF XMP
  Creating tags in: PDF XMP
  Rewriting XMP
    - XMP-pdfx:ReportNum = ''
    + XMP-pdfx:ReportNum = '999'
    1 image files updated

Then list the tags using FAQ 3 options:
exiftool -a -G1 -s  2077.PDF
Code: [Select]
[ExifTool]      ExifToolVersion                 : 11.11
[System]        FileName                        : 2077.PDF
[System]        Directory                       : .
[System]        FileSize                        : 171 kB
[System]        FileModifyDate                  : 2019:01:08 19:25:33-08:00
[System]        FileAccessDate                  : 2019:01:08 19:25:33-08:00
[System]        FileCreateDate                  : 2019:01:07 10:47:43-08:00
[System]        FilePermissions                 : rw-rw-rw-
[File]          FileType                        : PDF
[File]          FileTypeExtension               : pdf
[File]          MIMEType                        : application/pdf
[PDF]           PDFVersion                      : 1.4
[PDF]           Linearized                      : No
[PDF]           PageMode                        : UseNone
[PDF]           PageCount                       : 4
[XMP-rdf]       About                           : uuid:2C443B1E-F1E2-404F-974D-E21FEF8E72AA
[XMP-pdfx]      ReportNum                       :
[XMP-pdfx]      ReportTitle                     : Daily Inspection Report for 10/2/2017
[XMP-pdfx]      ReportDated                     : 2017-10-02
[XMP-pdfx]      ReportBy                        : 2077
[XMP-pdfx]      ReportCodes                     : IOTH
[XMP-pdfx]      ProjectNum                      : 70707
[XMP-pdfx]      JobNum                          : 1
[XMP-pdfx]      PeriodStartDate                 : 2017-10-02
[XMP-pdfx]      PeriodEndDate                   : 2017-10-02
[XMP-pdfx]      XMPVer                          : 2004-07-14

The tag command shows the tag updated (as does Adobe Acrobat), however the listing doesn't show the update.  It doesn't seem the options -a -G1 -s are getting all the tags.

Stephen Marsh

  • Sr. Member
  • ****
  • Posts: 215
Re: Tag not showing with -a -G1 -s
« Reply #1 on: January 09, 2019, 01:17:24 AM »
Perhaps try the following:

-u (-unknown)
Extract values of unknown tags. Add another -u to also extract unknown information from binary data blocks. This option applies to tags with numerical tag ID's, and causes tag names like "Exif_0xc5d9" to be generated for unknown information. It has no effect on information types which have human-readable tag ID's (such as XMP), since unknown tags are extracted automatically from these formats.

RobBenjamin

  • Newbie
  • *
  • Posts: 4
Re: Tag not showing with -a -G1 -s
« Reply #2 on: January 09, 2019, 02:35:39 AM »
Hi Stephen,

Sorry no change :(

FYI looking at the info in Acrobat it is listed under 'http://ns.adobe.com/pdfx/1.3' (no quotes), see attached screen capture.  I think this might be a namespace, however I do not see any namespace info on the exiftool output.  Also the config file doesn't have namespace, but in Acrobat is shows the update.

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Tag not showing with -a -G1 -s
« Reply #3 on: January 09, 2019, 07:02:14 AM »
The image you attached shows an empty ReportNum.  So Acrobat isn't seeing what you wrote either.

Could you mail me the pdf document?  phil at owl.phy.queensu.ca

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

RobBenjamin

  • Newbie
  • *
  • Posts: 4
Re: Tag not showing with -a -G1 -s
« Reply #4 on: January 09, 2019, 10:12:11 AM »
Files mailed.

Sorry, my bad.  I had continued working on it tried changing the JobNum to 999 and that is what is showing in Acrobat.

-Rob

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Tag not showing with -a -G1 -s
« Reply #5 on: January 09, 2019, 11:52:14 AM »
Hi Rob,

ExifTool was writing this OK, but not reading it back.  The reason is because the main xref table in this PDF is marked as a /XRef object, which should store the xref table in a stream, but doesn't (instead it stores it using the old table format).  I have never seen this before, and don't know if this is technically allowed, but since Adobe Reader doesn't complain I guess it may be.  I'll patch ExifTool 11.25 to allow for this possibility, and this version should be able to read back the changes properly.  There will be no changes to the way ExifTool writes PDF's.

Thanks for this report, and for the samples which allowed me to track down this problem.

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

RobBenjamin

  • Newbie
  • *
  • Posts: 4
Re: Tag not showing with -a -G1 -s
« Reply #6 on: January 09, 2019, 12:49:38 PM »
Thank you Phil.

Being a newby I thought is was something I was missing.  Tried hard to figure it out.  The legacy program that creates this is 10yrs+ old.

Is there a way to 'correct' these xref tables using exiftool?

How do I find out when the patch is available?

-Rob

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Tag not showing with -a -G1 -s
« Reply #7 on: January 09, 2019, 12:54:45 PM »
Hi Rob,

ExifTool can't be used to fix this.  You could use something like the qpdf utility to fix it.

The next release will be in about a week or two.  If you want email notifications, you can join github and watch this project for updates:

https://github.com/exiftool/exiftool

or watch this RSS news feed:

feed://owl.phy.queensu.ca/~phil/exiftool/rss.xml

or enable notifications for this thread in the forum and I'll try to remember to post back when the update is available.

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

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14425
    • ExifTool Home Page
Re: Tag not showing with -a -G1 -s
« Reply #8 on: February 13, 2019, 11:23:53 AM »
Sorry, I'm late posting back, but the update (version 11.25) was available on Jan 15.

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