Skip to content

Instantly share code, notes, and snippets.

@practicingruby
Created August 28, 2009 11:29
Show Gist options
  • Select an option

  • Save practicingruby/176911 to your computer and use it in GitHub Desktop.

Select an option

Save practicingruby/176911 to your computer and use it in GitHub Desktop.
Prawn::Document.generate("raw_lines.pdf", :skip_page_creation => true) do
# SET UP A PAGE
@page_content = ref(:Length => 0)
@current_page = ref(:Type => :Page,
:Parent => @pages,
:MediaBox => [0, 0, 612.0, 792.0],
:Contents => @page_content)
# ADD IT TO THE PAGE LIST
@pages.data[:Kids] << @current_page
@pages.data[:Count] += 1
# SAVE GRAPHICS STATE
add_content "q"
# SET UP FILL / STROKE COLOR
add_content "0 0 0 rg"
add_content "0 0 0 rg"
add_content("36 756 m") # move
add_content("576 36 l") # draw path
add_content("S") # stroke
# RESTORE GRAPHICS STATE
add_content "Q"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment