is there code but didint work

PdfReader reader = *new* PdfReader("C:\\856592.pdf");

FileOutputStream fout = *new* FileOutputStream("C:\\856592_signed.pdf");

PdfStamper stp = PdfStamper.*createSignature*(reader, fout, '\0');

Calendar now = Calendar.*getInstance*();

PdfSignatureAppearance sap = stp.getSignatureAppearance();

sap.setVisibleSignature(*new* Rectangle(50, 100, 300, 150), 1, *null*);

sap.setLayer2Text("This is some custom made text.\n\nDate: some date");

PdfDictionary dic = *new* PdfDictionary();

dic.put(PdfName.*TYPE*, PdfName.*SIG*);

dic.put(PdfName.*FILTER* , *new* PdfName("ADOBE.PPKLITE"));

dic.put(PdfName.*SUBFILTER*, *new* PdfName("adbe.pkcs7.detached"));

dic.put(PdfName.*M*, *new* PdfDate(now));

*int* csize = 16000;

 sap.setCryptoDictionary(dic);

*HashMap* exc = *new* *HashMap*();

*exc.put(PdfName.CONTENTS, csize)*;

sap.preClose (exc);

PdfDictionary dic2 = *new* PdfDictionary();

*byte*[] out = *new* *byte*[csize/2];

System.*arraycopy*(imzaVeri, 0, out, 0, imzaVeri.length);

dic2.put(PdfName.*CONTENTS*, *new* PdfString(imzaVeri).setHexWriting(*true*
));

sap.close(dic2);


On Fri, Dec 11, 2009 at 9:53 AM, Andreas Kuehne <[email protected]> wrote:

>  Hi İsmail,
>
> presumably you got a PDF an a detached signature ( a separate file ). This
> won't never fit into the PDF because the way the PDF signature is build is
> different from the way a detached signature is calculated.
>
> But iText can build a PDF signbature for you, see the examples in 'the
> book' .
>
> Greetings
>
> Andreas
>  ------------------------------
> *From:* İsmail Uzunok <[email protected]>
> *To:* [email protected]
> *Sent:* Fri, December 11, 2009 8:16:55 AM
> *Subject:* [iText-questions] digital sign
>
> hi everybody
> i am new one
>
> i want to ask a quastion
>
> i have a pdf file and i sign the file
> also i have signature of the file
>
> i want to add signature of the pdf file into the pdf file
>
>
> thnks
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
>
> _______________________________________________
> iText-questions mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/itext-questions
>
> Buy the iText book: http://www.1t3xt.com/docs/book.php
> 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/
>



-- 
İyi Çalışmalar

İsmail UZUNOK
Argem Yazılım
Genel Müdür
+90 505 225 16 45
------------------------------------------------------------------------------
Return on Information:
Google Enterprise Search pays you back
Get the facts.
http://p.sf.net/sfu/google-dev2dev
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php
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/

Reply via email to