Draw Slicer while rendering Excel to PDF
Draw Slicer while rendering Excel to PDF
Aspose.Cells for Python via Java supports exporting Excel to PDF with slicer settings. The API supports this by default, you simply export the Excel file with slicer to PDF, the generated PDF will show the slicer applied. The following code snippet loads the sample Excel file that contains a slicer and saves the workbook as the output PDF file. The following screenshot compares the source Excel file and the generated PDF file.
Sample Code
import jpype | |
import asposecells | |
jpype.startJVM() | |
from asposecells.api import Workbook, SaveFormat | |
# Load Source Excel file | |
workbook = Workbook("SampleSlicerChart.xlsx") | |
# Save the workbook in PDF format | |
workbook.save("SampleSlicerChart.pdf", SaveFormat.PDF) | |
jpype.shutdownJVM() |