mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 01:03:18 +08:00
Simplify generation of PDF previwe files
This commit is contained in:
parent
03d7affaae
commit
83d450c445
1 changed files with 2 additions and 9 deletions
|
@ -12,17 +12,10 @@ module Paperclip
|
|||
|
||||
begin
|
||||
if @file.content_type == 'application/pdf'
|
||||
content = Paperclip.run(
|
||||
Paperclip.run(
|
||||
pdftoppm_path,
|
||||
"-singlefile -r 72 -png #{@file.path}"
|
||||
"-singlefile -r 72 -png #{@file.path} #{File.join(directory, basename)}"
|
||||
)
|
||||
|
||||
# Save intermediate content to tempfile
|
||||
tmp = TempfileFactory.new.generate
|
||||
tmp.write(content)
|
||||
tmp.rewind
|
||||
|
||||
original_preview_file = tmp.path
|
||||
else
|
||||
Paperclip.run(
|
||||
libreoffice_path,
|
||||
|
|
Loading…
Reference in a new issue