You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by Philippe PITHON <pp...@sigal.fr> on 2003/12/10 09:11:34 UTC

gain memory

Hello !

 

I would like to improve the code below 

 

 

2 questions :

- java says to me that input.getParser() & input.getInputSource() are
deprecated

what is necessary to use in the place ?

 

- to gain memory, are my files well closed? 

 

-------

 

XSLTInputHandler input = new XSLTInputHandler(new File(xml),new
File(xsl));

ByteArrayOutputStream out = new ByteArrayOutputStream();

Driver driver = new Driver();

driver.setLogger(loggerFop);

driver.setRenderer(Driver.RENDER_PDF);

driver.setOutputStream(out);

driver.render(input.getParser(),input.getInputSource());

byte[] content = out.toByteArray();

FileOutputStream fos = new FileOutputStream(pdf);

fos.write(content);


Re: gain memory

Posted by Glen Mazza <gr...@yahoo.com>.
Please use the JAXP standard instead of the
XSLTInputHandler wrapper.  Look at the
ExampleXML2PDF.java in:

http://cvs.apache.org/viewcvs.cgi/xml-fop/examples/embedding/java/embedding/

Glen

--- Philippe PITHON <pp...@sigal.fr> wrote:
> Hello !
> 
>  
> 
> I would like to improve the code below 
> 
>  
> 
>  
> 
> 2 questions :
> 
> - java says to me that input.getParser() &
> input.getInputSource() are
> deprecated
> 
> what is necessary to use in the place ?
> 
>  
> 
> - to gain memory, are my files well closed? 
> 
>  
> 
> -------
> 
>  
> 
> XSLTInputHandler input = new XSLTInputHandler(new
> File(xml),new
> File(xsl));
> 
> ByteArrayOutputStream out = new
> ByteArrayOutputStream();
> 
> Driver driver = new Driver();
> 
> driver.setLogger(loggerFop);
> 
> driver.setRenderer(Driver.RENDER_PDF);
> 
> driver.setOutputStream(out);
> 
>
driver.render(input.getParser(),input.getInputSource());
> 
> byte[] content = out.toByteArray();
> 
> FileOutputStream fos = new FileOutputStream(pdf);
> 
> fos.write(content);
> 
> 


__________________________________
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-user-help@xml.apache.org