使用标准大小或最小大小将Excel保存为PDF

使用 Aspose.Cells 将 Excel 保存为标准或最小尺寸的 PDF

以下示例代码显示了如何使用PdfSaveOptions.OptimizationType属性将Excel保存为具有标准或最小尺寸的PDF。

// 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);