首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PPT中的SVG (由Pptxgenjs生成)在libreOffice中打开PPT时显示错误

PPT中的SVG (由Pptxgenjs生成)在libreOffice中打开PPT时显示错误
EN

Stack Overflow用户
提问于 2020-10-26 11:35:20
回答 1查看 395关注 0票数 0

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

  • 环境: Windows 10
  • LibreOffice版本7

我是不是漏掉了什么?

EN

回答 1

Stack Overflow用户

发布于 2022-02-15 10:20:33

您可以尝试使用用于Aspose.Slides Node.js的Cloud将SVG图像和其他内容添加到演示文稿中。您可以评估这个基于REST的API,每月进行150个免费API调用,用于API学习和演示处理。下面的代码示例演示如何使用Aspose.Slides云将SVG映像添加到演示文稿中:

代码语言:javascript
复制
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的一个支持开发人员。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64536329

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档