xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pedro Barco Bernal" <pba...@ceh.junta-andalucia.es>
Subject FOP in server don´t works
Date Tue, 05 Feb 2002 12:10:22 GMT
This class works perfectly at local. But when I try tu run it at server make a Exception...

The Exception is: File out.fo not found.... 

But the same class works perfectly at local !!
Can someone tell me why?? The server works perfectly with other class...


  import javax.xml.transform.TransformerFactory;
  import javax.xml.transform.Transformer;
  import javax.xml.transform.stream.StreamSource;
  import javax.xml.transform.stream.StreamResult;
  import javax.xml.transform.TransformerException;
  import javax.xml.transform.TransformerConfigurationException;


  import org.apache.fop.apps.Driver;
  import org.xml.sax.InputSource;

  import java.io.FileOutputStream;
  /**
   * A Class class.
   * <P>
   * @author SADIEL
   */
  public class FOP2 extends Object {


      /**
       * Render to PDF. OutputStream must be set
       */
      public static final int RENDER_PDF = 1;

    /**
     * Constructor
     */
    public FOP2() {
    try{

   TransformerFactory tFactory = TransformerFactory.newInstance();
   Transformer transformer = tFactory.newTransformer(new StreamSource("xsl.xsl"));
   transformer.transform(new StreamSource("xml.xml"), new StreamResult(new FileOutputStream("out.fo")));

    InputSource inputsource = new InputSource("out.fo");

    FileOutputStream out = new FileOutputStream("out.pdf");
    Driver driver = new Driver( inputsource, out);
    driver.setRenderer(RENDER_PDF);
    driver.run();

      }catch(Exception e){
    System.out.println("Excepcion");
    System.out.println(e.toString());
    }

    }

  }


Mime
View raw message