sandal (owner)

Revisions

  • 8d6015 Fri Aug 28 04:29:11 -0700 2009
gist: 176911 Download_button fork
public
Public Clone URL: git://gist.github.com/176911.git
Embed All Files: show embed
low_level.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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