[
https://issues.apache.org/jira/browse/FOP-3059?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17511744#comment-17511744
]
Yakir Goaron edited comment on FOP-3059 at 3/24/22, 10:31 AM:
--------------------------------------------------------------
I might be able to copy the relevant parts here if thats ok .
The whole code is a little problematic.
The code that I am using :
FopFactory fopFactory = null;
FOUserAgent foUserAgent = null;
fopFactory = FopFactory.newInstance( new File( "." ).toURI() );
foUserAgent = fopFactory.newFOUserAgent();
bufferedOutputStream = new FileOutputStream( pdfFilename );
bufferedOutputStream = new BufferedOutputStream( bufferedOutputStream );
Source src = new StreamSource(xmlFilename);
Source xsltSrc = new StreamSource(xslFullName);
com.saxonica.config.EnterpriseTransformerFactory factory = new
com.saxonica.config.EnterpriseTransformerFactory(EnterpriseConfiguration.cfg);
Fop fop =
fopFactory.newFop(org.apache.xmlgraphics.util.MimeConstants.MIME_PDF,
foUserAgent, bufferedOutputStream);
Transformer transformer = factory.newTransformer( xsltSrc );
transformer.setParameter("versionParam", "2.0");
Result res = new SAXResult( fop.getDefaultHandler() );
transformer.transform(src, res);
was (Author: JIRAUSER286370):
I might be able to copy the relevant parts here if thats ok .
The whole code is a little problematic.
> Open JDK 11 with FOP fail on transform to PDF
> ---------------------------------------------
>
> Key: FOP-3059
> URL: https://issues.apache.org/jira/browse/FOP-3059
> Project: FOP
> Issue Type: Bug
> Affects Versions: 2.4, 2.6
> Reporter: Yakir Goaron
> Priority: Critical
>
> When using FOP with SAX factory on open JDK 11 there is an error when calling
> the transform from java code.
> The following error shows :
> Class org.apache.fop.fo.FOTreeBuilder does not implement the requested
> interface org.xml.sax.ContentHandler
> Although the FOTreeBuilder implement the interface it seems that due too the
> java version it is incompatible.
> For now I have tried with FOP 2.4 and FOP 2.6 .
--
This message was sent by Atlassian Jira
(v8.20.1#820001)