Save Excel into PDF with Standard or Minimum Size
By default, Aspose.Cells saves Excel into PDF with Standard size. However you can also save it with Minimum size using the PdfSaveOptions.OptimizationType property. It accepts the following values
Save Excel into PDF with Standard or Minimum Size using Microsoft Excel
The following screenshot shows how to save Excel into PDF with Standard or Minimum size using Microsoft Excel.
Save Excel into PDF with Standard or Minimum Size using Aspose.Cells
The following sample code shows how you can save Excel into PDF with Standard or Minimum size using PdfSaveOptions.OptimizationType property.
// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java | |
String dataDir = Utils.getDataDir(SaveExcelToPDF.class); | |
// Load excel file into workbook object | |
Workbook workbook = new Workbook(dataDir + "sample.xlsx"); | |
// Save into Pdf with Minimum size | |
PdfSaveOptions opts = new PdfSaveOptions(); | |
opts.setOptimizationType(PdfOptimizationType.MINIMUM_SIZE); | |
workbook.save(dataDir + "output.pdf", opts); |