Convert several types of documents (xls, doc, gif, png) to pdf in ruby

I am looking for a way to do this in ruby ​​on a rails application. It is necessary to do this locally in my service, since the data is sensitive, I can not use external web services for this.

The most important are images of various types, as most people scan documents.

+3
source share
3 answers

Install LibreOffice and Unoconv on your server and run the command.

unoconv -f pdf File.doc

If you want to execute it only using LibreOffice,

./soffice --headless --convert-to pdf destination_path source_file_path / *. doc

+3
source

Prawn?

, . StackOverflow, . :

+2

Now there is only one solution to the problem. I am working on PDF Converter Services, so I find myself biased, but I recently wrote a blog post on how to convert regular file types like DOC, XLS, PPT, HTML, etc. To PDF (and many other file types) using Ruby. See this post for more details .

+1
source

Source: https://habr.com/ru/post/1782650/


All Articles