I am using paperclip to download pdf. Once the file is uploaded, I need to split each page into png. This is a team, I think I need to use
convert -size 640x300 fileName.pdf slide.png
Now, if I run this command from the terminal, it works fine, but I need to get each slide name so that I can add it to the model.
What is the best way to achieve this?
use `command` to execute system codes (` -quotes)
`convert -size 640x300 fileName.pdf slide.png`
You should be able to do this conversion for you at boot time, for example:
has_attached_file :pdfupload, :styles => { :pinged => ["640x300", :png] }
PNG :
<%= image_tag @mymodel.pdfupload.url(:pinged) %>
(, .)
Source: https://habr.com/ru/post/1740057/More articles:Am I deleting this correctly? - c ++Стрелки обобщения - oopUnable to connect to socket on different networks - javaPHP: how to find the most used array key? - arraysОшибки разработки Fluid в ie7 - htmlskip reading headers in MATLAB - file-ioSolving the quadratic equation, but getting weird errors - fortranIs there a way to close a Unix socket for reading or writing? - unixCabal: error message / missing documentation - haskellwget.listing file, there is a way to specify its name - linuxAll Articles