xsl-list
[Top] [All Lists]

Re: [xsl] Fw: pdf file using xsl

2006-03-29 09:17:36
James,
        Thanks for the response.
        My report size could grow from 1MB to 1GB, it entirely depends on 
the user's selection. So if decides to get a big report, say 500 MB, I'll 
have to allocate 5*500=2.5GB of RAM. I was wondering if it's a possibility 
to stream the data instead of holding in memory.
        Not sure if the XML structure is complex, but I need to use 
xsl:for-each-group to process the xml. Apart from this, I broke the 
process as follows:
        1. Use xml and xsl to generate the FO object
        2. Use FOP to generate the pdf from FO object created in step-1.

        I am kind of okay with step-1, since it takes about 1-2 mins to 
process. But step 2 takes a long time, and doesn't give any result.
 
        Following is the code used to generate the pdf.
 
        Driver driver = new Driver();
        File outFile = new File("c:\\out.pdf");
                File inputFile = new File("c:\\in.pdf");        // This is 
the FO Object which is created using the XSLT-2.0 processor(Saxon8)
        OutputStream fopout = new FileOutputStream(outFile);
        driver.setOutputStream(fopout);
        driver.setRenderer(Driver.RENDER_PDF);
        driver.setInputSource(new InputSource(new 
FileInputStream(inputFile)));
        driver.run();
---
Neeraj Jain
3M HIS, 
8 King Road, Rockleigh
NJ. 07647 USA
Direct - 201 750 5931
njain(_at_)mmm(_dot_)com
neerajj(_at_)vmoksha(_dot_)com



James Neff <jneff(_at_)tethyshealth(_dot_)com> 
03/29/2006 10:59 AM
Please respond to
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com


To
xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
cc

Subject
Re: [xsl] Fw: pdf file using xsl






Neeraj,

Just real quick, try increasing the memory size much more.  Depending on
your XML structure (and how your processing it), the processor can use
up to 10 times the input file size in memory to apply a stylesheet to it.

Try setting it to 5-10 times what you have already.

--James


njain(_at_)mmm(_dot_)com wrote:

Hello,
I tried this message earlier but it bounced back. I am new to this
I am working on an application which requires me to generate a pdf file 
of up to 200MB size. I tried generating xml file and then apply xsl on it 

with the Apache FOP driver.

The result is "Out of Memory" error. I am not sure where the out of 
memory 
error is coming, in FOP code or in Saxon8(I am using Saxon processor and 
XSLT 2.0).

Could anyone please help me out and let me know what could be wrong.

PS: I have already tried to increase the JVM memory (-Xms218m -Xmx512m).

Regards.
Neeraj 

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--