Monday, 15 June 2015

c# - Sign PDF file on last page -


I am using C # and iTextSharp 3.1 to sign PDF files. The signature is working, but I want to sign on the last page of the file. The code I use is like this:

  Reader = new PDF reader (Input PDF); Int number of pages = reader.numberoff pages; PdfStamper st = PdfStamper.CreateSignature (Reader, new filestream (Output PDF, FlameMode.creative, Filex Veerate), '\ 0', blank, true); PDF Interview Display SAP = St. Signature display; Sign in to fit (// logo logo! = Tap) // // scale IIG logo Scaloffit (100, 50); // Set the signature status on the page logo sign. SetsAbsolutePosition (300, 80); Sap.Image = logo Sign; } Sap.SetCrypto (this.myCert.Akp, this.myCert.Chain, blank, PDF SigenatureExplon.exe) ;; If (cigreson.lengai> 0) sap.Reason = SigReason; If (SigContact.Length> 0) sap.Contact = SigContact; If (sig location leng> 0) sap.Location = SigLocation; If (visible) sap.SetVisibleSignature (mySignRect, 1, blank); Try {st.Close (); } Hold (Exception E) {}   

This code signals on the first page of the file. I need an o mark on the last page of the file I also wonder how I can decide to sign in on the previous page, the same code does not work in iTextSharp5.4.2. It returns an error on sap.SetCrypto () and st.Close ()

Any idea how I work it in 5.4.2 Please try the example C # version that comes with the white paper referenced by mkl:

No comments:

Post a Comment