[
https://issues.apache.org/jira/browse/FOP-2893?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16996392#comment-16996392
]
Olivier Cailloux commented on FOP-2893:
---------------------------------------
Partial workaround. I currently create a FopFactory in the following way.
final URL configUrl =
DocBookUtils.class.getResource("fop-config.xml");
try (InputStream configStream = configUrl.openStream()) {
final FopFactory fopFactory;
try {
fopFactory =
FopFactory.newInstance(Hyphenator.class.getResource(".").toURI(), configStream);
} catch (URISyntaxException | SAXException e) {
throw new IllegalStateException(e);
}
}
(Sorry, didn’t find how to format code properly.)
This allows me to put the hyphenation files in the org/apache/fop/hyphenation
resource folder.
Not sure this is a best practice though.
> hyph resources in jar should have unique names and should be in Maven central
> -----------------------------------------------------------------------------
>
> Key: FOP-2893
> URL: https://issues.apache.org/jira/browse/FOP-2893
> Project: FOP
> Issue Type: Bug
> Reporter: Olivier Cailloux
> Priority: Minor
>
> Please consider adding the jar containing the hyphenation resources
> ({{fop-hyph.jar}}) to Maven central, so that it can be easily added to a
> third-party application using fop to build PDFs.
> Please also consider giving those resources [unique
> names|https://github.com/oliviercailloux/java-course/blob/master/Best%20practices/Resources.adoc#use-unique-names]
> to avoid conflicts and easily identify them. (This means the loader of those
> resources should also be changed to make it look at the right places.)
--
This message was sent by Atlassian Jira
(v8.3.4#803005)