Created
August 28, 2009 11:29
-
-
Save practicingruby/176911 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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