diff --git a/lib/prawn/document.rb b/lib/prawn/document.rb index 06705e80e..015418569 100644 --- a/lib/prawn/document.rb +++ b/lib/prawn/document.rb @@ -137,6 +137,7 @@ def self.generate(filename,options={},&block) # :compress:: Compresses content streams before rendering them [false] # :optimize_objects:: Reduce number of PDF objects in output, at expense of render time [false] # :background:: An image path to be used as background on all pages [nil] + # :background_scale:: Backgound image scale [1] [nil] # :info:: Generic hash allowing for custom metadata properties [nil] # :template:: The path to an existing PDF file to use as a template [nil] # @@ -186,6 +187,7 @@ def initialize(options={},&block) min_version(state.store.min_version) if state.store.min_version @background = options[:background] + @background_scale = options[:background_scale] || 1 @font_size = 12 @bounding_box = nil @@ -278,7 +280,7 @@ def start_new_page(options = {}) state.insert_page(state.page, @page_number) @page_number += 1 - canvas { image(@background, :at => bounds.top_left) } if @background + canvas { image(@background, :scale => @background_scale, :at => bounds.top_left) } if @background @y = @bounding_box.absolute_top float do