Op 23/01/2013 11:11, Andreas Kuehne schreef:
> Afaik iText does this in memory, but I would love to learn that I'm wrong.

For large files, you can write the file to disk. See 
http://itextpdf.com/book/digitalsignatures

2.2.4 Signing large PDF files
When you use the createSignature() method as shown in code sample 2.1, 
iText will create a copy of the document you’re about to sign in memory, 
leaving the bytes that are reserved for the signature blank. iText needs 
this copy so that it can provide the bytes that need to be hashed and 
signed. This can be problematic for files with a large file size: you 
risk OutOfMemoryExceptions.
Take a look at code sample 2.4 if you want to store the copy on disk 
instead of keeping it in memory:
[...]
NOTE: if you use the createSignature() method with a temporary file, you 
can use an OutputStream that is null, in that case, the temporary file 
will serve as the actual destination file. This is good practice if your 
goal is to store a signed file on your file system. If the OutputStream 
is not null, iText will always try to delete the temporary file after 
the signing is done.

------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnnow-d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to