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 Slavko Dzalto <Sl...@triology.de> on 2004/07/26 13:32:38 UTC

FOP 0.20.5 and XDK 10.10.0.2.0

Hello,

 

I tried to use FOP 0.20.5 and XDK 10.10.0.2.0 but they don´t work together.
If I use an older version of the XDK it works but I have to use the new one.

 

The XDK needs a XSQLFOPSerializer class. The code of this class is at the
bottom.

 

I would by happy if someone can help me.

 

 

 

package oracle.xml.xsql.serializers;

 

import org.w3c.dom.Document;

import org.apache.fop.messaging.MessageHandler;

import oracle.xml.xsql.XSQLPageRequest;

import oracle.xml.xsql.XSQLDocumentSerializer;

import org.apache.fop.apps.Driver;

import org.apache.avalon.framework.logger.Logger;

import org.apache.avalon.framework.logger.ConsoleLogger;

 

/**

* Tested with the FOP 0.20.3RC release from 19-Jan-2002

*/

public class XSQLFOPSerializer implements XSQLDocumentSerializer {

private static final String PDFMIME = "application/pdf";

public void serialize(Document doc, XSQLPageRequest env) throws Throwable {

try {

 

// First make sure we can load the driver

Driver FOPDriver = new Driver();

 

// Tell FOP not to spit out any messages by default.

// You can modify this code to create your own FOP Serializer

// that logs the output to one of many different logger targets

// using the Apache LogKit API

Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);

MessageHandler.setScreenLogger(logger);

FOPDriver.setLogger(logger);

 

// Some of FOP's messages appear to still use MessageHandler.

MessageHandler.setOutputMethod(MessageHandler.NONE);

 

// Then set the content type before getting the reader/

env.setContentType(PDFMIME);

 

FOPDriver.setOutputStream(env.getOutputStream());

FOPDriver.setRenderer(FOPDriver.RENDER_PDF);

FOPDriver.render(doc);

}

catch (Exception e) {

// Cannot write PDF output for the error anyway.

// So maybe this stack trace will be useful info

e.printStackTrace(System.err);

}

}

}

 


Re: FOP 0.20.5 and XDK 10.10.0.2.0

Posted by "Peter B. West" <pb...@tpg.com.au>.
Jörg, I love your work.

Peter

J.Pietschmann wrote:
> Slavko Dzalto wrote:
> 
>> I tried to use FOP 0.20.5 and XDK 10.10.0.2.0 but they don´t work 
>> together. If I use an older version of the XDK it works but I have to 
>> use the new one.
> 
> 
> Are there any details available about the "don't work
> together" part? Like: error messages, stack traces,
> browser behaviour description etc.
> 
> J.Pietschmann

-- 
Peter B. West <http://cv.pbw.id.au/>

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


Re: FOP 0.20.5 and XDK 10.10.0.2.0

Posted by Glen Mazza <gr...@yahoo.com>.
My thinking is that this might be an question for a
relevant Oracle ML (one for JDeveloper, perhaps). 
IIRC  their XDK incorporates FOP 0.20.4.

Another option for Slavko might be: can you use FOP
separate from the XDK?  I.e., perhaps just use the XDK
to get the XML, and then use FOP "natively" to
generate the PDF.  You may wish to look at our
embedding examples
http://xml.apache.org/fop/embedding.html to see if you
can use FOP in this manner.

Glen

--- "J.Pietschmann" <j3...@yahoo.de> wrote:
> Slavko Dzalto wrote:
> > I tried to use FOP 0.20.5 and XDK 10.10.0.2.0 but
> they don�t work 
> > together. If I use an older version of the XDK it
> works but I have to 
> > use the new one.
> 
> Are there any details available about the "don't
> work
> together" part? Like: error messages, stack traces,
> browser behaviour description etc.
> 
> J.Pietschmann


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


Re: FOP 0.20.5 and XDK 10.10.0.2.0

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Slavko Dzalto wrote:
> I tried to use FOP 0.20.5 and XDK 10.10.0.2.0 but they don´t work 
> together. If I use an older version of the XDK it works but I have to 
> use the new one.

Are there any details available about the "don't work
together" part? Like: error messages, stack traces,
browser behaviour description etc.

J.Pietschmann

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


AW: FOP 0.20.5 and XDK 10.10.0.2.0

Posted by Slavko Dzalto <Sl...@triology.de>.
Hello,

 

they work together now. I have compiled the XSQLFOPSerializer but Apache
Tomcat used only the old one. In my solution I gave the XSQLFOPSerializer a
new name and it works now.

 

Slavko Dzalto

 

  _____  

Von: Slavko Dzalto [mailto:Slavko.Dzalto@triology.de] 
Gesendet: Montag, 26. Juli 2004 13:33
An: Apache Mailinglist FOP
Betreff: FOP 0.20.5 and XDK 10.10.0.2.0

 

Hello,

 

I tried to use FOP 0.20.5 and XDK 10.10.0.2.0 but they don´t work together.
If I use an older version of the XDK it works but I have to use the new one.

 

The XDK needs a XSQLFOPSerializer class. The code of this class is at the
bottom.

 

I would by happy if someone can help me.

 

 

 

package oracle.xml.xsql.serializers;

 

import org.w3c.dom.Document;

import org.apache.fop.messaging.MessageHandler;

import oracle.xml.xsql.XSQLPageRequest;

import oracle.xml.xsql.XSQLDocumentSerializer;

import org.apache.fop.apps.Driver;

import org.apache.avalon.framework.logger.Logger;

import org.apache.avalon.framework.logger.ConsoleLogger;

 

/**

* Tested with the FOP 0.20.3RC release from 19-Jan-2002

*/

public class XSQLFOPSerializer implements XSQLDocumentSerializer {

private static final String PDFMIME = "application/pdf";

public void serialize(Document doc, XSQLPageRequest env) throws Throwable {

try {

 

// First make sure we can load the driver

Driver FOPDriver = new Driver();

 

// Tell FOP not to spit out any messages by default.

// You can modify this code to create your own FOP Serializer

// that logs the output to one of many different logger targets

// using the Apache LogKit API

Logger logger = new ConsoleLogger(ConsoleLogger.LEVEL_INFO);

MessageHandler.setScreenLogger(logger);

FOPDriver.setLogger(logger);

 

// Some of FOP's messages appear to still use MessageHandler.

MessageHandler.setOutputMethod(MessageHandler.NONE);

 

// Then set the content type before getting the reader/

env.setContentType(PDFMIME);

 

FOPDriver.setOutputStream(env.getOutputStream());

FOPDriver.setRenderer(FOPDriver.RENDER_PDF);

FOPDriver.render(doc);

}

catch (Exception e) {

// Cannot write PDF output for the error anyway.

// So maybe this stack trace will be useful info

e.printStackTrace(System.err);

}

}

}