-
-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathpdfs_controller.rb
More file actions
27 lines (25 loc) · 832 Bytes
/
pdfs_controller.rb
File metadata and controls
27 lines (25 loc) · 832 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class PdfsController < ApplicationController
def index
end
def show
respond_to do |format|
format.html
format.pdf {
render ferrum_pdf: {
display_header_footer: true,
header_template: FerrumPdf::DEFAULT_HEADER_TEMPLATE,
footer_template: FerrumPdf::DEFAULT_FOOTER_TEMPLATE
},
disposition: :inline,
filename: "example.pdf"
}
format.png { render ferrum_screenshot: {}, disposition: :inline, filename: "example.png" }
end
end
def url
respond_to do |format|
format.pdf { render ferrum_pdf: { url: params[:url] }, disposition: :inline, filename: "example.pdf" }
format.png { render ferrum_screenshot: { url: params[:url], full: params[:full] }, disposition: :inline, filename: "example.png" }
end
end
end