• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: setting up apache FOP
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: setting up apache FOP


  • Subject: Re: setting up apache FOP
  • From: Zac Konopa <email@hidden>
  • Date: Tue, 21 Mar 2006 11:47:41 -0800

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):

http://www.omnigroup.com/mailman/archive/webobjects-dev/2005-December/001603.html

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.

http://www.dpawson.co.uk/xsl/sect3/

zak.


 _______________________________________________
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

  • Follow-Ups:
    • Re: setting up apache FOP
      • From: Arturo Perez <email@hidden>
References: 
 >setting up apache FOP (From: Zac Konopa <email@hidden>)
 >Re: setting up apache FOP (From: Zak Burke <email@hidden>)

  • Prev by Date: Re: help for Objective C
  • Next by Date: Re: help for Objective C
  • Previous by thread: Re: setting up apache FOP
  • Next by thread: Re: setting up apache FOP
  • Index(es):
    • Date
    • Thread