File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes Exception in reading PDF using java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "Exception in reading PDF using java" Watch "Exception in reading PDF using java" New topic
Author

Exception in reading PDF using java

karmegam shiva
Greenhorn

Joined: Feb 18, 2013
Posts: 7
0 down vote favorite


i have a problem with reading PDF file content in java using itextpdf.jar ,

if i read a small sized(5-15MB) PDF file means its working well, it is possible to read it's contents

but when i read large sized(200MB) PDF file means its showing Run time exception like following




Any possible answer for this, i am using Tomcat 7, windows xp
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41800
    
  62
How much memory does the Tomcat have assigned? I would imagine that the in-memory representation of a PDF is several times its file size.


Ping & DNS - my free Android networking tools app
karmegam shiva
Greenhorn

Joined: Feb 18, 2013
Posts: 7
i am using windows XP so default size of heap memory is 64 MB, how can i increase the heap memory size for tomcat.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

karmegam shiva wrote:i am using windows XP so default size of heap memory is 64 MB, how can i increase the heap memory size for tomcat.


You increase Tomcat's JVM memory allowance using the -Xmx JVM parameter. You can set the JAVA_OPTS environment variable in a script named TOMCAT_HOME\bin\setenv.bat that you create and place the parameter there.

For more info, ask in the Tomcat forum.


Customer surveys are for companies who didn't pay proper attention to begin with.
karmegam shiva
Greenhorn

Joined: Feb 18, 2013
Posts: 7
Tim Holloway wrote:You can set the JAVA_OPTS environment variable in a script named TOMCAT_HOME\bin\setenv.bat .


Thanks for your points Tim, but actually i am using it in windows XP , i didn't see setenv.bat any where including \bin .
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16054
    
  21

You won't. You have to create it yourself. Put a SET JAVA_OPTS="-Xmx=256m" or something like that in it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Exception in reading PDF using java