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.
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");
driver.setRenderer(Driver.RENDER_PDF); driver.setOutputStream(out); //driver.setLogger(log);
try { driver.render(document); } catch (Exception ex) { NSLog.err.appendln("PDF: render: " + ex); }
response.setContent(new NSData(out.toByteArray())); response.setHeader("application/pdf", "Content-Type");
} I basically took this function right out of an example, but I did comment out the lines that instantiate the logger because those classes are no longer part of the project. At one point I was debugging and commented out the setContent line and changed the setHeader to "text/xml" and I got a text file that contained the correct xml from the .wo file.
The links were great, thanks very much.
Zac On Mar 21, 2006, at 4:40 AM, Zak Burke wrote: Zac Konopa wrote on 3/20/06 7:01 PM: Does anyone know of any online resource where they walk you through the installation and use of the FOP module, preferably in a webobjects environment? Failing that any suggestions?
The following post includes sample code for using WO with with a pre-built binary of Apache FOP 0.90 (there are significant differences between the 0.20.x and 0.90.branches):
I found the following reference, by the guy who wrote the O'Reilly book, very helpful. Start with the "Gentle Introduction" and "Basic FO page" sections.
zak.
|