A Java Virtual Machine and Bytecode-to-IL Converter for .NET
Other
1.28k
stars
121
forks
source link
Trying to use FOP with .Net 8, but FopFactory.newInstance() fails with "Could not load source 'ClassLoader.java': Incorrect format of 'source' message.." #605
I am trying to run FOP with using the following test program:
using java.io;
using javax.xml.transform;
using javax.xml.transform.sax;
using javax.xml.transform.stream;
using org.apache.fop.apps;
public class Program
{
public static void Main(string[] args)
{
var outputStream = new java.io.FileOutputStream("Data/test1.pdf");
var uri = new java.io.File(".").toURI();
var fopFactory = FopFactory.newInstance(uri);
var userAgent = fopFactory.newFOUserAgent();
var fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, outputStream);
var transformerFactory = TransformerFactory.newInstance();
var transformer = transformerFactory.newTransformer(new StreamSource(new java.io.File("Data/test1.fo")));
transformer.setParameter("version", "1.0");
var xmlSource = new StreamSource(new java.io.File("Data/test1.xml"));
var result = new SAXResult(fop.getDefaultHandler());
transformer.transform(xmlSource, result);
}
I am trying to run FOP with using the following test program:
The project file is:
Stepping through the program fails on the line
and the following happens:
Some exceptions are thrown and a new file
ClassLoader.java
is opened in a newVS Code
tab with the following contents :But when I change the project file to:
all works as expected. But, to be honest, I would rather do it without this package.