Class: Com::PdfsController
Constant Summary
RailsCom::Application::LOCALE_MAP
Instance Method Summary
collapse
#current_title, #default_form_params, #default_params, #json_format?, #set_country, #set_flash, #set_locale, #set_timezone, #set_variant
Instance Method Details
#jpg ⇒ Object
17
18
19
20
21
22
|
# File 'app/controllers/com/pdfs_controller.rb', line 17
def jpg
require 'vips'
buffer = Vips::Image.pdfload_buffer @pdf.render
send_data buffer.write_to_buffer('.jpg'), filename: 'cert_file.jpg', disposition: @disposition, type: 'image/jpg'
end
|
#png ⇒ Object
10
11
12
13
14
15
|
# File 'app/controllers/com/pdfs_controller.rb', line 10
def png
require 'vips'
buffer = Vips::Image.pdfload_buffer @pdf.render
send_data buffer.write_to_buffer('.png'), filename: 'cert_file.png', disposition: @disposition, type: 'image/png'
end
|
#show ⇒ Object
6
7
8
|
# File 'app/controllers/com/pdfs_controller.rb', line 6
def show
send_data @pdf.render, filename: 'cert_file.pdf', disposition: @disposition, type: 'application/pdf'
end
|