Does anyone have an idea ? Is it possible ? And how ?
From: [email protected]
To: [email protected]
Date: Thu, 25 Mar 2010 16:17:47 +0100
Subject: Re: [iText-questions] How to do an incremental update ?
Thank you for your response.
So my question is now : how do I get back the original content (before
revision) after an incremental update with iText ?
This is a piece of code making an update in "append" mode :
// doc creation
ByteArrayOutputStream os = new ByteArrayOutputStream();
Document doc = new Document();
PdfWriter.getInstance(doc, os);
doc.open();
doc.add(new Paragraph("Hello World"));
doc.close();
// doc update
ByteArrayOutputStream os1 = new ByteArrayOutputStream();
PdfReader reader = new PdfReader(os.toByteArray());
PdfStamper stamper = new PdfStamper(reader, os1, '\0', true);
stamper.insertPage(2, PageSize.A4);
PdfContentByte cb = stamper.getUnderContent(2);
ColumnText ct = new ColumnText(cb);
Phrase p = new Phrase("text added");
ct.setSimpleColumn(p, 80, 36, PageSize.A4.getWidth() - 80,
PageSize.A4.getHeight() - 36, 15, Element.ALIGN_JUSTIFIED);
ct.go();
stamper.close();
// get original content
??
From: [email protected]
To: [email protected]
Date: Thu, 25 Mar 2010 07:06:54 -0700
Subject: Re: [iText-questions] How to do an incremental update ?
Incremental/append works for ANY change to the PDF…
HOWEVER, Adobe Acrobat only enables the UI for “show revision”
when a digital signatures is involved.
From: Alexander Doyle
[mailto:[email protected]]
Sent: Thursday, March 25, 2010 9:46 AM
To: [email protected]
Subject: [iText-questions] How to do an incremental update ?
Hi all,
I read in the PDF reference :
(2.2.7) : "PDF allows modifications to be appended to a file, leaving
the original data intact."
And :
(2.2.7) : "In addition, because the original contents of the document
are still present in the file, it is possible to undo saved changes by deleting
one or more addenda."
The reference insist on the requirement to recover the exact contents of an
original document especially when digital signatures have been applied.
I actually signed a document and was able to recover the original content. I
used the "append" mode of the PdfStamper class.
I tried to apply the same process with an AcroField other than a SignatureField.
It did not work. When I fill a TextField in "append" mode, the new
revision is not created, and thus I cannot extract the revision related to the
updated text field.
As the PDF reference does not mention that the incremental update must be
related only to AcroFields (I apologize if it actually does, I did not find
it), I also tried to insert a new page and to edit it while getting the
"under content" PdfContentByte. Despite the fact that I created the
PdfStamper in "append" mode, there is neither a newly created
revision.
Can you please tell me where I made a mistake, or where there is a
misunderstanding from me ?
Thank you all.
Hotmail:
Trusted email with powerful SPAM protection. Sign up now.
Hotmail: Trusted email with Microsoft’s powerful SPAM protection. Sign up now.
_________________________________________________________________
Hotmail: Trusted email with powerful SPAM protection.
https://signup.live.com/signup.aspx?id=60969------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://www.itextpdf.com/book/
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/