Class: MapPrint::PdfHandler
- Inherits:
-
Object
- Object
- MapPrint::PdfHandler
- Defined in:
- lib/map_print/pdf_handler.rb
Instance Method Summary collapse
-
#initialize(context) ⇒ PdfHandler
constructor
A new instance of PdfHandler.
- #print ⇒ Object
Methods included from MapPrint::PdfHandlers::Texts
Methods included from MapPrint::PdfHandlers::Images
Constructor Details
#initialize(context) ⇒ PdfHandler
Returns a new instance of PdfHandler.
9 10 11 |
# File 'lib/map_print/pdf_handler.rb', line 9 def initialize(context) @context = context end |
Instance Method Details
#print ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/map_print/pdf_handler.rb', line 13 def print @pdf = Prawn::Document.new @context. || {} print_map print_images(@context.images, @pdf) print_texts(@context.texts, @pdf) = @context. if print_image(.path, @context.[:position]) end legend_image = @context.print_legend if legend_image print_image(legend_image.path, @context.legend[:position]) end @pdf.render_file(@context.output_path) end |