Hello,
I can’t get Italian hyphenation to work when converting ODT documents to PDF.
I followed the instructions in the documentation at Working with Hyphenation in Java|Aspose.Words for Java
but I can’t get it to hyphenate when converting to PDF.
I also tried registering a callback using the IHyphenationCallback interface, but it never gets invoked.
The code I used is the following:
Document srcDoc = new Document(sourceFile.getPath());
Hyphenation.registerDictionary("it-IT", ".....\\hyph_it_IT.dic");
System.out.println("Registro il dizionario per la sillabazione in italiano");
System.out.println("Dizionario registrato: "+Hyphenation.isDictionaryRegistered("it-IT"));
Hyphenation.setCallback(new CustomHyphenationCallback());
System.out.println("Registro il CustomHyphenationCallback");
PdfSaveOptions pso = new PdfSaveOptions();
pso.setCompliance(PdfCompliance.PDF_A_1_B);
srcDoc.save(destinationFile.getPath(), pso);
class CustomHyphenationCallback implements IHyphenationCallback {
public void requestDictionary(String language) throws Exception {
System.out.println("requested dictionary: "+language);
}
Tho output says that the dictionary is registered and that tha callback get never invoked.
The problem has been reproduced with version 24.9 of Aspose.Word for Java.
In attach a sample document.
SJIR-8668_det_00567_22-04-2024_offuscato_small_hypen.zip (378.6 KB)
Thanks,
Fabio Parise