使用标准或最小尺寸将 Excel 保存到 PDF
Contents
[
Hide
]
默认情况下,Aspose.Cells 将 Excel 保存为标准大小的 PDF。但是,您也可以使用最小尺寸保存它PdfSaveOptions.优化类型财产。它接受以下值
- PdfOptimizationType.Standard
- PdfOptimizationType.MinimumSize
使用 Aspose.Cells 以标准或最小大小将 Excel 保存到 PDF
以下示例代码显示了如何使用标准或最小大小将 Excel 保存到 PDFPdfSaveOptions.优化类型财产。
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); |