Hello,
I’m currently evaluating Aspose.Cells(4.8.0.0) and everything went well until I tried to save my document to pdf.
When I save the file to pdf, the chart is not visible.
I use the following code;
Workbook workbook = new Workbook();
Worksheet worksheet = workbook.Worksheets[0];
worksheet.Cells[“F1”].PutValue(50);
worksheet.Cells[“F2”].PutValue(100);
worksheet.Cells[“F3”].PutValue(150);
worksheet.Cells[“G1”].PutValue(4);
worksheet.Cells[“G2”].PutValue(20);
worksheet.Cells[“G3”].PutValue(50);
worksheet.Cells[“H1”].PutValue(“A”);
worksheet.Cells[“H2”].PutValue(“B”);
worksheet.Cells[“H3”].PutValue(“C”);
int chartIndex = worksheet.Charts.Add(ChartType.Pyramid, 0, 0, 10, 5);
Chart chart = worksheet.Charts[chartIndex];
chart.NSeries.Add(“F1:G3”, true);
workbook.Save(“c:\test1.pdf”,FileFormatType.Pdf);
workbook.Save(“c:\test1.xls”, FileFormatType.Excel2003);
The xls file is showing a simple chart, but it is missing in the pdf-file.
I also tried to use Aspose.pdf
MemoryStream str = new MemoryStream();
workbook.Save(str, FileFormatType.AsposePdf);
Pdf pdffile = new Pdf();
pdffile.BindXML(str, null);
pdffile.Save(“c:\pdf2.pdf”);
But this produces the same result.
Am I doing something wrong? Or can’t charts be saved in pdf-format.