Exporting a report as a PDF results in the error message 'Java.Lang.OutOfMemoryError: Java Heap Space'. See image below:


The FOP program is failing to generate the PDF.

FOP program's memory allocation is too small to generate the PDF.


FOP program's memory allocation needs to be increased.

Open the FOP batch file: C:\Program Files (x86)\FOP\fop.bat in a text editor.

Add in this line to the file before the ENDLOCAL tag at the bottom of the file:

"C:\Program Files (x86)\Sage\CRM\Services\JRE\jre8\bin\java.exe" -Xmx1024m %JAVAOPTS% %LOGCHOICE% %LOGLEVEL% -cp "%LOCALCLASSPATH%" %FOP_OPTS% org.apache.fop.cli.Main %FOP_CMD_LINE_ARGS% -c conf/userconfig.xml

There may be a line there silmilar to this there already.

The main thing to be added is: "-Xmx1024m".

This should be added after the java addess and before "%JAVAOPTS%".

Save this and do an iisreset.

The report should now be available to export as a PDF.


More information: