module Hpdf::Grid

Overview

Grip 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

Defined in:

hpdf/grid.cr

Instance Method Summary

Instance Method Detail

def 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 shoild be drawn horizontally, every fat line has a text marker

[View source]
def draw_horizontal_lines(*, step = 5, fat_line_every = 2) #

part of #draw_grid.


[View source]
def draw_horizontal_text(*, step = 5, fat_line_every = 2) #

part of #draw_grid.


[View source]
def draw_vertical_lines(*, step = 5, fat_line_every = 2) #

part of #draw_grid.


[View source]
def draw_vertical_text(*, step = 5, fat_line_every = 2) #

part of #draw_grid.


[View source]