Re: setting up apache FOP
Re: setting up apache FOP
- Subject: Re: setting up apache FOP
- From: Arturo Perez <email@hidden>
- Date: Tue, 21 Mar 2006 14:54:57 -0500
Zac Konopa wrote:
Is there a functionality difference between the two branches? I got
the impression from apache's documentation that the .90 distro is
considered "unstable". On top of that all the examples I could find
were for .20 so that's what I've been trying to use. If .90 is
significantly better (ie easier) I'll switch.
They recommend that you do not use 0.90. Plus it is more strict and
renders differently than 0.20.
Btw I have some further information on the specific problem I'm
encountering. What I've got is a *.wo file that contains fo code. I
know that this code is valid because I can run fop from the command
line and get a perfect PDF file just like I want. I setup the *.java
file to extend a FO2PDFSerializer.java class, which extends the
WOComponent class. The FO2PDFSerializer class overides the
appendToResponse method with the following:
public void appendToResponse(WOResponse response, WOContext context) {
super.appendToResponse(response, context);
Document document = response.contentAsDOMDocument();
ByteArrayOutputStream out = new ByteArrayOutputStream();
Driver driver = new Driver();
//Logger log =
Hierarchy.getDefaultHierarchy().getLoggerFor("fop");
Apache FOP logging is a black art. Here's what I do.
// driver requires a logger but we're getting errors via
MessageListener
driver.setLogger(new NullLogger());
// Set up logging via message event handler
MessageHandler.setOutputMethod(MessageHandler.EVENT);
MessageHandler.addListener(msgLogger);
The msgLogger above implements MessageListener and you can log or output
the errors in whatever form is most convenient to you.
Once you confirm that the FOP is proceeding without errors then we're
back in the land of WebObjects :-)
-arturo
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden