How do you know the signature is still signed?  Does it /look/ signed,
or does acrobat/reader/etc check the signature and say "yep, its
signed"?

In other words, are you rebuilding the signature's appearance?

--Mark Storer
  Senior Software Engineer
  Cardiff.com
 
import legalese.Disclaimer;
Disclaimer<Cardiff> DisCard = null;
 
 

> -----Original Message-----
> From: djdjdj [mailto:[email protected]] 
> Sent: Wednesday, October 13, 2010 7:19 AM
> To: [email protected]
> Subject: Re: [iText-questions] Clearing a Digital Signature 
> Field's value.
> 
> 
> Alright,  I managed to upgrade the .dll to 4.1.6.  I have 
> verified that the stamper object is not being called in 
> append mode.  The signature field is still not cleared and 
> the field remains signed.
> 
> The code has now been changed thusly:
> 
> public Boolean ClearSignatureField(string fieldName) { try { 
> ArrayList list = this.Stamper.AcroFields.GetFieldItem(fieldName);
> item.MarkUsed(this.Fields, AcroFields.Item.WRITE_VALUE | 
> AcroFields.item.WRITE_WIDGET); int n = item.Size; for (int 
> k=0; k<n; ++k) { ClearSignatureDictionary(item.GetMerged(k));
> ClearSignatureDictionary(item.GetWidget(k));
> ClearSignatureDictionary(item.GetValue(k));
> }
> return true;
> }
> catch(Exception ex)
> {
> throw new Exception("An Exception has occurred: ", ex); } }
> 
> private static void ClearSignatureDictionary(PdfDictionary 
> dic) { dic.Remove(PdfName.AP); dic.Remove(PdfName.AS); 
> dic.Remove(PdfName.V); dic.Remove(PdfName.DV); 
> dic.Remove(PdfName.SV); dic.Remove(PdfName.FF); 
> dic.Put(PdfName.F, new PdfNumber(PdfAnnotation.FLAGS_PRINT));
> }
> 
> 
> As you can see, the code now closely more resembles the code 
> updated by Paulo.  The code executes without failure and the 
> field's values are correctly located.  However, the signature 
> field remains signed.  
> 
> If curious, here is my stamper declaration code:
> 
> private void GenerateStamper(bool isAppendMode) { bool 
> canCloseReader = false;
> 
> if (this.ModifiedStream != null)
> {
> this.Stamper = new PdfStamper(this.Reader, 
> this.ModifiedStream, '\0', isAppendMode); canCloseReader = true; }
> 
> if (canCloseReader)
> {
> this.Reader.Close();
> }
> }
> 
> 
> isAppendMode is being populated by the value of false during 
> stamper generation which should be fine.
> --
> View this message in context: 
> http://itext-general.2136553.n4.nabble.com/Clearing-a-Digital-
> Signature-Field-s-value-tp2966934p2993740.html
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> --------------------------------------------------------------
> ----------------
> Beautiful is writing same markup. Internet Explorer 9 
> supports standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, 
> and DOM L2 & L3.
> Spend less time writing and  rewriting code and more time 
> creating great experiences on the web. Be a part of the beta today.
> http://p.sf.net/sfu/beautyoftheweb
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> 
> 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
> 
> 
> No virus found in this incoming message.
> Checked by AVG - www.avg.com
> Version: 9.0.862 / Virus Database: 271.1.1/3192 - Release 
> Date: 10/12/10 11:37:00
> 

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today.
http://p.sf.net/sfu/beautyoftheweb
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

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