package pdfgen.classes;


import java.io.*;
import org.apache.fop.apps.*;
import org.apache.fop.messaging.MessageHandler;

public class FOPDrivernew {
	public java.lang.String strFopPosition = null;;

public FOPDrivernew() {
	super();
}

public void fop()
	throws FOPException, FileNotFoundException, Exception, Throwable {

	String strPosition = null;
	CommandLineOptions options = null;

	try {
		//args-xsl D:\foptrial\ash\ash2.xsl -xml D:\foptrial\ash\ash2.xml -pdf D:\foptrial\ash\ash2.pdf
		String[] args = {"-xsl", "d:/xml2pdf.xsl", "-xml", "d:/xslfoRef.xml", "-pdf", "d:/xslfoRef.pdf"};
		System.out.println("The first line");
		options = new CommandLineOptions(args);
		System.out.println("Secind line");
		Starter starter1 = options.getStarter();
		System.out.println("Third line" + args[5]);

		starter1.run();
		System.out.println("ha ha ha");
	} catch (FOPException e) {
		MessageHandler.errorln("ERROR: " + e.getMessage());
		if (options != null && options.isDebugMode().booleanValue()) {
			e.printStackTrace();
		}
		this.strFopPosition = "06";
		throw e;
	} catch (FileNotFoundException e) {
		MessageHandler.errorln("ERROR: " + e.getMessage());
		if (options != null && options.isDebugMode().booleanValue()) {
			e.printStackTrace();
		}
		this.strFopPosition = "07";
		throw e;
	} catch (Exception e) {
		e.printStackTrace();
		this.strFopPosition = "08";
		throw e;
	} catch (Throwable e) {
		e.printStackTrace();
		this.strFopPosition = "09";
		throw e;
	}

}
}

