Module: PDFGen

Defined in:
lib/div.rb,
lib/span.rb,
lib/image.rb,
lib/table.rb,
lib/caption.rb,
lib/pdf_gen.rb,
lib/document.rb,
lib/data/ds_ar.rb,
lib/base_region.rb,
lib/smart_table.rb,
lib/data/ds_base.rb,
lib/data/ds_hash.rb,
lib/modules/canvas.rb,
lib/modules/composite.rb,
lib/containers/div_container.rb,
lib/containers/span_container.rb,
lib/containers/image_container.rb,
lib/containers/table_container.rb,
lib/containers/caption_container.rb

Defined Under Namespace

Modules: Canvas, CaptionContainer, Composite, DivContainer, ImageContainer, SpanContainer, TableContainer Classes: BaseRegion, Caption, Div, Document, DsActiveRecord, DsBase, DsHash, Image, SmartTable, Span, Table

Class Method Summary collapse

Class Method Details

.document(pdf, page_pad_top, &initialization_block) ⇒ Object



22
23
24
25
26
27
28
# File 'lib/pdf_gen.rb', line 22

def self.document(pdf, page_pad_top, &initialization_block)
  document = Document.new(pdf, page_pad_top)
  document.width = document.pdf.page_width
  document.instance_eval(&initialization_block)
  document.render
  pdf
end