We have tested the scenario using the following code example with latest version of Aspose.PDF for Java 22.2 and faced exception. Could you please share the Aspose.PDF and Java version that you are using? We will investigate this issue further and provide you more information on it.
Document pdfDocument = new Document();
Page pdfPage = pdfDocument.getPages().add();
HtmlFragment htmlFragment = new HtmlFragment("<img src='http://apitest.canpoint.net/t/3/18.svg' />");
FloatingBox box1 = new FloatingBox(500, 500);
box1.setLeft(100);
box1.setTop(100);
box1.getParagraphs().add(htmlFragment);
pdfPage.getParagraphs().add(box1);
pdfDocument.save(MyDir + "22.2.pdf");
We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as PDFJAVA-41404. You will be notified via this forum thread once this issue is resolved.