The PDF format needs random access, there's no way around. Your best option is 
to write the revision to a file and process it from there using the PdfReader 
constructor with the RandomAccessFileOrArray as a parameter.

Paulo 

> -----Original Message-----
> From: Adriano Santoni [mailto:[email protected]] 
> Sent: Tuesday, September 15, 2009 10:07 AM
> To: [email protected]
> Subject: [iText-questions] Memory problems when signing revisions
> 
> Hello,
> 
> I am not sure whether this question has been posted before; I 
> have done some search in the mailing lists archives but found 
> nothing...
> 
> We have big problems when applying more than one digital 
> signatures to a moderately large PDF document (say, more than 
> a few MB). Starting from the second one, each subsequent 
> signature is done over a revision, which can only be obtained 
> as an InputStream. 
> 
> Unfortunately, when a PdfReader is instantiated from an 
> InputStream it reads it all in memory (we have checked this 
> in the sources, to be sure), consuming huge amounts of 
> virtual memory (especially when the document is a highly 
> structured one), which eventually causes the application (and 
> the PC) to hang.
> 
> Sadly, a RandomAccessFile - which I know to be the only 
> efficient alternative - cannot be costructed from an 
> InputStream; so a RandomAccessFile can only be used when 
> doing the first (top level) signature, but not when the 
> subsequent signatures are to be applied, because they are 
> applied to revisions...
> 
> Is there a way to avoid such a severe memory problem when 
> signing a revision?
> 
> TIA to all volunteers,
>   defacto
> 
> 

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.


------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
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