Hi, We have fop_bin_0_14_0.jar to convert the XML to PDF. I'm trying to convert the hugh XML file into PDF and i'm getting the following error. Exception in thread "main" java.lang.OutOfMemoryError This is the showstopper and business is complaining that they couldn't run the hugh PDF reports. Could someone tell me on how to resolve this issue. Thanks, Nathan
First: FOP 0.14 is ancient, you are advised to update to a more recent release, even if though it probably causes much pain due to adapting to the standard. Second: The hints here http://xmlgraphics.apache.org/fop/0.94/running.html#memory also apply. Third: if the problem persists for the latest FOP release and further fine tuning, you'll need to provide more details about your task and your environment, preferably including the FO file causing the memory overflow.
I've increased the java heap size but still i'm getting memory error. I'm pasting the XML and fo file here. Please let me know what is the problem XML file: There are three columns. Third column benchmark has multiple lines tagged within <LINE> - <composite_data> <composite_id>TC104</composite_id> <composite_name>Diversified Large Cap Core Composite (TC104)</composite_name> <composite_status>A</composite_status> <composite_strategy>The investment objective of this composite is to provide excess returns over the S&P 500 Index through active stock selection while maintaining portfolio risk characteristics similar to the market.</composite_strategy> - <benchmark> <LINE>From: 30/09/1990</LINE> <LINE>Standard & Poor's 500 Index</LINE> </benchmark> </composite_data> FO file: <fo:table> <fo:table-column column-width="6cm"/> <fo:table-column column-width="12cm"/> <fo:table-column column-width="10cm"/> <fo:table-body font-family="Times Roman" font-size="10pt" line-height="15pt" font-weight="normal"> <xsl:for-each select="//composite_data[composite_status = 'A']"> <xsl:sort select="composite_id" data-type="text"/> <fo:table-row> <fo:table-cell padding-top="3mm"><fo:block> <xsl:value-of select="composite_name"/> </fo:block></fo:table-cell> <fo:table-cell padding-top="3mm" padding-left="1cm"><fo:block> <xsl:value-of select="composite_strategy"/> </fo:block></fo:table-cell> <fo:table-cell padding-top="3mm" padding-left="1cm"><fo:block> <xsl:for-each select="benchmark"> <xsl:for-each select="LINE"> <fo:block> <xsl:value-of select="."/> </fo:block> </xsl:for-each> </xsl:for-each> </fo:block> </fo:table-cell> </fo:table-row> </xsl:for-each> </fo:table-body> </fo:table> Basically fo:block for each LINE is giving memory issue. If i remove it, all the lines are wrapped together in 3rd column but i want in seperate lines. Is there any way that i can display multi-records in a table-cell. Thanks, Nathan
(In reply to comment #2) > I've increased the java heap size but still i'm getting memory error. I'm > pasting the XML and fo file here. Please let me know what is the problem <snip /> > <fo:table-cell padding-top="3mm" padding-left="1cm"> > <fo:block> > <xsl:for-each select="benchmark"> > <xsl:for-each select="LINE"> > <fo:block> > <xsl:value-of select="."/> > </fo:block> > </xsl:for-each> > </xsl:for-each> Try: <fo:table-cell...> <fo:block linefeed-treatment="preserve"> <xsl:for-each select="benchmark"> <xsl:for-each select="LINE"> <xsl:value-of select="."/> <xsl:text>
</xsl:text> </xsl:for-each> </xsl:for-each> Please let us know if this alleviates the problem. I suspect so, but I'm not 100% certain. Thanks!
Your solution didn't give any memory error. Thank you so much. But all the records in 3rd column are wrapped in single line as follows: column1 column2 column3 comp1 comp1 strat From: 30/09/1990 Standard & Poor's 500 Index But i want the record to be displayed in multi-line as below. column1 column2 column3 comp1 comp1 strat From: 30/09/1990 Standard & Poor's 500 Index Can you suggest something which can display the records in multi-line. Thanks, Nathan
(In reply to comment #4) > Your solution didn't give any memory error. Thank you so much. But all the > records in 3rd column are wrapped in single line as follows: > > column1 column2 column3 > comp1 comp1 strat From: 30/09/1990 Standard & Poor's 500 Index > > But i want the record to be displayed in multi-line as below. > > column1 column2 column3 > comp1 comp1 strat From: 30/09/1990 > Standard & Poor's 500 Index > > Can you suggest something which can display the records in multi-line. That's what the linefeed character (
) is for. That should work, unless... Do you have a keep-together or keep-with-next/-previous specified on the rows or the table. In that case, you probably want to change this to an explicit keep-together.within-page, keep-with-previous.within-page. If the component 'within-page' is not explicitly used, then keep-together also means keep-together.within-line, which overrides preserved linefeeds.
(In reply to comment #5) > > That's what the linefeed character (
) is for. That should work, unless... Just noticed that I did not yet ask: which FOP version? linefeed-treatment=preserve does not work in FOP 0.20.5. In case you're still using that version, it's time to upgrade...
I'm using FOP 0.14 version fo xalan commandline.
Can anyone suggest me what do i need to do in order to print the multi-records in seperate lines within a table-cell? Thanks, Nathan
Created attachment 21664 [details] xmlandxsl I've attached the zip file. Please review it and let me know.
FWIW: Nathan just confirmed to me off-list that a slightly tweaked version of the original stylesheet, using preserved linefeeds instead of nested blocks, renders fine with FOP 0.94 and does not cause memory issues with default heap settings.
*** This bug has been marked as a duplicate of bug 1063 ***
batch transition resolved+duplicate to closed+duplicate