W3C home > Mailing lists > Public > www-xsl-fo@w3.org > June 2002

RE: embedding fop

From: Scott, Chris <ScottC@westinghouse.com>
Date: Thu, 20 Jun 2002 10:11:12 -0400
Message-ID: <2052C51FEE2DD611AE5F0002A59305F17AC37A@swec9900.pgh.wec.com>
To: "'www-xsl-fo@w3.org'" <www-xsl-fo@w3.org>

try redirecting and playing with the stream i.e.

private ByteArrayOutputStream xmlFoStream;
...
> driver.setOutputStream(xmlFoStream);
> 
InputSource xmlfoInput = new InputSource(new
ByteArrayInputStream(xmlFoStream.toByteArray()));

> driver.render(parser, xmlfoInput);
> 
========================
Christopher Scott
Westinghouse Electric Company


> ----------
> From: 	Seema Bhatnagar[SMTP:seema.bhatnagar@systor.com]
> Sent: 	Thursday, June 20, 2002 9:28 AM
> To: 	www-xsl-fo@w3.org
> Subject: 	embedding fop 
> 
> 
> I am generating pdf using the  xslt processor.
> Code goes like this.
>           XMLReader parser = XMLReaderFactory.createXMLReader
> ("org.apache.xerces.parsers.SAXParser");
> 
>           Driver driver = new org.apache.fop.apps.Driver();
>           parser.setContentHandler(driver.getContentHandler());
>           driver.setXMLReader(parser);
>           driver.setRenderer(Driver.RENDER_PDF);
> 
>             driver.addElementMapping
> ("org.apache.fop.fo.StandardElementMapping");
>  
> driver.addElementMapping("org.apache.fop.svg.SVGElementMapping");
>           driver.setOutputStream(out);
> 
>           driver.render(parser, new InputSource("c:\\temp.fo"));
> 
> 
> it is perfectly generating pdf.
> But i want to avoid giving the 'temp.fo'  file which is being generared by
> the xsltresult of xslt processor.
> Could anybody tell me , is there a way to generate the pdf without giving
> the fo file, but the output stream or something else.
> thanks.
> seema
> 
Received on Thursday, 20 June 2002 10:15:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 3 October 2007 16:06:09 GMT