Excelを標準サイズまたは最小サイズのPDFに保存する
Contents
[
Hide
]
デフォルトでは、Aspose.CellsはExcelを標準サイズでPDFに保存します。ただしPdfSaveOptions.optimization_typeプロパティを使用して、最小サイズで保存することもできます。以下の値が受け入れられます。
- PdfOptimizationType.STANDARD
- PdfOptimizationType.MINIMUM_SIZE
Aspose.Cells for Python via .NETを使用して、標準サイズまたは最小サイズでExcelをPDFに保存する
以下のサンプルコードは、PdfSaveOptions.optimization_typeプロパティを使用して、Excelを標準サイズまたは最小サイズのPDFに保存する方法を示しています。
This file contains hidden or 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) |