We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Insert SVG Graphics Image with Outlined Fonts in Word DOCX Document using Java | Custom Fonts

This code inserts an SVG into a word document. The produced word document has an SVG with outline fonts that are not rendered correctly. Can you have a look please. The code is:

FontSettings.getDefaultInstance().setFontsSources(new FontSourceBase[] { new SystemFontSource(), new FolderFontSource("fonts", true) });
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
String svgString = Files.readString(Paths.get("svg/input_outline_fonts.svg"));  
builder.insertImage(svgString.getBytes(StandardCharsets.UTF_8));
doc.save("output.docx");

It loads the fonts from the fonts subdirectory. Those are required to reproduce the issue. It also loads the SVG from the svg folder.

We are using Aspose.Words for Java 20.6.

The data is in the attached zip file.

data.zip (753.2 KB)

@bmpi,

We managed to reproduce this issue on our end and have logged this issue in our bug tracking system with ID WORDSNET-21277. Your thread has also been linked to this issue and you will be notified here as soon as it will get resolved in future. Sorry for the inconvenience.

The issues you have found earlier (filed as WORDSNET-21277) have been fixed in this Aspose.Words for Java 21.10 update.