Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
By default, Aspose.Cells saves Excel to PDF with Standard size. However, you can also save it with Minimum size using the PdfSaveOptions.getOptimizationType() property. It accepts the following values:
The following sample code shows how you can save Excel to PDF with Standard or Minimum size using the PdfSaveOptions.getOptimizationType() property.
const path = require("path");
const AsposeCells = require("aspose.cells.node");
// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
const filePath = path.join(dataDir, "SampleBook.xlsx");
// Load Excel file into Workbook object
const workbook = new AsposeCells.Workbook(filePath);
// Save into PDF with Minimum size
const opts = new AsposeCells.PdfSaveOptions();
opts.setOptimizationType(AsposeCells.PdfOptimizationType.MinimumSize);
workbook.save(path.join(dataDir, "OptimizedOutput_out.pdf"), opts);
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.