Hello,
When I try to use embedded SVG in my FO document while using the procedure
for embedding FOP in an APP, FOP Hangs. I have tried this with both the
Fop-0.20.1 and Fop-0.20.2 releases. When I run the FO document through FOP
from the commandline it processes just fine. The error that I am getting
when using the embedded code is Malformed URL Exception and Null Pointer
for the SVG part of my document. There might be something that I am doing
incorrectly when embedding FOP. I will post my code and if anyone can
comment I will appreciate it thanks.
here's the code...
//Imported FOP Classes
import org.apache.fop.apps.*;
//Imported Sax Classes
import org.xml.sax.*;
// Imported TraX classes
import javax.xml.transform.*;
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;
// Imported java classes
import java.io.*;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
public class FopDxlTest {
/**
* creates a SAX parser, using the value of org.xml.sax.parser
* defaulting to org.apache.xerces.parsers.SAXParser
*
* @return the created SAX parser
*/
static XMLReader createParser()
{
XMLReader xmlreader = null;
try {
String parserClassName = System.getProperty("org.xml.sax.parser");
if (parserClassName == null) {
parserClassName = "org.apache.xerces.parsers.SAXParser";
}
xmlreader= (XMLReader) Class.forName(parserClassName).newInstance
();
} catch (Exception e) {
System.out.println(e);
}
return xmlreader;
}
public static void main(java.lang.String args[])
throws FileNotFoundException, IOException {
String inFile = "embedding.fo";
String outFile = "aaahh.pdf";
try {
XMLReader xmlreader = createParser();
FileInputStream foInput = new FileInputStream(inFile);
//set Driver methods to start Fop processing
Driver driver = new Driver();
driver.setRenderer(Driver.RENDER_PDF);
driver.setInputSource(new InputSource(foInput));
driver.setOutputStream(new FileOutputStream(outFile));
driver.run();
} catch (Exception e) {
System.out.println(e);
}
}
}
Thanks.
Christopher L Quirk
Quirk & Company
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]