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

Free Support Forum - aspose.com

Aspose PDF JAVA not able to add high stocks SVG Image


I am working with Aspose PDF Java.

Could some one take a look, I am not able to add the attached SVG High-Stocks image to PDF Table cell. But I am able to add High-Charts images to the same PDF Table cell.

BalakumarHigh-Stock SVG Image file.zip (13.6 KB)


Thanks for contacting support.

I have tried to add SVG image inside Table, by using following code snippet and Aspose.Pdf for Java 17.8, and was able to add image inside the PDF. However, I have observed that the image turned into black and white in the resultant PDF document. For your reference, I have attached generated document as well as the code snippet, used to generate it.

Document doc = new Document();
Page page = doc.getPages().add();
com.aspose.pdf.Image img = new com.aspose.pdf.Image();
img.setFile(dataDir + "highstockImg.svg");
com.aspose.pdf.Table table = new com.aspose.pdf.Table();
table.setColumnWidths("100 100");
com.aspose.pdf.Row row = table.getRows().add();
com.aspose.pdf.Cell cell = row.getCells().add();
cell.getParagraphs().add(new com.aspose.pdf.TextFragment("First Cell"));
cell = row.getCells().add();
doc.save(dataDir + "SVG_in-Table.pdf"); 

SVG_in-Table.pdf (73.9 KB)

We have logged an issue as PDFJAVA-37053 in our issue tracking system, regarding image turning into black and white. We will further look into the details of the issue and keep you informed with the status of its rectification. Please be patient and spare us little time.

We are sorry for the inconvenience.

The issues you have found earlier (filed as PDFJAVA-37053) have been fixed in Aspose.PDF for Java 18.11.