Hi.
I tryed another thing, created a blank signature field, now i can see it,
but it disapears when signing.
My hair is dying white, this is terrible.



import java.io.*;
import java.util.*;
import java.security.*;
import java.security.cert.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;

public class LittleTest {

public static void main(String args[]) throws Exception {

PdfReader reader1 = new PdfReader("testv15.pdf");
PdfStamper stamper = new PdfStamper(reader1, new
FileOutputStream("testv15_2.pdf"));
AcroFields form = stamper.getAcroFields();
form.setField("text1", "Value has been changed !!!");
//stamper.setFormFlattening(true);
//Now Let's Try To Add A Signature Field
PdfFormField sig = PdfFormField.createSignature(stamper.getWriter());
sig.setWidget(new Rectangle(100, 100, 200, 200), null);
sig.setFlags(PdfAnnotation.FLAGS_PRINT);
sig.put(PdfName.DA, new PdfString("/Helv 0 Tf 0 g"));
sig.setFieldName("Signature1");
sig.setPage(1); 
stamper.addAnnotation(sig, 1); 
stamper.close();

KeyStore ks = KeyStore.getInstance("pkcs12");
ks.load(new FileInputStream("ksb_cred.pfx"), "fujiwara".toCharArray());
String alias = (String)ks.aliases().nextElement();
PrivateKey key = (PrivateKey)ks.getKey(alias, "fujiwara".toCharArray());
java.security.cert.Certificate[] chain = ks.getCertificateChain(alias);
reader1 = new PdfReader("testv15_2.pdf");
FileOutputStream fout = new FileOutputStream("testv15_2_signed.pdf");   
PdfStamper stp = PdfStamper.createSignature(reader1, fout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setCrypto(key, chain, null, PdfSignatureAppearance.WINCER_SIGNED);
sap.setReason("For no reason at all");
sap.setLocation("V. Castelo");
// comment next line to have an invisible signature
sap.setVisibleSignature("Signature1");
stp.close();


}
}

Paulo Soares wrote:
> 
> I've no idea where the problem is. The signature has everything in the
> right place but Acrobat doesn't like something and throws all the
> annotations away. This needs further investigation.
>  
> Paulo
> 
> ________________________________
> 
> From: [EMAIL PROTECTED] on behalf of Noe Rocha
> Sent: Wed 13-Dec-06 23:32
> To: itext-questions@lists.sourceforge.net
> Subject: Re: [iText-questions] pdf does not show the digital signature
> 
> 
> 
> 
> Hi.
> I'm sending the example i'm trying to work.
> There's 6 files:
> LittleTest.java - does some filling and signs
> example.pdf - original pdf file
> example_filled.pdf - original after filling
> example_filled_signed - file after signed
> and the certificates.
> This is bugging me for hours, must be something really small and stupid,
> but
> i can't figure out.
> Thank you.
> http://www.nabble.com/file/4573/LittleTest.rar LittleTest.rar
> 
> Paulo Soares wrote:
>>
>> Maybe you should post a link to that PDF to see what's about. In any
>> case,
>> we are not here to debug Scribus.
>> 
>> Paulo
>>
>> ________________________________
>>
>> From: [EMAIL PROTECTED] on behalf of Noe
>> Rocha
>> Sent: Wed 13-Dec-06 22:01
>> To: itext-questions@lists.sourceforge.net
>> Subject: Re: [iText-questions] pdf does not show the digital signature
>>
>>
>>
>>
>> It's designed with Scribus.
>>
>>
>> Paulo Soares wrote:
>>>
>>> If it's a PDF created with Designer you must have an empty signature
>>> field.
>>>
>>> Paulo
>>>
>>>
>>> ________________________________
>>>
>>> From: [EMAIL PROTECTED] on behalf of Noe
>>> Rocha
>>> Sent: Wed 13-Dec-06 17:21
>>> To: itext-questions@lists.sourceforge.net
>>> Subject: [iText-questions] pdf does not show the digital signature
>>>
>>>
>>>
>>>
>>> hi.
>>> i have created a test pdf form (version 1.5) with a single text field,
>>> then
>>> i try to sign the file, but nothing occours.
>>> there's no error, but the signature does not appear, neither acrobat
>>> detects
>>> any digital signature.
>>> Does the pdf form need to be flatten first?
>>> Plz advice.
>>> --
>>> View this message in context:
>>> http://www.nabble.com/pdf-does-not-show-the-digital-signature-tf2814973.html#a7855898
>>> Sent from the iText - General mailing list archive at Nabble.com.
>>>
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys - and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> iText-questions mailing list
>>> iText-questions@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>>
>>>
>>>
>>>
>>> Aviso Legal:
>>> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
>>> informação confidencial ou legalmente protegida. A incorrecta
>>> transmissão
>>> desta mensagem não significa a perca de confidencialidade. Se esta
>>> mensagem for recebida por engano, por favor envie-a de volta para o
>>> remetente e apague-a do seu sistema de imediato. É proibido a qualquer
>>> pessoa que não o destinatário de usar, revelar ou distribuir qualquer
>>> parte desta mensagem.
>>>
>>> Disclaimer:
>>> This message is destined exclusively to the intended receiver. It may
>>> contain confidential or legally protected information. The incorrect
>>> transmission of this message does not mean the loss of its
>>> confidentiality. If this message is received by mistake, please send it
>>> back to the sender and delete it from your system immediately. It is
>>> forbidden to any person who is not the intended receiver to use,
>>> distribute or copy any part of this message.
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> Take Surveys. Earn Cash. Influence the Future of IT
>>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>>> your
>>> opinions on IT & business topics through brief surveys - and earn cash
>>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>>> _______________________________________________
>>> iText-questions mailing list
>>> iText-questions@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>>
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/pdf-does-not-show-the-digital-signature-tf2814973.html#a7861191
>> Sent from the iText - General mailing list archive at Nabble.com.
>>
>>
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>>
>>
>>
>> Aviso Legal:
>> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
>> informação confidencial ou legalmente protegida. A incorrecta transmissão
>> desta mensagem não significa a perca de confidencialidade. Se esta
>> mensagem for recebida por engano, por favor envie-a de volta para o
>> remetente e apague-a do seu sistema de imediato. É proibido a qualquer
>> pessoa que não o destinatário de usar, revelar ou distribuir qualquer
>> parte desta mensagem.
>>
>> Disclaimer:
>> This message is destined exclusively to the intended receiver. It may
>> contain confidential or legally protected information. The incorrect
>> transmission of this message does not mean the loss of its
>> confidentiality. If this message is received by mistake, please send it
>> back to the sender and delete it from your system immediately. It is
>> forbidden to any person who is not the intended receiver to use,
>> distribute or copy any part of this message.
>>
>>
>> 
>> -------------------------------------------------------------------------
>> Take Surveys. Earn Cash. Influence the Future of IT
>> Join SourceForge.net's Techsay panel and you'll get the chance to share
>> your
>> opinions on IT & business topics through brief surveys - and earn cash
>> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
>> _______________________________________________
>> iText-questions mailing list
>> iText-questions@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/itext-questions
>> Buy the iText book: http://itext.ugent.be/itext-in-action/
>>
>>
> 
> --
> View this message in context:
> http://www.nabble.com/pdf-does-not-show-the-digital-signature-tf2814973.html#a7862899
> Sent from the iText - General mailing list archive at Nabble.com.
> 
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 
> 
> 
> Aviso Legal:
> Esta mensagem é destinada exclusivamente ao destinatário. Pode conter
> informação confidencial ou legalmente protegida. A incorrecta transmissão
> desta mensagem não significa a perca de confidencialidade. Se esta
> mensagem for recebida por engano, por favor envie-a de volta para o
> remetente e apague-a do seu sistema de imediato. É proibido a qualquer
> pessoa que não o destinatário de usar, revelar ou distribuir qualquer
> parte desta mensagem. 
> 
> Disclaimer:
> This message is destined exclusively to the intended receiver. It may
> contain confidential or legally protected information. The incorrect
> transmission of this message does not mean the loss of its
> confidentiality. If this message is received by mistake, please send it
> back to the sender and delete it from your system immediately. It is
> forbidden to any person who is not the intended receiver to use,
> distribute or copy any part of this message.
> 
> 
>  
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> iText-questions mailing list
> iText-questions@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/itext-questions
> Buy the iText book: http://itext.ugent.be/itext-in-action/
> 
> 

-- 
View this message in context: 
http://www.nabble.com/pdf-does-not-show-the-digital-signature-tf2814973.html#a7876258
Sent from the iText - General mailing list archive at Nabble.com.


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to