重采样添加的图片 使用 Node.js 和 C++ 进行 Excel 转 PDF

Contents
[ ]

请参阅以下示例代码,描述如何使用Aspose.Cells API执行该任务。该示例将Microsoft Excel文件转换为PDF文件,并压缩文件中的图像。

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// The path to the documents directory.
const dataDir = path.join(__dirname, "data");
// Initialize a new Workbook
// Open an Excel file
const workbook = new AsposeCells.Workbook(path.join(dataDir, "input.xlsx"));

// Instantiate the PdfSaveOptions
const pdfSaveOptions = new AsposeCells.PdfSaveOptions();
// Set Image Resample properties
pdfSaveOptions.setImageResample(300, 70);

// Save the PDF file
workbook.save(path.join(dataDir, "OutputFile_out_pdf"), pdfSaveOptions);