I checked it and you have two metadata errors - the modification date is 
different and the producer is different.

PDF/A-1 requires that the values in the XMP and the values in DocInfo match - 
so if you (or iText) change one, you need to change the other.

Leonard

From: Pablo Carranza [mailto:pcarra...@safecreative.org]
Sent: Friday, December 04, 2009 8:36 AM
To: itext-questions@lists.sourceforge.net
Subject: [iText-questions] Invalid PDF/A-1 because of productor xmp metadata 
value

Hi there, Im havig a problem with a pdf/a-1 conformant file which does not 
validates correctly against adobe acrobat pro verification arging that the 
producer field metadata is different to document xmp ("Discrepancia de 
productor entre la información del documento y los metadatos XMP" in spanish) 
as the modification date ("")

I'll try to explain all the process for the document because I cannot find any 
case like the one i'm having.

 *   I have an ODT file which I convert to a PDF/A-1 compliant file using 
openoffice's jodconverter. (At this point the pdf file is PDF/A-1 fully 
standard compliant)
 *   I open the pdf file and with a stamper i do the following:
    *   Embedd ICC, etc, etc.
    *   Add as many more pages i need to be able to stamp signatures later (in 
the one i'm attaching there's only one page added) without and signature 
appearance associated.
    *   Create the signature fields i need for later signing.
    *   Set the pdfx compliant value with 
"stamper.getwriter().setPDFXConformance(PdfWriter.PDFA1A);"
    *   Append some texts and images in the document.
    *   Close this stamper.
 *   When the signing starts (it's just a few lines later in this case), I open 
a new stamper with "PdfStamper.createSignature(reader, bos, '\0', null, true);"
 *   Get the signature appearance with "sap = stamper.getSignatureAppearance();"
 *   preclose & sign, closing the signature appearance object.
I've tried to create xmp metadata in both stampers using 
"stamper.getWriter().createXmpMetadata()" but it is even worst because some 
other metadata properties fails to comply.
Also tried to copy the metadata from the reader to the stamper writer with 
something like this:

                PdfDictionary catalog = reader.getCatalog();
                PdfObject obj = catalog.get(PdfName.METADATA);

                PRStream stream = (PRStream)PdfReader.getPdfObject(obj);
                String metadata = new String(PdfReader.getStreamBytes(stream));
                stamper.setXmpMetadata(metadata.getBytes());

But didn't work much better, it even give me more errors arguing about creation 
date.
I also tried to remove xmp data with stamper.setXmpMetadata(null); but it 
didn't worked better.


Any help with this will be greatly appreciated

Best regards.

Pablo Carranza
------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing. 
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
Check the site with examples before you ask questions: 
http://www.1t3xt.info/examples/
You can also search the keywords list: http://1t3xt.info/tutorials/keywords/

Reply via email to