Class: TankaRenderer::Renderer::PDF

Inherits:
Object
  • Object
show all
Includes:
Base
Defined in:
lib/tanka_renderer/renderer/pdf.rb

Instance Attribute Summary

Attributes included from Base

#body_color, #font, #height, #text_color, #vertical, #width

Instance Method Summary collapse

Methods included from Base

#draw, #guess_font, #initialize

Instance Method Details

#render(text, output_path) ⇒ Object



8
9
10
11
12
13
14
15
16
# File 'lib/tanka_renderer/renderer/pdf.rb', line 8

def render(text, output_path)
  super
  Cairo::PDFSurface.new(output_path, @width, @height) do |surface|
    Cairo::Context.new(surface) do |context|
      draw(context, text)
      context.show_page
    end
  end
end