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)