Pptxgenjs能够添加SVG图像并正确生成PPT。当使用Microsoft打开此PPT时,SVG图像将正确显示。但是,当使用libreOffice打开此PPT时,SVG图像将显示为无效的交叉符号,如下所述。


我是不是漏掉了什么?
发布于 2022-02-15 10:20:33
您可以尝试使用用于Aspose.Slides Node.js的Cloud将SVG图像和其他内容添加到演示文稿中。您可以评估这个基于REST的API,每月进行150个免费API调用,用于API学习和演示处理。下面的代码示例演示如何使用Aspose.Slides云将SVG映像添加到演示文稿中:
const cloud = require("asposeslidescloud")
const model = require("asposeslidescloud/model")
const fs = require("fs")
const slidesApi = new cloud.SlidesApi("client_id", "client_key")
const fileName = "example.pptx"
const imagePath = "image.svg"
const slideIndex = 1
// Create a picture frame for the SVG image with a specified size and position.
var pictureFrame = new model.PictureFrame()
pictureFrame.pictureFillFormat = new model.PictureFill()
pictureFrame.pictureFillFormat.svgData = fs.readFileSync(imagePath, "utf8")
pictureFrame.X = 20
pictureFrame.Y = 20
pictureFrame.Width = 300
pictureFrame.Height = 200
// Add the picture frame on the slide.
slidesApi.createShape(fileName, slideIndex, pictureFrame).then((response) => {
console.log(JSON.stringify(response))
})我是Aspose的一个支持开发人员。
https://stackoverflow.com/questions/64536329
复制相似问题