创建一个可以在浏览器中显示doc、docx、pdf的系统

发布于 2024-12-31 22:59:53 字数 476 浏览 5 评论 0原文

我目前正在开发一个 Web 应用程序,它将作为 FTP 服务器的前端。服务器包含数千个 pdf/doc/docx 文件,并且每个月他们都会添加几十个有时接近一百个文件。

我们当前的应用程序使用 openoffice 将文件转换为 pdf。然后我们使用 pdf2swf 将文件转换为我们在浏览器中显示的 swf 对象。在新应用程序中,所有数据都可以在 FTP 服务器中找到,我们无法存储/创建 swf 文件。

我们需要首先解析服务器上某些资源的 url,而不是将其下载到另一台计算机并在浏览器中显示文档。

有没有一种方法(最好是用Python)来相对快速地生成我们使用的swf对象?

更好的解决方案是像谷歌的文档查看器 API 一样,但不幸的是他们的 TOS 不批准这样的用途: “您不得使用本服务开发可视化文档搜索和预览应用程序,该应用程序将 Google 文档查看器的多种用途嵌入 DOC、DOCX 或 PPTX 文件类型的单个网页中。”

I'm currently working on a web application that will be a front-end to an FTP server. The server contains a few thousands of pdf/doc/docx files and every month they add a few more dozens sometimes close to a hundred files.

The current application we have uses openoffice to convert the files to pdf. Than we use pdf2swf to convert the files to swf objects which we display in the browser. In the new application all the data is found in the FTP server and we can't store/create the swf files.

We need to first resolve the url to some resource on the server than download it to a different machine and display the document in the browser.

Is there a way (preferably in python) to generate the swf objects relatively fast to our uses?

A better solution would have been something like google's document viewer api, but unfortunately their TOS doesn't approve such a use:
"You may not use the Service to develop a visual document search and preview application which embeds multiple uses of the Google Docs Viewer in a single webpage for DOC, DOCX, or PPTX filetypes."

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

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

发布评论

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

评论(1

内心旳酸楚 2025-01-07 22:59:53
  1. 对于 PDF,您可能有兴趣使用 Mozilla 团队完成的完整 JavaScript 实现: pdf.js。您只需要使用 python 服务器提供 pdf.js 文件 + pdf :)

  2. 对于 doc/docx,您可以使用 openoffice 工具 将其转换为 PDF。然后回到 1。:)(如果您仍然想自己编写该部分,unoconv 是用 Python 编写的并使用 Python-UNO 桥)

  1. For PDF, you could be interested to use a full javascript implementation done by the Mozilla team: pdf.js. You only need to serve the pdf.js files + the pdf with your python server :)

  2. For doc/docx, you can use openoffice tools to convert them to PDF. Then back to 1. :) (if you still want to write that part yourself, unoconv is written in Python and use Python-UNO bridge)

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