Good catch!  Then the original PDF creator is broken and needs to be fixed!


On 6/29/11 2:52 PM, "mkl" <[email protected]> wrote:

>
>Leonard Rosenthol-3 wrote:
>> 
>> Search the code and see where XAP appears.
>> 
>
>I'm afraid it might be the other way around... Stefan's original PDF
>consistently uses the xap namespace prefix and iText inserts an element
>using the xmp namespace prefix without defining it.
>
>PdfStamperImp.close() sets the ModifyDate like this:
>
>
>
>> XmpReader xmpr;
>> ...
>> xmpr.add("rdf:Description", "http://ns.adobe.com/xap/1.0/";,
>> "xmp:ModifyDate", date.getW3CDate());
>> 
>
>Looking at XmpReader.add() I see:
>
>
>
>> public boolean add(String parent, String namespaceURI, String localName,
>> String value) {
>>   NodeList nodes = domDocument.getElementsByTagName(parent);
>>   if (nodes.getLength() == 0)
>>     return false;
>>   Node pNode;
>>   Node node;
>>   for (int i = 0; i < nodes.getLength(); i++) {
>>     pNode = nodes.item(i);
>>     NamedNodeMap attrs = pNode.getAttributes();
>>     for (int j = 0; j < attrs.getLength(); j++) {
>>       node = attrs.item(j);
>>       if (namespaceURI.equals(node.getNodeValue())) {
>>         node = domDocument.createElement(localName);
>>         node.appendChild(domDocument.createTextNode(value));
>>         pNode.appendChild(node);
>>         return true;
>>       }
>>     }
>>   }
>>   return false;
>> }
>> 
>
>Thus, xmpr.add("rdf:Description", "http://ns.adobe.com/xap/1.0/";,
>"xmp:ModifyDate", date.getW3CDate()); actually searches for a
>"rdf:Description" node which has, as an attribute, a namespace definition
>for "http://ns.adobe.com/xap/1.0/";, and then it inserts a "xmp:ModifyDate"
>element ignoring the prefix actually defined for that namespace.
>
>Unless the prefixes to use are fixed in the context of XMP and are
>required
>to be defined in the "rdf:Description" node, this smells very buggy.
>
>Regards,   Michael.
>
>--
>View this message in context:
>http://itext-general.2136553.n4.nabble.com/Sign-a-PDF-A-tp3627882p3632752.
>html
>Sent from the iText - General mailing list archive at Nabble.com.
>
>--------------------------------------------------------------------------
>----
>All of the data generated in your IT infrastructure is seriously valuable.
>Why? It contains a definitive record of application performance, security
>threats, fraudulent activity, and more. Splunk takes this data and makes
>sense of it. IT sense. And common sense.
>http://p.sf.net/sfu/splunk-d2d-c2
>_______________________________________________
>iText-questions mailing list
>[email protected]
>https://lists.sourceforge.net/lists/listinfo/itext-questions
>
>iText(R) is a registered trademark of 1T3XT BVBA.
>Many questions posted to this list can (and will) be answered with a
>reference to the iText book: http://www.itextpdf.com/book/
>Please check the keywords list before you ask for examples:
>http://itextpdf.com/themes/keywords.php


------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to