Phplivedocx 的替代方案,可以在模板中动态更改图像

发布于 2024-09-15 22:47:06 字数 337 浏览 0 评论 0原文

对于我的网络应用程序,我使用 phplivedocx 来生成 docx/pdf 报告。但现在我需要插入图像,该用户将上传到我的网站,到 docx 模板。在phplivedocx论坛上我发现这个软件不支持这个功能。 是否有其他工具可以从模板生成 docx/pdf 页面,并且还可以更改/插入图片?

*Edit1:在 phplivedocx 论坛上发现一篇有趣的文章。男子使用标准图像(example.png)创建一个模板。之后,他使用 phplivedocx 更改模板中的文本。之后,他解压 docx 并用新图像替换 example.png。 非常好,但是如何在 php 中解压 docx、替换文件以及设置图像属性?

提前致谢。

For my web-application i use phplivedocx for docx/pdf generating reports. But now i need to insert images, that user will upload to my web-site, to the docx template. On the phplivedocx forums i found that this software doesn't support this feature.
Is there any other tools, that can produce docx/pdf pages from template, and can also change/insert pictures to it?

*Edit1: Found an interesting article on the phplivedocx forum. Man create a template with standard image (example.png). After it he use phplivedocx for changing text in template. After it, he unpack docx and replace example.png with new image.
It's very nice, but how to unpack docx, replace file and set attributes for image in php?

Thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

最初的梦 2024-09-22 22:47:06

OpenTBS 可以使用模板技术在 PHP 中创建 DOCX(和其他 OpenXML 文件)动态文档。

不需要临时文件,不需要命令行,一切都在 PHP 中。

并且它可以添加或删除图片。创建的文档可以生成为 HTML 下载、保存在服务器上的文件或 PHP 中的二进制内容。

它还可以合并 OpenDocument 文件(ODT、ODS、ODF...)。然而它不能像 PhpLiveDocx 那样创建 PDF 文件。

http://www.tinybutstrong.com/opentbs.php

OpenTBS can create DOCX (and other OpenXML files) dynamic documents in PHP using the technique of templates.

No temporary files needed, no command lines, all in PHP.

And it can add or delete pictures. The created document can be produced as an HTML download, a file saved on the server, or as binary contents in PHP.

It can also merge OpenDocument files (ODT, ODS, ODF, ...). Nevertheless it cannot create PDF files like PhpLiveDocx.

http://www.tinybutstrong.com/opentbs.php

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文