SVG text alignment is rendered incorrect


Dear support,

we encountered a problem with the text alignment of SVG images.

Maybe it is related to SVG rendering issue text-anchor="middle" but the workaround there seems not to work for us.

private void test() throws Exception {

	// Arrange
	File targetPdfFile = new File(tmpFolder.getAbsolutePath());
	String targetPdfFilePath = targetPdfFile + "/" + UUID.randomUUID() + ".pdf";
	FileOutputStream fileOutputStream = new FileOutputStream(targetPdfFilePath);

	Document doc = new Document();
	DocumentBuilder docBuilder = new DocumentBuilder(doc);

	InputStream svgFile = classLoader.getResourceAsStream("test aspose alignment.svg");

	// Act
	docBuilder.insertImage(svgFile);, new PdfSaveOptions());

	// Assert
	System.out.println("Saved pdf here: " + targetPdfFilePath);
	// ...

test aspose (32.6 KB)

In the PDF you can see that the vertical, middle-aligned text “test1” is aligned on the left border.
And the middle-aligned text “hallo Rolle hehe” is also aligned wrong and overlays a icon.

Thank you for your help ! SVG for use in Aspose to generate PDFs


We tested the scenario and have managed to reproduce the same problem on our end. For the sake of correction, we have logged this problem in our issue tracking system. The ID of this issue is WORDSNET-18554. We will further look into the details of this problem and will keep you updated on the status of correction. We apologize for your inconvenience.


The issues you have found earlier (filed as WORDSNET-18554) have been fixed in this Aspose.Words for .NET 19.6 update and this Aspose.Words for Java 19.6 update.


super perfect

Thank you for being so very fast in solving this one !