Class: Bookit::Emitter::Pdf
- Defined in:
- lib/bookit/emitter/pdf.rb
Constant Summary
Constants inherited from Abstract
Instance Attribute Summary
Attributes inherited from Abstract
Instance Method Summary collapse
Methods inherited from Abstract
Constructor Details
This class inherits a constructor from Bookit::Emitter::Abstract
Instance Method Details
#generate ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/bookit/emitter/pdf.rb', line 11 def generate @pdf = Prawn::Document.new(info: { :Title => @article.title, :CreationDate => @article.date_published, :Author => @article., :Source => @article.url }, margin: 0.5.in, page_size: 'LEGAL') @pdf.font_size = [:font_size] @pdf.text @article.title, size: [:header_size], style: [:header_style] @pdf.text @article., style: :bold @pdf.text @article.date_published, size: [:subtitle_size], style: [:subtitle_style] @pdf.text @article.url, size: [:subtitle_size], style: [:subtitle_style] @pdf.text "\n\n" @article.content.formatted_content.each do |item| output(render(item)) end @pdf end |