sorry for my delayed response.
You are right, with the provided code and resources, the issue is not appearing.
I was now able to get back to the issue and do some more testings.
It seems, that the problem only occurs, if the german and english dictionaries are set together.
Please see the following coding which we use for reproducing the issue.
I have also attached the two used dictionaries as well as the source document.
We are still talking about the wrongly split word “Alter-srente” around line 14-15 in the resulting PDF document.
public void TestHyphenationAltersrente() throws Exception
String sourceDocPath = “C:\hyphenation\autoHyphen.docx”;
String convertedDocPath = “C:\hyphenation\autoHyphen_java.pdf”;
byte wordData = FileUtils.readFileToByteArray( Paths.get( “C:\hyphenation\autoHyphen.docx” ).toFile());
SaveOptions saveOptions = SaveOptions.createSaveOptions(SaveFormat.PDF);
byte result = null;
ByteArrayInputStream docBinStream = new ByteArrayInputStream(wordData);
ByteArrayOutputStream outStream = new ByteArrayOutputStream();
Document document = new Document(docBinStream);
result = outStream.toByteArray();
FileUtils.writeByteArrayToFile( Paths.get(“C:\hyphenation\autoHyphen_java.pdf” ).toFile(), result);