module

Hpdf::Grid

Grid is a helper to draw a fine grid on the page. Use it in your custom Doc#page pages:

class MyPage < Hpdf::Page
  include Hpdf::Grid
  # ...
end

Hpdf::Doc.build do |pdf|
  page(MyPage) do |page|
    # ...
  end
end

Instance methods

draw_grid(*, font_name = Base14::Helvetica, step = 5, vertical_fat_line_every vfle = 10, horizontal_fat_line_every hfle = 2)

draws a gray grid on the current page.

  • font_name the text for the grid axes
  • step the step size in points that should be used by the grid
  • vertical_fat_line_every how often a fat line should be drawn vertically, every fat line has a text marker
  • horizontal_fat_line_every how often a fat line should be drawn horizontally, every fat line has a text marker
Source
draw_horizontal_lines(*, step = 5, fat_line_every = 2)

part of draw_grid.

Source
draw_horizontal_text(*, step = 5, fat_line_every = 2)

part of draw_grid.

Source
draw_vertical_lines(*, step = 5, fat_line_every = 2)

part of draw_grid.

Source
draw_vertical_text(*, step = 5, fat_line_every = 2)

part of draw_grid.

Source