> My next question is: How to edit the appearance of an
> existing digital signature? Is this possible?
Yes, it's possible... but in all likelyhood it would invalidate the signature. If iText is doing the initial signing, you could safely modify PdfSignatureAppearance.getAppearance() and still have valid signatures.
After poking around in iText a bit, it looks like your NPE is a result of not having called PdfStamper.createSignature() first... which makes perfect sense if you're trying to modify an existing sig. At which point you've departed the land of convenient APIs and have to delve into the low level PDF objects, PdfDictionary and its ilk.
--Mark Storer
Senior Software Engineer
Cardiff Software
#include <disclaimer>
typedef std::Disclaimer<Cardiff> DisCard;
> -----Original Message-----
> From: itext-questions-bounces@(protected)
> [mailto:itext-questions-bounces@(protected)
> Behalf Of Luiz
> Kobayashi
> Sent: Thursday, July 06, 2006 2:38 PM
> To: itext-questions@(protected)
> Subject: [iText-questions] How to edit the appearance of an existing
> digitalsignature?
>
>
> Hello all,
>
> first of all, many thanks again to Paulo, who helped me a lot in my
> previous question.
>
>
> One thing that I want to do is to sign a pdf and display the digital
> signature in base64 in the n2 layer.
>
> The way I thought to do was:
> 1) Sign the pdf as shown in the tutorial
> 2) Read the signed pdf file and retrieve the signature bytes
> (thanks to
> Paulo who showed me how to do it!)
> 3) Get the n2 layer of the signature and change it.
>
> But when I try to do
>
> PdfReader reader2 = new PdfReader(baos.toByteArray()); // baos is the
> byte array where the signed pdf is stored
> PdfStamper stp2 = new PdfStamper(reader2, fout, '\0', true);
> PdfSignatureAppearance sap2 = stp2.getSignatureAppearance();
>
> I get a
java.lang.NullPointerException whenever I try doing anything
> with sap2, like sap2.getLayer(2) or sap2.setLayer2Text().
>
> So, I was wondering what would be the right way to do, if
> there is one.
>
> Any help would be greatly appreciated.
>
> Thanks in advance,
>
> Luiz Kobayashi
>
> Using Tomcat but need to do more? Need to support web
> services, security?
> Get stuff done quickly with pre-integrated technology to make
> your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on
> Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&
dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
iText-questions mailing list
iText-questions@(protected)
https://lists.sourceforge.net/lists/listinfo/itext-questions