class PDFKit::Configuration

Attributes

default_options[RW]
meta_tag_prefix[RW]
root_url[RW]
verbose[W]
wkhtmltopdf[W]

Public Class Methods

new() click to toggle source
# File lib/pdfkit/configuration.rb, line 6
def initialize
  @verbose         = false
  @meta_tag_prefix = 'pdfkit-'
  @default_options = {
    :disable_smart_shrinking => false,
    :quiet => true,
    :page_size => 'Letter',
    :margin_top => '0.75in',
    :margin_right => '0.75in',
    :margin_bottom => '0.75in',
    :margin_left => '0.75in',
    :encoding => 'UTF-8'
  }
end

Public Instance Methods

quiet?() click to toggle source
# File lib/pdfkit/configuration.rb, line 25
def quiet?
  !@verbose
end
verbose?() click to toggle source
# File lib/pdfkit/configuration.rb, line 29
def verbose?
  @verbose
end
wkhtmltopdf() click to toggle source
# File lib/pdfkit/configuration.rb, line 21
def wkhtmltopdf
  @wkhtmltopdf ||= (defined?(Bundler::GemfileError) && File.exists?('Gemfile') ? %x`bundle exec which wkhtmltopdf` : %x`which wkhtmltopdf`).chomp
end