JavaScript "this.metadata" is not return correct XMP metadata when PDF is locked by password.
- December 12, 2019
- 2 replies
- 2911 views
This issue occurred on Adobe Acrobat and Adobe Reader 2019.021.20058. Is this bug? Or something specification is changed?
*It's not occurred on 2019.021.20056 and lower.
You can reproduce this issue by below.
1. Open this PDF file with Adobe Acrobat.
https://krwww.s3-ap-northeast-1.amazonaws.com/support/adobe/sample.pdf
*It's same with attachment file "sample.pdf".
2. Open JavaScript Debugger and execute "this.metadata". It return correct result below. This is same XMP metadata in the PDF file.
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c016 91.163616, 2018/10/29-16:58:49 ">
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
pdf:Producer="Acrobat Distiller 4.0 for Windows"
pdf:Keywords="Tiger, Sample File, PDF, 
Other keywords..."
xmp:ModifyDate="2019-12-12T09:43:11+09:00"
xmp:CreateDate="2001-02-07T12:43:33Z"
xmp:MetadataDate="2019-12-12T09:43:11+09:00"
xmpMM:DocumentID="uuid:e078b573-fbb6-4975-ac4e-7ad8f5315af3"
xmpMM:InstanceID="uuid:85cb8a4b-48ea-4f72-92e8-78b01658b87f"
dc:format="application/pdf">
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">Tiger</rdf:li>
</rdf:Alt>
</dc:title>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">Sample PDF</rdf:li>
</rdf:Alt>
</dc:description>
<dc:creator>
<rdf:Seq>
<rdf:li>Unknown</rdf:li>
</rdf:Seq>
</dc:creator>
<dc:subject>
<rdf:Bag>
<rdf:li>Tiger</rdf:li>
<rdf:li>Sample File</rdf:li>
<rdf:li>PDF</rdf:li>
<rdf:li>Other keywords...</rdf:li>
</rdf:Bag>
</dc:subject>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
3. Lock this PDF by password and reopen it.
*Any password setting is OK. It's no influence for this issue.
You can downlod it from below. Owner password is "test".
https://krwww.s3-ap-northeast-1.amazonaws.com/support/adobe/sample-locked.pdf
*It's same with attachment file "sample-locked.pdf".
4. Open JavaScript Debugger and execute "this.metadata" again. It should same result with step 2 but return below. It is different with actual XMP metadata in the PDF file. It seems Adobe Reader regenerate this XMP metadata from Info dictionary. So some metadata are missing.
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP Core 5.6-c016 91.163616, 2018/10/29-16:58:49 ">
<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/"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmlns:pdf="http://ns.adobe.com/pdf/1.3/"
xmp:CreateDate="2001-02-07T12:43:33Z"
xmp:ModifyDate="2019-12-12T09:44:29+09:00"
pdf:Keywords="Tiger, Sample File, PDF, 
Other keywords..."
pdf:Producer="Acrobat Distiller 4.0 for Windows">
<dc:creator>
<rdf:Seq>
<rdf:li>Unknown</rdf:li>
</rdf:Seq>
</dc:creator>
<dc:description>
<rdf:Alt>
<rdf:li xml:lang="x-default">Sample PDF</rdf:li>
</rdf:Alt>
</dc:description>
<dc:title>
<rdf:Alt>
<rdf:li xml:lang="x-default">Tiger</rdf:li>
</rdf:Alt>
</dc:title>
</rdf:Description>
</rdf:RDF>
</x:xmpmeta>
