The user config options are static, so you can call this anywhere before you start you create your driver.  You only have to call this once.

import org.apache.fop.apps.Options;

// Declare our FOP User Config file (this is where we get our fonts)
File userConfigFile = new File( "userconfig.xml" );
org.apache.fop.apps.Options options = new org.apache.fop.apps.Options( "userconfig.xml" );



[EMAIL PROTECTED]

10/08/02 09:10 AM
Please respond to fop-dev

       
        To:        [EMAIL PROTECTED]
        cc:        
        Subject:        Setting the user configuration in embedded code



Hi, wonder if anyone can help.

I am trying to set the user configuratuion file with FOP embedded in my
app.


        java.io.BufferedOutputStream bufferedOutputStream = null;
        org.apache.fop.apps.Driver   driver               = null;
        java.io.ByteArrayInputStream byteArrayInputStream = null;

        // file to write output to
        bufferedOutputStream = new java.io.BufferedOutputStream (
outputStream );

        // create FOP object with arguments, and run it
        byteArrayInputStream = new java.io.ByteArrayInputStream
           ( this.writeXML ( document, true ).getBytes ( ) );
        driver = new org.apache.fop.apps.Driver ( new
org.xml.sax.InputSource ( byteArrayInputStream ), bufferedOutputStream );

        // render pdf to file
        driver.setRenderer ( driver.RENDER_PDF );
        driver.run ( );

        // close file
        bufferedOutputStream.close ( );


I would like to specify some options for loading custom fonts.


Has anyone done this or know how to load a user config file in code. ANy
help would be appreciated.


Regards


Paul.



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



Reply via email to