是否有一个库可以获取 Microsoft Office 文件(Word/Excel/ppt)并渲染它们的图像?

发布于 2024-08-05 16:13:15 字数 214 浏览 2 评论 0原文

我正在构建一个网络应用程序,我需要用户能够在浏览器中查看 Word/Excel/PPT 文件(这些文件存储在服务器端)。这是为了向他们提供一种快速预览文档的方法,而无需下载并启动 Microsoft Office。

几乎正在寻找 Gmail 中电子邮件附件的“查看”功能。我假设谷歌以某种方式将文档格式渲染成图像并在浏览器中显示它们。

OpenOffice 有没有办法做到这一点?

I'm building a webapp, and I need the ability for users to view Word/Excel/PPT files in the browser (these files are stored server-side). This is to offer them a quick way to preview the document without needing to download it and launch Microsoft Office.

Pretty much looking for the "View" feature for email attachments in Gmail. I'm assuming that Google is somehow rendering the doc formats into images and displaying them in the browser.

Is there a way to do this in OpenOffice?

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

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

发布评论

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

评论(2

诗笺 2024-08-12 16:13:15

我不知道您是否可以使用 OpenOffice 执行此操作,但是 SpreadsheetGear for .NET 可以让您打开 Excel工作簿并从单元格或图表范围中获取图像。

您可以在此处查看一些示例。

免责声明:我拥有 SpreadsheetGear LLC

I do not know whether you can do this with OpenOffice, but SpreadsheetGear for .NET will let you open an Excel workbook and get an image from ranges of cells or charts.

You can see some examples of this here.

Disclaimer: I own SpreadsheetGear LLC

奈何桥上唱咆哮 2024-08-12 16:13:15

以下是生成 Office 文件图像的方法,在服务器上完成所有处理:

  1. 在服务器端,以服务器模式运行 OpenOffice(没有 UI,只有 API 可调用)。
  2. 调用 OpenOffice API 将任何 Office 文件转换为 PDF(了解开源软件 Alfresco 如何执行此操作)。
  3. 然后使用 ImageMagick 将 PDF 转换为 PNG。

Here is a way to do generate images of office files, doing all of the processing on your server:

  1. On server-side, run OpenOffice in server mode (no UI, just the API is callable).
  2. Call the OpenOffice API to translate any office file to PDF (See how the open source software Alfresco does this).
  3. Then convert PDF to PNG using ImageMagick.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文