Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
If you have an Excel file that has a slicer applied to it and you want to export the Excel file to PDF with the slicer settings, Aspose.Cells now supports this by default. You simply export the Excel file with a slicer to PDF, and the generated PDF will show the slicer applied.
The following sample code loads the sample Excel file that contains an existing slicer. It then saves the workbook as the output PDF file. The following screenshot compares the source Excel file and the generated PDF file.

#include <iostream>
#include "Aspose.Cells.h"
using namespace Aspose::Cells;
int main()
{
Aspose::Cells::Startup();
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-C
// Source directory path
U16String srcDir(u"..\\Data\\01_SourceDirectory\\");
// Output directory path
U16String outDir(u"..\\Data\\02_OutputDirectory\\");
// Path of input Excel file
U16String inputFilePath = srcDir + u"SampleSlicerChart.xlsx";
// Path of output PDF file
U16String outputFilePath = outDir + u"SampleSlicerChart.pdf";
// Create workbook from the Excel file
Workbook workbook(inputFilePath);
// Save the workbook as a PDF file
workbook.Save(outputFilePath, SaveFormat::Pdf);
std::cout << "Workbook saved as PDF successfully!" << std::endl;
Aspose::Cells::Cleanup();
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.