Virtual pages

shairontoledo edited this page Sep 13, 2010 · 2 revisions

With method virtual_pages you can define any number of virtual pages per physical page. The cursor on the virtual page jumps in columns for each virtual page and runs primitive next_page when columns end. Look at the example below. Example for a document without virtual pages. We will have


 doc=RGhost::Document.new
 doc.text File.readlines("/tmp/mytext.txt")

will generate

Now for a document with 3 virtual pages


 doc=RGhost::Document.new
 doc.virtual_pages do
   new_page :width => 4
   new_page :width => 7, :margin_left => 1
   new_page :width => 4, :margin_left => 1
 end
 doc.text File.readlines("/tmp/mytext.txt")

will generate

PS: The parameter margin_left on the first virtual page won‘t be used because it will use the page‘s margin_left.