Op 18/02/2011 11:11, sv_srinivaas schreef: > Hi, I'm using iText 5.0.3 to encrypt an existing PDF (of size 10mb) using the > PDFStamper.setEncryption() method but it takes more than 100mb of of memory. > Basically I want the document permission to be set to PRINT only. > > Normally I use the RandomAccessFileOrArray for the PdfReader and PDFStamper > with append = true to modify PDF contents so that it takes less memory. But > in the case of encryption I can't use append=true and hence I'm forced to > not use RandomAccessFileOrArray for my PdfReader.
That was explained on the forum a while ago: http://support.itextpdf.com/node/22 > Because if I use append=false and RandomAccessFileOrArray for PdfReader then > it takes more than 5 minutes to do the encryption, whereas if I don't use > RandomAccessFileOrArray then it consumes 100mb of memory for encrypting a > 10mb file and 250mb for a 45mb file. That's the trade-off you have to make, yes. ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ iText-questions mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/itext-questions 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
