class Pdfs2Pdf::Configuration

Attributes

default_options[RW]
gs_binary[RW]
pdfmarks_meta[RW]

Public Class Methods

new() click to toggle source
# File lib/pdfs2pdf/configuration.rb, line 7
    def initialize
      # see: http://wkhtmltopdf.org/usage/wkhtmltopdf.txt
      @default_options = {
        paper_size:    "A4", # or 'Letter'
        margin_top:    "0.75in",
        margin_right:  "0.75in",
        margin_bottom: "0.75in",
        margin_left:   "0.75in",
        encoding:      "UTF-8"
      }

      # see: http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/pdf_creation_apis_and_specs/pdfmarkReference.pdf
      @pdfmarks_meta = <<-END.gsub(/^\s+\|/, "")
        |[ /Title (My Combined Pdf)
        |  /Author (Burin Choomnuan)
        |  /Keywords (fun, witty, interesting)
        |  /DOCINFO pdfmark
      END

      @gs_binary = (defined?(Bundler::GemfileError) ? `bundle exec which gs` : `which gs`).chomp
    end