For archiving purposes, I’m trying to convert the attached test_chart.xlsx to PDF:
// Open the template excel file
Aspose.Cells.Workbook wb = new Aspose.Cells.Workbook(inputPath);
// create explicit SaveOptions
Aspose.Cells.PdfSaveOptions pdfSaveOptions = new Aspose.Cells.PdfSaveOptions();
pdfSaveOptions.OnePagePerSheet = true;
pdfSaveOptions.AllColumnsInOnePagePerSheet = true;
pdfSaveOptions.ExportDocumentStructure = true;
pdfSaveOptions.GridlineType = GridlineType.Hair;
foreach (Worksheet worksheet in wb.Worksheets)
{
worksheet.PageSetup.PrintGridlines = false;
}
// Save the pdf file.
wb.Save(outputPath, pdfSaveOptions);
But this fails with error: Unable to cast object of type ‘???’ to type ‘???’.
I use Aspose libraries version 22.2.
Test_chart.zip (8.5 KB)