在网页上嵌入 Powerpoint 查看器 (PHP)
我正在构建一个 PHP 应用程序,用户可以在其中上传 Powerpoint 文件。我希望其他用户在线查看而不是下载。 (使用像google docs这样的第三方应用程序对用户来说可能有点麻烦)是否可以用PHP编写powerpoint查看器代码?
I am building a PHP application where the user upload Powerpoint files. I want the other users to view it online instead of downloading. (Using a third party apps like google docs might be a little cumbersome for the users) Is it possible to write a powerpoint viewer code in PHP?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以通过 php 自动化使用 google docs 的过程。
Google 提供了一个 ppt 查看器,可以使用以下代码嵌入到网页中。
现在我假设 php 处理用户的上传,因此很容易找到特定 ppt 文件的 url。您可以将此 url 存储在变量或数据库中,在需要时获取它并将其放在上面的代码中。
我希望我能够解释我尝试应用的逻辑,如果您需要更多规范,请告诉我。
You could automate the process of using google docs with php.
Google provides a ppt viewer that can be embed into webpages using the following code
Now im assuming php handles the uploads your users make, thus it would be easy to find the url to the specific ppt file. You could store this url either in a variable or a database, fetch it when needed and place it in the code above.
I hope I have been able to explain the logic im trying to apply, do let me know if you need more specifications.
“可以用 PHP 编写 powerpoint 查看器代码吗?”
是的。不幸的是,如果你问这个问题,你自己可能无法做到。
如果您无论如何都想尝试一下,这里是一个很好的起点:
http://msdn.microsoft.com/en-us /library/cc313106(office.12).aspx
或者您可以查找执行此操作的库。他们可能就在那里,谷歌一下就可以了。
编辑:在这里找到一个:
http://phppowerpoint.codeplex.com/
"Is it possible to write a powerpoint viewer code in PHP?"
Yes. Unfortunately, if you are asking this question, you probably won't be able to do it yourself.
If you want to try it anyways, here's a good place to start:
http://msdn.microsoft.com/en-us/library/cc313106(office.12).aspx
Or you can look for a library that does that. They are probably out there, just Google it.
EDIT: Found one here:
http://phppowerpoint.codeplex.com/
我怀疑将 powerpoint 幻灯片简化为 .PNG 文件并构建一个简单的 PHP 脚本来循环浏览图像会容易得多。
I suspect it would be much easier to reduce the powerpoint slides to .PNG files, and build a simple PHP script to cycle through the images.
可以使用 Microsoft 提供的 API 将 Powerpoint 文件嵌入到网页上。
Powerpoint files can be embedded on a webpage using the API provided by Microsoft.
您想用 PHP 重写 Powerpoint 吗?我会说...充其量是非常困难的。然而,有一些工具可以让您的生活更轻松。另外,Powerpoint 中有一个“另存为网页”选项,因此也许您可以让上传者将 powerpoint 保存为网页,然后上传该输出,我想您随后可以很容易地将其发布到网络。
或者,如果您感觉更有雄心,您可以阅读 Google 文档 API,并可能创建一个门户以供贡献者上传到 Google 文档,并为访问者查看 Google 文档。您的 PHP 前端可以利用 Google 文档的强大功能,但消除了繁琐性(我有点惊讶这是一个真实的词)。
You want to re-write Powerpoint in PHP? I'm gonna say... very difficult at best. There are, however, tools out there that make your life easier. Also, there's a "Save as web page" option in Powerpoint, so maybe you could have your uploaders save the powerpoint as a web page, and upload that output, which I would imagine would be pretty easy for you to subsequently put up on the web.
Alternatively, if you're feeling more ambitious, you could read up on the Google docs APIs, and possibly create a portal to upload to Google docs for the contributors, and view Google docs for your visitors. Your PHP frontend could leverage the power of Google docs, but eliminate the cumbersomeness (I'm kind of surprised that's a real word).