SVG text alignment is rendered incorrect


#1

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);
	doc.save(fileOutputStream, new PdfSaveOptions());

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

test aspose alignment.zip (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 !


BPMN.io SVG for use in Aspose to generate PDFs
#2

@orgavision,

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.


#3

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.


#4

super perfect

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