jQuery in Action, 3rd edition
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
Rancher

Joined: Mar 22, 2005
Posts: 42958
    
  73
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.
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: 17168
    
  27

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.


An IDE is no substitute for an Intelligent Developer.
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: 17168
    
  27

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
 
It's not a secret anymore!