且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 Rails 4 Paperclip 中显示 PowerPoint 演示文稿?/

更新时间:2023-02-14 23:42:12

假设您的意思是希望它们嵌入到浏览器中,我已经通过将它们上传到 Scribd 在后台,然后显示嵌入的小部件.这是一个很好的解决方案,因为将 PPT 文件转换为干净的 HTML 很困难(所以让其他人解决),而且您不必为这些文件的托管或带宽付费.

Assuming you mean that you want them to be embedded in the browser, I've solved this by uploading the them to Scribd in the background and then displaying the embedded widget. This is a great solution because turning a PPT file into clean HTML is hard (so let someone else work it out), and you do not have to pay for hosting or bandwidth for those files.

这样做比强制用户为他们的浏览器安装 Office 插件要好得多,这取决于他们可能没有的平台.

It's a lot nicer to do it this way than to force the user to have an Office plugin installed for their browser, which depending on their platform they may not have.

Scribd_fu gem 可以与 Paperclip 一起使用,或者您可以使用官方的 RScribd gem 并推出您自己的.

The Scribd_fu gem will work with Paperclip, or you could use the official RScribd gem and roll your own.