首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PowerPoint REST?

PowerPoint REST?
EN

Stack Overflow用户
提问于 2020-04-17 04:44:40
回答 1查看 828关注 0票数 1

我正在寻找一个REST来生成PowerPoint幻灯片..。有人有什么建议吗?

意识到这并不是很难实现,但我们正在努力避免构建我们可以从第三方获得的非核心功能。

基本上,我们希望发送一个JSON blob并返回生成的幻灯片。

认为这是一个与相关的问题是否有以编程方式制作MS Office 365 Powerpoint演示文稿的API?

谢谢你的帮忙!

EN

回答 1

Stack Overflow用户

发布于 2022-04-07 16:16:44

您可以尝试将Aspose.Slides云用于您的目的。该产品为许多编程语言(C#、Java、PHP、Ruby、Python、Node.js、C++、Go、Perl、Swift)、平台和环境提供了基于REST的API。使用此产品,您可以同时使用Aspose文件库和第三方存储库.Docker容器也可以用于使用Aspose.Slides云。

该产品不支持从JSON文件中向演示文稿中添加内容,但它提供了许多生成内容的功能。它还提供了向HTML和PDF文档中的演示文稿添加内容的特性。下面的Python示例代码向您展示了如何将WordArt对象添加到新的演示文稿中。

代码语言:javascript
复制
import asposeslidescloud

from asposeslidescloud.apis.slides_api import SlidesApi
from asposeslidescloud.models.slide_export_format import SlideExportFormat
from asposeslidescloud.models.shape import Shape
from asposeslidescloud.models.fill_format import FillFormat
from asposeslidescloud.models.line_format import LineFormat
from asposeslidescloud.models.text_frame_format import TextFrameFormat
from asposeslidescloud.models.three_d_format import ThreeDFormat
from asposeslidescloud.models.shape_bevel import ShapeBevel
from asposeslidescloud.models.light_rig import LightRig
from asposeslidescloud.models.camera import Camera

slides_api = SlidesApi(None, "my_client_id", "my_client_secret")

file_name = "example.pptx"
slide_index = 1

dto = Shape()
dto.shape_type = "Rectangle"
dto.x = 100
dto.y = 100
dto.height = 100
dto.width = 200
dto.text = "Sample text"

dto.fill_format = FillFormat()
dto.fill_format.type = "NoFill"

dto.line_format = LineFormat()
dto.line_format.fill_format = FillFormat()
dto.line_format.fill_format.type = "NoFill"

text_frame_format = TextFrameFormat()
text_frame_format.transform = "ArchUpPour"

three_d_format = ThreeDFormat()
bevel_bottom = ShapeBevel()
bevel_bottom.bevel_type = "Circle"
bevel_bottom.height = 3.5
bevel_bottom.width = 3.5
three_d_format.bevel_bottom = bevel_bottom

bevel_top = ShapeBevel()
bevel_top.bevel_type = "Circle"
bevel_top.height = 4
bevel_top.width = 4
three_d_format.bevel_top = bevel_top

three_d_format.extrusion_color = "#FF008000"
three_d_format.extrusion_height = 6
three_d_format.contour_color = "#FF25353D"
three_d_format.contour_width = 1.5
three_d_format.depth = 3
three_d_format.material = "Plastic"

light_rig = LightRig()
light_rig.light_type = "Balanced"
light_rig.direction = "Top"
light_rig.x_rotation = 0
light_rig.y_rotation = 0
light_rig.z_rotation = 40
three_d_format.light_rig = light_rig

camera = Camera()
camera.camera_type = "PerspectiveContrastingRightFacing"
three_d_format.camera = camera
text_frame_format.three_d_format = three_d_format
dto.text_frame_format = text_frame_format

# Create the WordArt object and download the presentation.
slides_api.create_presentation(file_name)
slides_api.create_shape(file_name, slide_index, dto)
file_path = slides_api.download_file(file_name)

输出表示中的WordArt对象:

这是一个付费产品,但是您可以每月为API学习和演示处理进行150个免费API调用。

我是Aspose的一个支持开发人员。

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

https://stackoverflow.com/questions/61264311

复制
相关文章

相似问题

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