Black background adding a svg chart with Opacity

HI

I’m having problems adding a svg chart to our pdf rendering service. The background of the area is filled black, We have found out, that the problem is appearing because of the opacity setting of this area:

// The path to the documents directory.
string dataDir = GetDataDir_Data();

// Create new chart image
string imageContent = string.Empty;
string imagePath = dataDir + “test.svg”;

if (File.Exists(imagePath))
{
using (StreamReader reader = new StreamReader(imagePath))
{
imageContent += reader.ReadToEnd();
}
}

MemoryStream stream = new MemoryStream();
StreamWriter writer = new StreamWriter(stream);
writer.Write(imageContent);
writer.Flush();
stream.Position = 0;

Image highChart = new Image() { FileType = ImageFileType.Svg };
highChart.ImageStream = stream;

// Create new Document
Document pdfDocument = new Document();
pdfDocument.PageInfo.Margin.Left = 40;
pdfDocument.PageInfo.Margin.Right = 40;

Page page = pdfDocument.Pages.Add();
page.Paragraphs.Add(highChart);

// Save updated document
pdfDocument.Save(dataDir + “Example_out.pdf”);

Example_out.pdf (97.4 KB)
test.zip (45.6 KB)

@david.peier

Thanks for contacting support.

I have test the scenario with latest version Aspose.Pdf for .NET 17.7 and observed the black background issue in the resultant file. Hence I have logged this issue as PDFNET-43026 in our issue tracking system. We will further look into the details of the issue and keep you updated with the status of its rectification. Please be patient and give us little time.

We are sorry for the inconvenience.


Best Regards,
Asad Ali

The issues you have found earlier (filed as PDFNET-43026) have been fixed in Aspose.PDF for .NET 18.11.