Skip to content

Instantly share code, notes, and snippets.

Created May 28, 2013 12:56
Show Gist options
  • Save anonymous/59b446c37c2619ca6461 to your computer and use it in GitHub Desktop.
Save anonymous/59b446c37c2619ca6461 to your computer and use it in GitHub Desktop.
# Converts a TIFF to PDF using tiff2pdf
def tiff2pdf(tiff_data)
cmd = %W[tiff2pdf -p A4 -c FFM -t #{@timestamp}]
file_to_convert = Tempfile.new('ffm')
file_to_convert.write(tiff_data)
file_to_convert.rewind
# begin
`#{cmd.join(' ')} #{file_to_convert.path}`
ensure
file_to_convert.close
file_to_convert.unlink
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment