We have the following problem using FOP:

First we tried to embed FOP into a small java programm:

package TestPackage;

import java.io.*;

import javax.servlet.*;
import javax.servlet.http.*;

import org.xml.sax.InputSource;
import org.xml.sax.XMLReader;

import org.apache.fop.apps.Driver;
import org.apache.fop.apps.Version;
import org.apache.fop.apps.*;

import org.apache.log.*;

public class Test {

    public static void main(String[] args) throws Exception {

    File fxml=new File("D:\\xslfoRef.xml");
    File fxsl=new File("D:\\xml2pdf.xsl");
    File fpdf=new File("D:\\ttt.pdf");

    Logger log;
    Hierarchy hierarchy = Hierarchy.getDefaultHierarchy();
    log = hierarchy.getLoggerFor("fop");
    log.setPriority(Priority.WARN);

    Driver dr=new Driver();
    dr.setLogger(log);
    dr.setRenderer(Driver.RENDER_PDF);
    InputHandler ih=new XSLTInputHandler(fxml,fxsl);
    XMLReader p=ih.getParser();
    dr.setOutputStream(new FileOutputStream(fpdf));
    dr.render(p,ih.getInputSource());

  }
}

The program can be compiled without any problems, but the pdf-file has 0
bytes. What is wrong?

We tried also to start FOP from the command line under dos and linux with the
parameters  xslfoRef.xml and xml2pdf.xsl. The error message was :   "Master
-reference" for "fo:page -sequence" matches no "simple -page -master" or
"page -sequence -master".

Do you have any idea??

Thanks for your help,
Viktor und Marianne.

Reply via email to