Class: Html2Pdf::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/html2pdf/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

rubocop:disable MethodLength



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/html2pdf/configuration.rb', line 5

def initialize
  # see: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt
  @options = {
    wkhtmltopdf: (defined?(Bundler::GemfileError) ? `bundle exec which wkhtmltopdf` : `which wkhtmltopdf`).chomp,
    page_settings: [
      "--margin-top 4",
      "--margin-bottom 4",
      "--margin-left 4",
      "--margin-right 4",
      '--header-center "[webpage] :: [page]/[topage]"',
      "--header-spacing 1",
      "--header-font-size 8",
      "--header-line",
      "--footer-spacing 1",
      "--footer-font-size 8",
      "--footer-line"
    ]
  }
end

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



3
4
5
# File 'lib/html2pdf/configuration.rb', line 3

def options
  @options
end