News:

2023-03-15 Major improvements to the new Geolocation feature

Main Menu

Tag not showing with -a -G1 -s

Started by RobBenjamin, January 08, 2019, 10:33:36 PM

Previous topic - Next topic

RobBenjamin

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':

%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
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
[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

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

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

The image you attached shows an empty ReportNum.  So Acrobat isn't seeing what you wrote either.

Could you mail me the pdf document?  philharvey66 at gmail.com

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

RobBenjamin

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

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

RobBenjamin

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

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://exiftool.org/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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

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/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).