iText doesn't keep the images in memory. I ran the following code 
with -Xmx64m:

for (int k = 0; k < 1000; ++k) {
    Image img = Image.getInstance("c:\\babytux.png");
    img.scalePercent(30);
    document.add(img);
}

This resulted in a 130M PDF file with 334 pages. Your problem is somewhere 
else.

Paulo

----- Original Message ----- 
From: "gscac" <[EMAIL PROTECTED]>
To: <itext-questions@lists.sourceforge.net>
Sent: Wednesday, June 13, 2007 10:41 AM
Subject: Re: [iText-questions] Memory issue while adding images in document


>
> Already the memory size is set to 512M.
>
>
> Paulo Soares wrote:
>>
>> Increase the memory allocated to the JVM. The default 64M are usually too
>> little.
>>
>> Paulo
>>
>> ----- Original Message ----- 
>> From: "gscac" <[EMAIL PROTECTED]>
>> To: <itext-questions@lists.sourceforge.net>
>> Sent: Saturday, June 09, 2007 5:28 PM
>> Subject: [iText-questions] Memory issue while adding images in document
>>
>>
>>>
>>> I am adding 100 images into the pdf document. After adding 90 images, 
>>> the
>>> program throws outof memory exception.
>>>
>>> for(int i = 0; i<100;i++){
>>> Image img = Image.getInstance(url) ;
>>> document.add(img);
>>> }
>>>
>>> How can I avoid this memory issue?


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
iText-questions mailing list
iText-questions@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to