I use PDF-XChange Editor v5.5.316.0 for certain PDF creation and editing operations, and it's not uncommon for me to use it to add some metadata while I have files open in it. When I use it to add metadata, I have no problems reading or exporting that metadata using ExifTool (currently using v12.36). But when I use ExifTool to add metadata to the same fields that are created/modified by PDF-XChange Editor, a few of those field values are not displayed by the latter, even though ExifTool confirms that they're there. The fields in question are XMP:AuthorsPosition (titled "Author Title" in PDF-XChange Editor),
and XMP:CaptionWriter ("Description Writer"). Apart from the behavior of PDF-XChange Editor being beyond the control of anyone here, any ideas as to what might be going on? Are there known issues with other tools reading/writing metadata in PDFs, like the previously-discussed issues with Directory Opus/Exiv2 and PNG metadata?
Attached: "PDF Metadata Test.7z" (3,144)
Contents:
"PDF Metadata Test\"
"Test.pdf" (5,086) [Metadata populated via PDF-XChange Editor]
"Test.pdf.json" (1,292) [Metadata exported by ExifTool]
"Test2.pdf" (8,992) [Metadata populated via ExifTool]
"Test2.pdf_original" (3,929) [No metadata]
"Test2.pdf.1.json" (603) [Customized metadata used for import by ExifTool]
"Test2.pdf.2.json" (1,206) [Metadata exported by ExifTool]
Does PDF-XChange Editor read some of the fields changed by exiftool, but not others? Are you sure it's reading the XMP data and not other data?
The only thing that would otherwise come to mind is that PDF-XChange Editor doesn't necessarily honor the incremental update technique that exiftool uses. You might try re-linearizing the file with qpdf and see if that helps. See details on the PDF Tags page (https://exiftool.org/TagNames/PDF.html).
Quote from: StarGeek on March 15, 2022, 06:21:04 PM
Does PDF-XChange Editor read some of the fields changed by exiftool, but not others? Are you sure it's reading the XMP data and not other data?
PDF-XChange Editor's Document Properties dialog provides access to create/edit/display the following fields:
PDF:Title: <title>
XMP:Title: <title>
PDF:Author: <author>
XMP:Creator: <author>
XMP:AuthorsPosition: <author_title>
PDF:Subject: <subject>
XMP:Description: <subject>
XMP:CaptionWriter: <description_writer>
PDF:Keywords: <keyword1_1>,<keyword1_2>,<keyword1_3>
XMP:Keywords: <keyword1_1>,<keyword1_2>,<keyword1_3>
XMP:Subject: <keyword2_1>,<keyword2_2>,<keyword2_3>
XMP:Rights: <copyright>
XMP:WebStatement: <copyright_url>
(There are also some other standard PDF fields displayed, but not editable.)
When I use ExifTool to create the fields listed above, all of those values except XMP:AuthorsPosition and XMP:CaptionWriter are viewable in PDF-XChange Editor
I should point out that I don't know what PDF-XChange Editor would display if I used ExifTool to write separate, different values to corresponding PDF and XMP fields (such as Title), but I haven't had any reason to experiment with that.
The reason this became an issue for me is that I apparently can't use PDF-XChange Editor to add or edit metadata in password-protected PDFs, while ExifTool lets me, but I'd still like to be able to view that metadata in the former.
Quote
You might try re-linearizing the file with qpdf and see if that helps.
I just tried it now, but it did not make the values in those two fields visible in PDF-XChange Editor.
Can you create a PDF in PDF-XChange Editor with only the XMP:AuthorsPosition and XMP:CaptionWriter tags and then run this command on it and paste the output
exiftool -XMP -b file.pdf
My guess is that there is a difference in the XMP that exiftool writes and PDF-XChange Editor write.
Here you go:
<?xpacket begin="ZWNBS(BOM)" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="XMP Core 5.1.2">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:format>application/pdf</dc:format>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/">
<xmpMM:DocumentID>uuid:1f8baffb-bdd1-4225-952c-6d587bcc389b</xmpMM:DocumentID>
<xmpMM:InstanceID>uuid:e357f2d1-8f8c-43b4-afc1-b9013f80ceed</xmpMM:InstanceID>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
<xmp:CreateDate>2022-03-16T14:53:10-04:00</xmp:CreateDate>
<xmp:CreatorTool>PDF-XChange Editor 5.5.316</xmp:CreatorTool>
<xmp:AuthorsPosition>Benevolent Dictator for Life</xmp:AuthorsPosition>
<xmp:CaptionWriter>Kilgore Trout</xmp:CaptionWriter>
<xmp:ModifyDate>2022-03-16T14:56:06-04:00</xmp:ModifyDate>
</rdf:Description>
<rdf:Description rdf:about=""
xmlns:pdf="http://ns.adobe.com/pdf/1.3/">
<pdf:Producer>PDF-XChange PDF Core API (5.5.316)</pdf:Producer>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
<?xpacket end="w"?>
The ZWNBS(BOM) is what I have Notepad++ display for BOM.
Ah, I probably should have just asked for the output as per FAQ #3 (https://exiftool.org/faq.html#Q3).
I edited a test pdf to add AuthorsPosition and CaptionWriter and exiftool places them in XMP-photoshop while PDF-XChange Editor puts them in XMP-xmp.
C:\>exiftool -G1 -a -s -xmp:all Y:\!temp\test.pdf Y:\!temp\test.xmp
======== Y:/!temp/test.pdf
[XMP-x] XMPToolkit : Image::ExifTool 12.39
[XMP-photoshop] AuthorsPosition : Benevolent Dictator for Life
[XMP-photoshop] CaptionWriter : Kilgore Trout
======== Y:/!temp/test.xmp
[XMP-x] XMPToolkit : XMP Core 5.1.2
[XMP-dc] Format : application/pdf
[XMP-xmpMM] DocumentID : uuid:1f8baffb-bdd1-4225-952c-6d587bcc389b
[XMP-xmpMM] InstanceID : uuid:e357f2d1-8f8c-43b4-afc1-b9013f80ceed
[XMP-xmp] CreateDate : 2022:03:16 14:53:10-04:00
[XMP-xmp] CreatorTool : PDF-XChange Editor 5.5.316
[XMP-xmp] AuthorsPosition : Benevolent Dictator for Life
[XMP-xmp] CaptionWriter : Kilgore Trout
[XMP-xmp] ModifyDate : 2022:03:16 14:56:06-04:00
[XMP-pdf] Producer : PDF-XChange PDF Core API (5.5.316)
2 image files read
I don't know enough about the standard to say which is correct.
I tested a bit over 5,000 pdf files, looking for AuthorsPosition and CaptionWriter (thank you Everything Search). Only 105 files actually had those tags and in all cases they were in XMP-photoshop, not XMP-xmp, so I'm inclined to think that PDF-XChange Editor is writing to the wrong group.
Quote from: StarGeek on March 16, 2022, 04:40:07 PM
I'm inclined to think that PDF-XChange Editor is writing to the wrong group.
Ok, now we know that they're at least different groups. Thanks much.
I don't suppose it's possible to force writing to XMP-photoshop instead of XMP-xmp, preferably via importing from JSON? I tried doing that from a JSON with entries such as "XMP-photoshop:CaptionWriter": "Kilgore Trout",, but that failed to get written.
Do you mean XMP-xmp:CaptionWriter? Because exiftool can only write XMP-photoshop:CaptionWriter.
Example:
C:\>type temp.txt
[{
"SourceFile": "Y:/!temp/test.pdf",
"XMP-photoshop:CaptionWriter": "New Test"
}]
C:\>exiftool -P -overwrite_original -all= -json=temp.txt Y:\!temp\test.pdf
Warning: [minor] ExifTool PDF edits are reversible. Deleted tags may be recovered! - Y:/!temp/test.pdf
1 image files updated
C:\>exiftool -G1 -a -s -e --file:all Y:\!temp\test.pdf
[ExifTool] ExifToolVersion : 12.39
[PDF] PDFVersion : 1.4
[PDF] Linearized : No
[PDF] PageCount : 68
[XMP-x] XMPToolkit : Image::ExifTool 12.39
[XMP-photoshop] CaptionWriter : New Test
I would have no idea about how you might force PDF-XChange Editor to write/read XMP-photoshop:CaptionWriter.
If you want exiftool to write XMP-xmp:CaptionWriter, then you would have to add user defined tags. This config file will allow that. Hopefull PDF-XChange Editor will be able to read it.
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::xmp' => {
# Text tag (can be specified in alternative languages)
CaptionWriter => { Writable => 'lang-alt' },
# Text tag (can be specified in alternative languages)
AuthorsPosition => { Writable => 'lang-alt' },
},
);
1;
Example output:
C:\>exiftool -config Xmp-xmp_Pdf.config -P -overwrite_original -XMP-xmp:CaptionWriter=test Y:\!temp\test.pdf
1 image files updated
C:\>exiftool -G1 -a -s -e --file:all Y:\!temp\test.pdf
[ExifTool] ExifToolVersion : 12.39
[PDF] PDFVersion : 1.4
[PDF] Linearized : No
[PDF] PageCount : 68
[XMP-x] XMPToolkit : Image::ExifTool 12.39
[XMP-photoshop] CaptionWriter : New Test
[XMP-xmp] CaptionWriter : test
Exiftool will write both if you use just XMP:CaptionWriter, which is what I would suggest for maximum compatibility.
C:\>exiftool -config Xmp-xmp_Pdf.config -all= -P -overwrite_original -XMP:CaptionWriter="Additional test" Y:\!temp\test.pdf
Warning: [minor] ExifTool PDF edits are reversible. Deleted tags may be recovered! - Y:/!temp/test.pdf
1 image files updated
C:\>exiftool -G1 -a -s -e --file:all Y:\!temp\test.pdf
[ExifTool] ExifToolVersion : 12.39
[PDF] PDFVersion : 1.4
[PDF] Linearized : No
[PDF] PageCount : 68
[XMP-x] XMPToolkit : Image::ExifTool 12.39
[XMP-photoshop] CaptionWriter : Additional test
[XMP-xmp] CaptionWriter : Additional test
Quote from: StarGeek on March 28, 2022, 12:05:10 PM
Do you mean XMP-xmp:CaptionWriter?
Yes, sorry about that.
Quote
If you want exiftool to write XMP-xmp:CaptionWriter, then you would have to add user defined tags. This config file will allow that. Hopefull PDF-XChange Editor will be able to read it.
%Image::ExifTool::UserDefined = (
'Image::ExifTool::XMP::xmp' => {
# Text tag (can be specified in alternative languages)
CaptionWriter => { Writable => 'lang-alt' },
# Text tag (can be specified in alternative languages)
AuthorsPosition => { Writable => 'lang-alt' },
},
);
1;
Cool, thanks, that works! Question, though: Is there a reason you have
CaptionWriter configured to be a lang-alt tag in your example above? Just wondering, since the XMP Tags page (https://exiftool.org/TagNames/XMP.html#photoshop) defines
XMP-photoshop:CaptionWriter as a plain string. (I've made it a plain string in my new config file as well, pending your answer.)
Quote
Exiftool will write both if you use just XMP:CaptionWriter, which is what I would suggest for maximum compatibility.
Noted, and done. Thanks again.
Quote from: mazeckenrode on March 28, 2022, 02:37:10 PMQuestion, though: Is there a reason you have CaptionWriter configured to be a lang-alt tag in your example above? Just wondering, since the XMP Tags page (https://exiftool.org/TagNames/XMP.html#photoshop) defines XMP-photoshop:CaptionWriter as a plain string. (I've made it a plain string in my new config file as well, pending your answer.)
Ok, then a plain string would be better. I was copy/pasting/editing a previous XMP config file and that's what was set there.
I haven't read this whole thread, but I do suggest that you submit a bug report to PDF-XChange Editor because it is writing CaptionWriter in the wrong namespace.
- Phil
Quote from: Phil Harvey on March 28, 2022, 08:58:42 PM
I do suggest that you submit a bug report to PDF-XChange Editor
I appreciate the suggestion, and ordinarily I'd consider doing just that, but I'm using a 2016 version of PDF-XChange Editor, am not feeling likely to upgrade (partially due to the challenges I experienced while trying to get support for a different issue a few years back), and for all I know, they may have since corrected the
CaptionWriter namespace.
Quote from: mazeckenrode on March 29, 2022, 10:31:09 AM
they may have since corrected the CaptionWriter namespace.
They have.
PDF-XChange Editor ver 9.2, build 358.0, (Oct25, 2021) writes
CaptionWriter in the XMP-photoshop namespace.
It's called "Description Writer" in the application.
Thanks for verifying that.