Save Excel into PDF with Standard or Minimum Size
Contents
[
Hide
]
By default, Aspose.Cells saves Excel into PDF with Standard size. However, you can also save it with Minimum size using the PdfSaveOptions.optimization_type property. It accepts the following values
- PdfOptimizationType.STANDARD
- PdfOptimizationType.MINIMUM_SIZE
Save Excel into PDF with Standard or Minimum Size using Aspose.Cells for Python via .NET
The following sample code shows how you can save Excel into PDF with Standard or Minimum size using PdfSaveOptions.optimization_type property.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aspose.cells import PdfSaveOptions, Workbook | |
from aspose.cells.rendering import PdfOptimizationType | |
# For complete examples and data files, please go to https:# github.com/aspose-cells/Aspose.Cells-for-.NET | |
# The path to the documents directory. | |
dataDir = RunExamples.GetDataDir(".") | |
# Load excel file into workbook object | |
workbook = Workbook(dataDir + "SampleBook.xlsx") | |
# Save into Pdf with Minimum size | |
opts = PdfSaveOptions() | |
opts.optimization_type = PdfOptimizationType.MINIMUM_SIZE | |
workbook.save(dataDir + "OptimizedOutput_out.pdf", opts) |