Hi everyone,
I was happy signing my small PDF files until "java.lang.OutOfMemoryError"
appeared when I tried to sign a big one :-((... I find a solution in the
forum, which I tried but it was not what I expected :,(.
this code work perfectly for small files...
...
PdfReader reader = new PdfReader(new FileInputStream(SRC));
FileOutputStream fout = new FileOutputStream(DST);
PdfStamper stp = PdfStamper.createSignature(reader, fout, '\0');
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setCrypto(key,(java.security.cert.Certificate[]) chain,
null, PdfSignatureAppearance.WINCER_SIGNED);
...
stp.close();
for big files I used this code:
...
PdfReader reader = new PdfReader(new
RandomAccessFileOrArray(SRC, false, true),null);
FileOutputStream fout = new FileOutputStream(DST);
PdfStamper stp = PdfStamper.createSignature(reader, new
BufferedOutputStream(fout), '\0', new File(DST+".temp"), true);
PdfSignatureAppearance sap = stp.getSignatureAppearance();
sap.setCrypto(key,(java.security.cert.Certificate[]) chain,
null, PdfSignatureAppearance.WINCER_SIGNED);
...
stp.close();
But, when I open the signed file using Adabe reader, the signature panel
doesn't appear.
I tried this for small and big PDF files
small PDF size: 280kb
big PDF size: 67.7mb
Please, help me... thanks in advance,
RobertQ.
--
View this message in context:
http://www.nabble.com/Using-RandomAccessFileOrArray-for-big-files%2C-BUT-signature-doesn%27t-appear.-Help-me...-tp23551781p23551781.html
Sent from the iText - General mailing list archive at Nabble.com.
------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables
unlimited royalty-free distribution of the report engine
for externally facing server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
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/