是否有任何方法或包可以将ppt文件转换为pdf或png而不依赖操作系统?我正在尝试将ppt文件转换为png,但是所有的包都需要像LibreOffice或ImageMagick这样的操作系统依赖项。
发布于 2022-05-10 18:32:26
您可以使用用于Aspose.Slides Node.js的Cloud将演示文稿转换为PDF、PNG和许多其他格式。下面的代码示例演示如何使用PowerPoint云将Aspose.Slides表示转换为Aspose.Slides文档:
const cloud = require("asposeslidescloud")
const fs = require("fs")
const slidesApi = new cloud.SlidesApi("client_id", "client_secret")
const fileStream = fs.createReadStream("example.pptx")
// Convert the presentation to a PDF document.
slidesApi.convert(fileStream, "pdf").then((response) => {
// Save the PDF document to a file.
fs.writeFile("output.pdf", response.body, (error) => {
if (error) throw error
})
})
这是一个付费产品,但是您可以每月为表示转换和其他目的进行150个免费API调用。它为管理演示文稿提供了一个基于REST的API。我是Aspose的一个支持开发人员。
https://stackoverflow.com/questions/72159975
复制相似问题