Excelを標準サイズまたは最小サイズのPDFに保存する
Contents
[
Hide
]
デフォルトでは、Aspose.CellsはExcelを標準サイズでPDFに保存します。ただし、PdfSaveOptions.OptimizationTypeプロパティを使用して、最小サイズで保存することもできます。次の値が受け入れられます
- PdfOptimizationType.Standard
- PdfOptimizationType.MinimumSize
Aspose.Cellsを使用してExcelを標準サイズまたは最小サイズのPDFに保存する
PdfSaveOptions.OptimizationTypeプロパティを使用して、Excelを標準サイズまたは最小サイズでPDFに保存する方法を示すサンプルコードが以下に示されています。
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
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-.NET | |
// The path to the documents directory. | |
string dataDir = RunExamples.GetDataDir(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
// Load excel file into workbook object | |
Workbook workbook = new Workbook(dataDir + "SampleBook.xlsx"); | |
// Save into Pdf with Minimum size | |
PdfSaveOptions opts = new PdfSaveOptions(); | |
opts.OptimizationType = Aspose.Cells.Rendering.PdfOptimizationType.MinimumSize; | |
workbook.Save(dataDir + "OptimizedOutput_out.pdf", opts); |