Excel を PDF に標準サイズまたは最小サイズで保存
Contents
[
Hide
]
デフォルトでは、Aspose.Cells は Excel を PDF に標準サイズで保存します。ただし、を使用して最小サイズで保存することもできますPdfSaveOptions.OptimizationType財産。次の値を受け入れます
- PdfOptimizationType.Standard
- PdfOptimizationType.MinimumSize
Aspose.Cells を使用して、標準サイズまたは最小サイズで Excel を PDF に保存します。
次のサンプル コードは、Excel を標準サイズまたは最小サイズで PDF に保存する方法を示しています。PdfSaveOptions.OptimizationType財産。
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); |