How convert powerpoint presentation in serverside to png
This is super-complicated (involves either reverse-engineering the various Microsoft PowerPoint formats, and re-rendering them as images, or else having a copy of PowerPoint on a server and writing code that will open files within it and screen capture them), and isn't something you're going to be able to do within Ruby on Rails.
Your best bet is to either 1) look into using SlideShare, or a similar service, via APIs and then embedding them within your side or 2) let people upload powerpoint files, and then if others want to view them, they have to download them again and re-open them within the application.
Or alternatively don't let people upload powerpoint files at all - instead get them to export their presentations as images or a PDF (which many browsers can view nowadays).
Rails image documents
Here are some common ones:
- RMagick (probably most advanced one
- ImageScience
- MiniMagick
PS: you can convert PDFs to JPG to using RMagick :)
Edit: Converting MS Office Documents to images can be done using OpenOffice - here are two solutions:
- JODConverter (See second answer)
- Convert to PDF (using CUPS-PDF printer driver) like:
openoffice.org2.4 -norestore -nofirststartwizard -nologo -headless -pt Cups-PDF sample.ppt
and then you can convert the PDF to an image.
How to get a proper filepath of Tempfile in Rails when seeing Getting Errno::ENOENT ' no such file or directory @ rb_sysopen'
In your ensure you are using tempfile.close! this unlinks the file per https://ruby-doc.org/stdlib-2.5.3/libdoc/tempfile/rdoc/Tempfile.html#method-i-close-21
If you just use close without the bang (!) then you should be all set!
Related Topics
Rails 5 Db Migration: How to Fix Activerecord::Concurrentmigrationerror
Set Locale Automatically in Ruby on Rails
How to Find If Range Is Contained in an Array of Ranges
How to Set a Hook to Run Code at the End of a Ruby Class Definition
Rails Shows "Warning: Can't Verify Csrf Token Authenticity" from a Restkit Post
Can't Convert String into Integer in Ruby/Ruby-On-Rails
-': Nil Can't Be Coerced into Fixnum (Typeerror)
Cannot Start Rails Server, "No Such File to Load -- Bundler/Setup"
How to Read Only X Number of Bytes of the Body Using Net::Http
Preserving Case in Http Headers with Ruby's Net:Http
How to Reset a Factory_Girl Sequence
Rails Form Object with Virtus: Has_Many Association
In Ruby, How to Get Instance Variables in a Hash Instead of an Array
Using Phonegap as a Native Container for a Rails 3 App
How to Rescue from a 'Require': No Such File to Load in Ruby