>  -----Original Message-----
> From:         Wood, Kevin  
> Sent: Friday, January 03, 2003 8:47 AM
> To:   '[EMAIL PROTECTED]'
> Subject:      FW: Using FOP / trying to embed FOP
> 
> 
> 
> 
>  -----Original Message-----
> From:         Wood, Kevin  
> Sent: Friday, December 27, 2002 3:33 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      Using FOP / trying to embed FOP
> 
> Trying to embed FOP within Java.  I added code that the documentation stated was 
>necessary in order to embed FOP.  I compiled the code.  I get errors when 
>instantiating the FOP Driver class.  I apologize for this be lengthy.  
> 
> 
> -----------Executing my java code:------------------------------------  
> 
> My goal is to take one of the sample .fo files (simple.fo) and generate a pdf file.
> 
> 
> **************
> Error:********
> **************
> 
> 
> ----------------------------------------------------
> ----------------------------------------------------
> C:\fop-0.20.5rc>java embed simple.fo testembed.pdf
> argument1:  simple.fo
> argument2:  testembed.pdf
> 
> Exception in thread "main" java.lang.NoClassDefFoundError: 
>org/apache/fop/fo/PropertyList
> 
>         at org.apache.fop.apps.Driver.<init>(Driver.java:178)
>         at org.apache.fop.apps.Driver.<init>(Driver.java:186)
>         at embed.main(embed.java:60)
> 
> C:\fop-0.20.5rc>
> -----------------------------------------------------
> -----------------------------------------------------
> 
> 
> I can see a PropertyList.java file but no class file.
> 
> Compiling PropertyList.java gives the following error
> 
> ------------------------------------------------------
> ------------------------------------------------------
> C:\org\apache\fop\fo>javac PropertyList.java
> PropertyList.java:11: Class org.apache.fop.fo.properties.WritingMode not found in 
>import.
> import org.apache.fop.fo.properties.WritingMode;
>        ^
> 1 error
> 
> C:\org\apache\fop\fo>
> ------------------------------------------------------
> ------------------------------------------------------
> 
> 
> There is only one file (package.html) in the org.apache.fop.fo.properties.
> 
> This file states the following:
> 
> "> Classes representing XSL-FO properties (See 7 of the XSL 1.0 Standard).> "> 
> 
> 
> 
> 
> ************* Questions ****************************************
> ****************************************************************
> 
> Problem locating these files...Where do I get them?  
> Are there any steps that I need to do in order to get this to work?  
> What is the purpose for building FOP?
> Is there anything wrong with my code located below?
> 
> 
> 
> 
> 
> *********************************************************
> My Java code:  ******************************************
> *********************************************************
> 
> 
> I had to add a lot of import statements to get the code to compile.
> 
> 
> import java.util.*;
> import java.text.*;
> import org.apache.fop.apps.Driver;
> import org.xml.sax.InputSource;
> import org.apache.avalon.framework.logger.ConsoleLogger;
> import org.apache.avalon.framework.logger.Logger;
> 
> 
> // FOP
> import org.apache.fop.fo.*;
> import org.apache.fop.configuration.Configuration;
> import org.apache.fop.configuration.ConfigurationReader;
> import org.apache.fop.fo.ElementMapping;
> import org.apache.fop.fo.FOTreeBuilder;
> import org.apache.fop.render.Renderer;
> //import org.apache.fop.render.pdf.PDFRenderer;
> import org.apache.fop.tools.DocumentInputSource;
> import org.apache.fop.tools.DocumentReader;
> import org.apache.fop.messaging.MessageHandler;
> 
> // Avalon
> import org.apache.avalon.framework.logger.ConsoleLogger;
> import org.apache.avalon.framework.logger.Logger;
> 
> // DOM
> import org.w3c.dom.Document;
> 
> // SAX
> import org.xml.sax.ContentHandler;
> import org.xml.sax.InputSource;
> import org.xml.sax.SAXException;
> import org.xml.sax.XMLReader;
> 
> 
> // Java
> import java.io.BufferedReader;
> import java.io.InputStreamReader;> 
> import java.io.InputStream;
> import java.io.IOException;
> import java.io.OutputStream;
> import java.util.Enumeration;
> import java.util.HashMap;
> import java.util.Vector;
> 
> //import java.io.OutputStream;
> import java.io.*;
> 
> 
> //import org.apache.avalon.ramwork.logger.Logger;
> 
> public class embed
> {
>       public static void main(String[] args)
>       {
> 
>               try{
>           System.out.println("argument1:  " + args[0]);
>           System.out.println("argument2:  " + args[1]);
> 
>               Driver driver = new Driver (new InputSource (args[0]),
>                                           new FileOutputStream(args[1]));
>               driver.setRenderer(Driver.RENDER_PDF);
> 
> 
>               driver.run();
> 
>               Logger logger = new ConsoleLogger (ConsoleLogger.LEVEL_INFO);
>               MessageHandler.setScreenLogger(logger);
>               driver.setLogger(logger);
> 
>               //userConfigFile = new File(userConfig);
>               //options = new Options(userConfigFile);
>               }catch(Exception e)
>           {
>               }
> 
> 
> 
> 
> 
>               //System.out.println("");
>               //System.out.println("");
> 
> 
> 
>       }
> 
> }
> 
> 

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

Reply via email to