Hi,

Is the pdf you are reading a single file that is 1.5gb? If so, I guess you
should try doing this in multiple passes. You should read 6.1.2 of iText
second edition. Simply, read the first acceptable number of pages and on the
second run read that many more starting where you left.

You might also try providing BufferedInputStream to PdfReader which should
not be reading the whole file into memory but this may possibly be slower if
PdfReader needs to access file randomly.

If you have the issue when writing the pdf as well, then I would ask if you
are keeping the output stream in memory until pdf is finished when writing
to disk. If so, you should avoid doing that or reserve that much of memory
to JVM.

Good luck
Nurettin

On Thu, Dec 2, 2010 at 3:40 AM, LA <[email protected]> wrote:

>
> Hi,
> i have to read and re-write a 1.5gb pdf file, i try wtih
> PdfReader reader = new PdfReader(new RandomAccessFileOrArray("big
> file.pdf"),null);
> but the program throws out of memory exception
>
> How can i solve the problem?
>
> Thank You
> LA
> --
> View this message in context:
> http://itext-general.2136553.n4.nabble.com/READ-LARGE-FILE-1-5gb-Error-tp3068682p3068682.html
> Sent from the iText - General mailing list archive at Nabble.com.
>
>
> ------------------------------------------------------------------------------
> Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
> Tap into the largest installed PC base & get more eyes on your game by
> optimizing for Intel(R) Graphics Technology. Get started today with the
> Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
> http://p.sf.net/sfu/intelisp-dev2dev
> _______________________________________________
> 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
>



-- 
Nurettin DAG
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
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

Reply via email to