Excel in PDF mit Standard oder minimaler Größe speichern mit Node.js über C++

Excel in PDF mit Standard- oder Minimalgröße speichern mit Aspose.Cells for Node.js via C++

Das folgende Beispiel zeigt, wie Sie Excel mit Standard- oder Minimalgröße mit der Eigenschaft PdfSaveOptions.getOptimizationType() in PDF speichern können.

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