startin Fop with Stream objects

2001-10-12 Thread Ursprung Manfred

I use Fop in a servlet to generate PDF output from dynamic generated data.
To start fop in a servlet xml xsl resource have to be a file (according to
FAQ). 

So I have to store my dynamic xml data in a file. 
But I want my Java Stream object to be passed to Fop.
Is it possible ?
Is it on todo list ?

- Manfred

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




RE: startin Fop with Stream objects

2001-10-12 Thread Menday, Roger


Hi !

Don't know if this is helpful, but I am using the following code, to
take a JDOM document which I input to FOP as a stream (inside the run
method).
I got most of this code from the JDOM faqs, and from other sources on
the internet. 

Roger

---

 public static void renderFO(final Document doc, HttpServletResponse
res) throws IOException, JDOMException, FOPException
  {
// Use I/O streams for source files
PipedInputStream sourceIn = new PipedInputStream();
final PipedOutputStream sourceOut = new PipedOutputStream(sourceIn);
InputSource source = new InputSource(sourceIn);

ByteArrayOutputStream out=new ByteArrayOutputStream();
res.setContentType(application/pdf);

new Thread(new Runnable()
{
  public void run()
  {
try
{
  XMLOutputter xmlOutputter=new XMLOutputter();
  xmlOutputter.output(doc, sourceOut);
  sourceOut.close();
}
catch (IOException e)
{
  e.printStackTrace();
}
  }
}).start();

Driver driver=new Driver(source, out);
driver.run();

byte[] content=out.toByteArray();
res.setContentLength(content.length);
res.getOutputStream().write(content);
res.getOutputStream().flush();
  }


 -Original Message-
 From: Ursprung Manfred [mailto:[EMAIL PROTECTED]]
 Sent: 12 October 2001 10:52
 To: Fop-Liste (E-Mail)
 Subject: startin Fop with Stream objects
 
 I use Fop in a servlet to generate PDF output from dynamic generated
data.
 To start fop in a servlet xml xsl resource have to be a file
(according
 to
 FAQ).
 
 So I have to store my dynamic xml data in a file.
 But I want my Java Stream object to be passed to Fop.
 Is it possible ?
 Is it on todo list ?
 
 - Manfred
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, email: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




AW: startin Fop with Stream objects

2001-10-12 Thread Beer, Christian

Hi!

Look into the API-Doku! 

There is a constructor:
public Driver(org.xml.sax.InputSource source, 
  java.io.OutputStream stream) 


And if you look into org.xml.sax.InputSource there is:
InputSource(InputStream byteStream) 
  Create a new input source with a byte stream. 
InputSource(Reader characterStream) 
  Create a new input source with a character stream. 
InputSource(String systemId) 
  Create a new input source with a system identifier. 

So there is no problem!!!

Greetings
Christian

-Ursprüngliche Nachricht-
Von: Ursprung Manfred [mailto:[EMAIL PROTECTED]]
Gesendet: Freitag, 12. Oktober 2001 11:52
An: Fop-Liste (E-Mail)
Betreff: startin Fop with Stream objects


I use Fop in a servlet to generate PDF output from dynamic generated data.
To start fop in a servlet xml xsl resource have to be a file (according to
FAQ). 

So I have to store my dynamic xml data in a file. 
But I want my Java Stream object to be passed to Fop.
Is it possible ?
Is it on todo list ?

- Manfred

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]