prawn 2.0.1 → 2.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +7 -5
  3. data/lib/prawn.rb +4 -4
  4. data/lib/prawn/document.rb +47 -46
  5. data/lib/prawn/document/bounding_box.rb +13 -19
  6. data/lib/prawn/document/column_box.rb +3 -5
  7. data/lib/prawn/document/internals.rb +0 -1
  8. data/lib/prawn/document/span.rb +12 -12
  9. data/lib/prawn/errors.rb +32 -33
  10. data/lib/prawn/font.rb +29 -36
  11. data/lib/prawn/font/afm.rb +20 -20
  12. data/lib/prawn/font/dfont.rb +0 -1
  13. data/lib/prawn/font/ttf.rb +30 -27
  14. data/lib/prawn/font_metric_cache.rb +4 -8
  15. data/lib/prawn/graphics.rb +37 -42
  16. data/lib/prawn/graphics/cap_style.rb +1 -1
  17. data/lib/prawn/graphics/color.rb +21 -23
  18. data/lib/prawn/graphics/dash.rb +5 -6
  19. data/lib/prawn/graphics/join_style.rb +1 -2
  20. data/lib/prawn/graphics/patterns.rb +25 -21
  21. data/lib/prawn/graphics/transformation.rb +4 -5
  22. data/lib/prawn/graphics/transparency.rb +6 -8
  23. data/lib/prawn/grid.rb +21 -14
  24. data/lib/prawn/image_handler.rb +2 -2
  25. data/lib/prawn/images.rb +29 -31
  26. data/lib/prawn/images/image.rb +1 -1
  27. data/lib/prawn/images/jpg.rb +10 -12
  28. data/lib/prawn/images/png.rb +13 -13
  29. data/lib/prawn/measurements.rb +7 -14
  30. data/lib/prawn/outline.rb +6 -6
  31. data/lib/prawn/repeater.rb +1 -5
  32. data/lib/prawn/security.rb +17 -25
  33. data/lib/prawn/security/arcfour.rb +1 -1
  34. data/lib/prawn/soft_mask.rb +11 -12
  35. data/lib/prawn/stamp.rb +16 -8
  36. data/lib/prawn/text.rb +23 -20
  37. data/lib/prawn/text/box.rb +3 -6
  38. data/lib/prawn/text/formatted/arranger.rb +9 -12
  39. data/lib/prawn/text/formatted/box.rb +23 -22
  40. data/lib/prawn/text/formatted/fragment.rb +0 -4
  41. data/lib/prawn/text/formatted/line_wrap.rb +13 -24
  42. data/lib/prawn/text/formatted/parser.rb +16 -20
  43. data/lib/prawn/text/formatted/wrap.rb +2 -7
  44. data/lib/prawn/utilities.rb +6 -3
  45. data/lib/prawn/version.rb +1 -1
  46. data/manual/basic_concepts/basic_concepts.rb +0 -2
  47. data/manual/basic_concepts/view.rb +1 -1
  48. data/manual/bounding_box/bounding_box.rb +0 -3
  49. data/manual/bounding_box/russian_boxes.rb +7 -8
  50. data/manual/bounding_box/stretchy.rb +0 -1
  51. data/manual/contents.rb +2 -2
  52. data/manual/cover.rb +11 -12
  53. data/manual/document_and_page_options/document_and_page_options.rb +2 -5
  54. data/manual/document_and_page_options/metadata.rb +10 -10
  55. data/manual/document_and_page_options/page_size.rb +0 -1
  56. data/manual/graphics/fill_rules.rb +5 -4
  57. data/manual/graphics/graphics.rb +0 -3
  58. data/manual/graphics/lines_and_curves.rb +1 -1
  59. data/manual/graphics/rotate.rb +0 -2
  60. data/manual/graphics/scale.rb +4 -2
  61. data/manual/graphics/soft_masks.rb +0 -1
  62. data/manual/graphics/stroke_cap.rb +1 -1
  63. data/manual/graphics/stroke_join.rb +1 -1
  64. data/manual/graphics/translate.rb +3 -3
  65. data/manual/graphics/transparency.rb +0 -1
  66. data/manual/how_to_read_this_manual.rb +0 -1
  67. data/manual/images/images.rb +0 -3
  68. data/manual/layout/boxes.rb +5 -5
  69. data/manual/layout/content.rb +2 -2
  70. data/manual/layout/layout.rb +0 -3
  71. data/manual/outline/outline.rb +0 -3
  72. data/manual/repeatable_content/page_numbering.rb +1 -1
  73. data/manual/repeatable_content/repeatable_content.rb +0 -3
  74. data/manual/repeatable_content/repeater.rb +6 -6
  75. data/manual/security/encryption.rb +0 -2
  76. data/manual/security/permissions.rb +0 -2
  77. data/manual/security/security.rb +0 -3
  78. data/manual/text/alignment.rb +3 -3
  79. data/manual/text/color.rb +0 -1
  80. data/manual/text/column_box.rb +0 -1
  81. data/manual/text/fallback_fonts.rb +2 -2
  82. data/manual/text/formatted_callbacks.rb +3 -2
  83. data/manual/text/paragraph_indentation.rb +2 -3
  84. data/manual/text/registering_families.rb +13 -9
  85. data/manual/text/rotation.rb +0 -1
  86. data/manual/text/text.rb +0 -3
  87. data/manual/text/text_box_overflow.rb +7 -5
  88. data/manual/text/utf8.rb +1 -1
  89. data/manual/text/win_ansi_charset.rb +2 -2
  90. data/prawn.gemspec +4 -4
  91. data/spec/acceptance/png.rb +6 -7
  92. data/spec/annotations_spec.rb +21 -28
  93. data/spec/bounding_box_spec.rb +100 -109
  94. data/spec/column_box_spec.rb +26 -32
  95. data/spec/destinations_spec.rb +2 -4
  96. data/spec/document_spec.rb +145 -151
  97. data/spec/extensions/mocha.rb +0 -1
  98. data/spec/font_metric_cache_spec.rb +7 -7
  99. data/spec/font_spec.rb +103 -102
  100. data/spec/formatted_text_arranger_spec.rb +76 -74
  101. data/spec/formatted_text_box_spec.rb +170 -159
  102. data/spec/formatted_text_fragment_spec.rb +57 -56
  103. data/spec/graphics_spec.rb +158 -175
  104. data/spec/grid_spec.rb +28 -29
  105. data/spec/image_handler_spec.rb +4 -5
  106. data/spec/images_spec.rb +50 -36
  107. data/spec/inline_formatted_text_parser_spec.rb +397 -393
  108. data/spec/jpg_spec.rb +4 -6
  109. data/spec/line_wrap_spec.rb +54 -55
  110. data/spec/measurement_units_spec.rb +12 -15
  111. data/spec/outline_spec.rb +77 -98
  112. data/spec/png_spec.rb +55 -65
  113. data/spec/reference_spec.rb +3 -3
  114. data/spec/repeater_spec.rb +20 -26
  115. data/spec/security_spec.rb +42 -49
  116. data/spec/soft_mask_spec.rb +4 -5
  117. data/spec/span_spec.rb +5 -6
  118. data/spec/spec_helper.rb +2 -4
  119. data/spec/stamp_spec.rb +41 -22
  120. data/spec/stroke_styles_spec.rb +36 -39
  121. data/spec/text_at_spec.rb +28 -29
  122. data/spec/text_box_spec.rb +160 -165
  123. data/spec/text_rendering_mode_spec.rb +9 -9
  124. data/spec/text_spacing_spec.rb +13 -13
  125. data/spec/text_spec.rb +116 -124
  126. data/spec/text_with_inline_formatting_spec.rb +5 -5
  127. data/spec/transparency_spec.rb +20 -20
  128. data/spec/view_spec.rb +0 -1
  129. metadata +7 -7
@@ -6,9 +6,7 @@
6
6
  require_relative "../example_helper"
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("basic_concepts.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "basic_concepts" do |p|
11
-
12
10
  p.example "creation", :eval_source => false, :full_source => true
13
11
  p.example "origin"
14
12
  p.example "cursor"
@@ -32,7 +32,7 @@ class Greeter
32
32
  text "Goodbye, #{@name}!"
33
33
  end
34
34
  end
35
- end
35
+ end
36
36
 
37
37
  greeter = Greeter.new("Gregory")
38
38
 
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("bounding_box.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "bounding_box" do |p|
11
-
12
10
  p.section "Basics" do |s|
13
11
  s.example "creation"
14
12
  s.example "bounds"
@@ -34,6 +32,5 @@ Prawn::ManualBuilder::Example.generate("bounding_box.pdf", :page_size => "FOLIO"
34
32
  "Indent blocks"
35
33
  )
36
34
  end
37
-
38
35
  end
39
36
  end
@@ -13,21 +13,21 @@ Prawn::ManualBuilder::Example.generate(filename) do
13
13
  output = []
14
14
  a1.each do |i1|
15
15
  a2.each do |i2|
16
- output += [[i1,i2]]
16
+ output += [[i1, i2]]
17
17
  end
18
18
  end
19
19
  output
20
20
  end
21
21
 
22
- def recurse_bounding_box(max_depth=4, depth=1)
23
- width = (bounds.width-15)/2
24
- height = (bounds.height-15)/2
25
- left_top_corners = combine([5, bounds.right-width-5],
26
- [bounds.top-5, height+5])
22
+ def recurse_bounding_box(max_depth = 4, depth = 1)
23
+ width = (bounds.width - 15) / 2
24
+ height = (bounds.height - 15) / 2
25
+ left_top_corners = combine([5, bounds.right - width - 5],
26
+ [bounds.top - 5, height + 5])
27
27
  left_top_corners.each do |lt|
28
28
  bounding_box(lt, :width => width, :height => height) do
29
29
  stroke_bounds
30
- recurse_bounding_box(max_depth, depth+1) if depth < max_depth
30
+ recurse_bounding_box(max_depth, depth + 1) if depth < max_depth
31
31
  end
32
32
  end
33
33
  end
@@ -37,4 +37,3 @@ Prawn::ManualBuilder::Example.generate(filename) do
37
37
  recurse_bounding_box
38
38
  end
39
39
  end
40
-
@@ -27,5 +27,4 @@ Prawn::ManualBuilder::Example.generate(filename) do
27
27
 
28
28
  transparent(0.5) { stroke_bounds }
29
29
  end
30
-
31
30
  end
@@ -7,8 +7,8 @@ require_relative "example_helper"
7
7
  Encoding.default_external = Encoding::UTF_8
8
8
 
9
9
  Prawn::ManualBuilder::Example.generate("manual.pdf",
10
- :skip_page_creation => true, :page_size => "FOLIO") do
11
-
10
+ :skip_page_creation => true,
11
+ :page_size => "FOLIO") do
12
12
  load_page "", "cover"
13
13
  load_page "", "how_to_read_this_manual"
14
14
 
@@ -13,14 +13,14 @@ Prawn::ManualBuilder::Example.generate(filename) do
13
13
  :scale => 0.9,
14
14
  :at => [10, cursor]
15
15
 
16
- formatted_text_box([ {:text => "Prawn\n",
17
- :styles => [:bold],
18
- :size => 100}
16
+ formatted_text_box([ { :text => "Prawn\n",
17
+ :styles => [:bold],
18
+ :size => 100 }
19
19
  ], :at => [170, cursor - 50])
20
20
 
21
- formatted_text_box([ {:text => "by example",
22
- :font => 'Courier',
23
- :size => 60}
21
+ formatted_text_box([ { :text => "by example",
22
+ :font => 'Courier',
23
+ :size => 60 }
24
24
  ], :at => [170, cursor - 160])
25
25
 
26
26
  if Dir.exist?("#{Prawn::BASEDIR}/.git")
@@ -30,10 +30,9 @@ Prawn::ManualBuilder::Example.generate(filename) do
30
30
  git_commit = ""
31
31
  end
32
32
 
33
- formatted_text_box([ {:text => "Last Update: #{Time.now.strftime("%Y-%m-%d")}\n"+
34
- "Prawn Version: #{Prawn::VERSION}\n"+
35
- git_commit,
36
- :size => 12}
37
- ], :at => [390, cursor - 620])
38
-
33
+ formatted_text_box([ { :text => "Last Update: #{Time.now.strftime("%Y-%m-%d")}\n" +
34
+ "Prawn Version: #{Prawn::VERSION}\n" +
35
+ git_commit,
36
+ :size => 12 }
37
+ ], :at => [390, cursor - 620])
39
38
  end
@@ -6,15 +6,13 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("document_and_page_options.pdf",
9
- :page_size => "FOLIO") do
10
-
9
+ :page_size => "FOLIO") do
11
10
  package "document_and_page_options" do |p|
12
-
13
11
  p.example "page_size", :eval_source => false, :full_source => true
14
12
  p.example "page_margins", :eval_source => false, :full_source => true
15
13
  p.example "background", :eval_source => false, :full_source => true
16
14
  p.example "metadata", :eval_source => false, :full_source => true
17
- p.example "print_scaling",:eval_source => false, :full_source => true
15
+ p.example "print_scaling", :eval_source => false, :full_source => true
18
16
 
19
17
  p.intro do
20
18
  prose("So far we've already seen how to create new documents and start new pages. This chapter expands on the previous examples by showing other options avialable. Some of the options are only available when creating new documents.
@@ -27,6 +25,5 @@ Prawn::ManualBuilder::Example.generate("document_and_page_options.pdf",
27
25
  "How to add metadata to the generated PDF"
28
26
  )
29
27
  end
30
-
31
28
  end
32
29
  end
@@ -7,17 +7,17 @@
7
7
  require File.expand_path(File.join(File.dirname(__FILE__),
8
8
  %w[.. example_helper]))
9
9
 
10
- Prawn::Document.generate("metadata.pdf",
11
- :info => {
12
- :Title => "My title",
13
- :Author => "John Doe",
14
- :Subject => "My Subject",
15
- :Keywords => "test metadata ruby pdf dry",
16
- :Creator => "ACME Soft App",
17
- :Producer => "Prawn",
18
- :CreationDate => Time.now
19
- }) do
10
+ info = {
11
+ :Title => "My title",
12
+ :Author => "John Doe",
13
+ :Subject => "My Subject",
14
+ :Keywords => "test metadata ruby pdf dry",
15
+ :Creator => "ACME Soft App",
16
+ :Producer => "Prawn",
17
+ :CreationDate => Time.now
18
+ }
20
19
 
20
+ Prawn::Document.generate("metadata.pdf", :info => info) do
21
21
  text "This is a test of setting metadata properties via the info option."
22
22
  text "While the keys are arbitrary, the above example sets common attributes."
23
23
  end
@@ -24,7 +24,6 @@ Prawn::Document.generate("page_size.pdf",
24
24
  custom_size = [275, 326]
25
25
 
26
26
  ["A4", "TABLOID", "B7", custom_size ].each do |size|
27
-
28
27
  start_new_page(:size => size, :layout => :portrait)
29
28
  text "#{size} portrait page."
30
29
 
@@ -26,12 +26,13 @@ Prawn::ManualBuilder::Example.generate(filename) do
26
26
  stroke_color 'ff0000'
27
27
  line_width 2
28
28
 
29
- text_box "Nonzero Winding Number", :at => [50, 215], :width => 170,
30
- :align => :center
31
- polygon(*pentagram.map { |x, y| [x+50, y] })
29
+ text_box "Nonzero Winding Number", :at => [50, 215],
30
+ :width => 170,
31
+ :align => :center
32
+ polygon(*pentagram.map { |x, y| [x + 50, y] })
32
33
  fill_and_stroke
33
34
 
34
35
  text_box "Even-Odd", :at => [330, 215], :width => 170, :align => :center
35
- polygon(*pentagram.map { |x, y| [x+330, y] })
36
+ polygon(*pentagram.map { |x, y| [x + 330, y] })
36
37
  fill_and_stroke(:fill_rule => :even_odd)
37
38
  end
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("graphics.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "graphics" do |p|
11
-
12
10
  p.section "Basics" do |s|
13
11
  s.example "helper"
14
12
  s.example "fill_and_stroke"
@@ -53,6 +51,5 @@ Prawn::ManualBuilder::Example.generate("graphics.pdf", :page_size => "FOLIO") do
53
51
  "How to apply transformations to your drawing space"
54
52
  )
55
53
  end
56
-
57
54
  end
58
55
  end
@@ -35,7 +35,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
35
35
 
36
36
  # line and curve
37
37
  stroke do
38
- line [300,200], [400,50]
38
+ line [300, 200], [400, 50]
39
39
  curve [500, 0], [400, 200], :bounds => [[600, 300], [300, 390]]
40
40
  end
41
41
  end
@@ -18,9 +18,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
18
18
  fill_circle [250, 200], 2
19
19
 
20
20
  12.times do |i|
21
-
22
21
  rotate(i * 30, :origin => [250, 200]) do
23
-
24
22
  stroke_rectangle [350, 225], 100, 50
25
23
  draw_text "Rotated #{i * 30}°", :size => 10, :at => [360, 205]
26
24
  end
@@ -25,7 +25,8 @@ Prawn::ManualBuilder::Example.generate(filename) do
25
25
  scale(2, :origin => [x, y]) do
26
26
  stroke_rectangle [x, y], width, height
27
27
  text_box "rectangle scaled from upper-left corner",
28
- :at => [x, y - height - 5], :width => width
28
+ :at => [x, y - height - 5],
29
+ :width => width
29
30
  end
30
31
 
31
32
  x = 350
@@ -36,6 +37,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
36
37
  scale(2, :origin => [x + width / 2, y - height / 2]) do
37
38
  stroke_rectangle [x, y], width, height
38
39
  text_box "rectangle scaled from center",
39
- :at => [x, y - height - 5], :width => width
40
+ :at => [x, y - height - 5],
41
+ :width => width
40
42
  end
41
43
  end
@@ -42,5 +42,4 @@ Prawn::ManualBuilder::Example.generate(filename) do
42
42
  fill_color '61bb46'
43
43
  fill_rectangle [0, 160], 600, 20
44
44
  end
45
-
46
45
  end
@@ -24,7 +24,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
24
24
  [:butt, :round, :projecting_square].each_with_index do |cap, i|
25
25
  self.cap_style = cap
26
26
 
27
- y = 250 - i*100
27
+ y = 250 - i * 100
28
28
  stroke_horizontal_line 100, 300, :at => y
29
29
  stroke_circle [400, y], 15
30
30
  end
@@ -19,7 +19,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
19
19
  [:miter, :round, :bevel].each_with_index do |style, i|
20
20
  self.join_style = style
21
21
 
22
- y = 200 - i*100
22
+ y = 200 - i * 100
23
23
  stroke do
24
24
  move_to(100, y)
25
25
  line_to(200, y + 100)
@@ -11,11 +11,9 @@ Prawn::ManualBuilder::Example.generate(filename) do
11
11
  stroke_axis
12
12
 
13
13
  1.upto(3) do |i|
14
-
15
14
  x = i * 50
16
15
  y = i * 100
17
16
  translate(x, y) do
18
-
19
17
  # Draw a point on the new origin
20
18
  fill_circle [0, 0], 2
21
19
  draw_text "New origin after translation to [#{x}, #{y}]",
@@ -23,7 +21,9 @@ Prawn::ManualBuilder::Example.generate(filename) do
23
21
 
24
22
  stroke_rectangle [100, 75], 100, 50
25
23
  text_box "Top left corner at [100,75]",
26
- :at => [110, 65], :width => 80, :size => 8
24
+ :at => [110, 65],
25
+ :width => 80,
26
+ :size => 8
27
27
  end
28
28
  end
29
29
  end
@@ -24,7 +24,6 @@ Prawn::ManualBuilder::Example.generate(filename) do
24
24
 
25
25
  base_x = 100
26
26
  [[0.5, 1], 0.5, [1, 0.5]].each do |args|
27
-
28
27
  transparent(*args) do
29
28
  fill_circle [base_x, 100], 50
30
29
  stroke_rectangle [base_x - 20, 100], 40, 80
@@ -36,5 +36,4 @@ Prawn::ManualBuilder::Example.generate(filename) do
36
36
 
37
37
  https://github.com/prawnpdf/prawn/blob/master/lib/prawn/graphics.rb
38
38
  END_TEXT
39
-
40
39
  end
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("images.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "images" do |p|
11
-
12
10
  p.section "Basics" do |s|
13
11
  s.example "plain_image"
14
12
  s.example "absolute_position"
@@ -35,6 +33,5 @@ Prawn::ManualBuilder::Example.generate("images.pdf", :page_size => "FOLIO") do
35
33
  "How to configure the image dimensions by setting the width and height or by scaling it"
36
34
  )
37
35
  end
38
-
39
36
  end
40
37
  end
@@ -17,11 +17,11 @@ Prawn::ManualBuilder::Example.generate(filename) do
17
17
  # able to run alone we are repeating it on every example
18
18
  define_grid(:columns => 5, :rows => 8, :gutter => 10)
19
19
 
20
- grid(4,0).show
21
- grid(5,1).show
20
+ grid(4, 0).show
21
+ grid(5, 1).show
22
22
 
23
- grid([6,2], [7,3]).show
23
+ grid([6, 2], [7, 3]).show
24
24
 
25
- grid([4,4], [7,4]).show
26
- grid([7,0], [7,1]).show
25
+ grid([4, 4], [7, 4]).show
26
+ grid([7, 0], [7, 1]).show
27
27
  end
@@ -15,11 +15,11 @@ Prawn::ManualBuilder::Example.generate(filename) do
15
15
  # able to run alone we are repeating it on every example
16
16
  define_grid(:columns => 5, :rows => 8, :gutter => 10)
17
17
 
18
- grid([5,0], [7,1]).bounding_box do
18
+ grid([5, 0], [7, 1]).bounding_box do
19
19
  text "Adding some content to this multi_box.\n" + " _ " * 200
20
20
  end
21
21
 
22
- grid(6,3).bounding_box do
22
+ grid(6, 3).bounding_box do
23
23
  text "Just a little snippet here.\n" + " _ " * 10
24
24
  end
25
25
  end
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("layout.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "layout" do |p|
11
-
12
10
  p.example "simple_grid"
13
11
  p.example "boxes"
14
12
  p.example "content"
@@ -23,6 +21,5 @@ Prawn::ManualBuilder::Example.generate("layout.pdf", :page_size => "FOLIO") do
23
21
  "How to create boxes according to the grid"
24
22
  )
25
23
  end
26
-
27
24
  end
28
25
  end
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("outline.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "outline" do |p|
11
-
12
10
  p.section "Basics" do |s|
13
11
  s.example "sections_and_pages", :eval_source => false
14
12
  end
@@ -27,6 +25,5 @@ Prawn::ManualBuilder::Example.generate("outline.pdf", :page_size => "FOLIO") do
27
25
  "How to insert sections and/or pages to a previously defined outline structure"
28
26
  )
29
27
  end
30
-
31
28
  end
32
29
  end
@@ -44,7 +44,7 @@ Prawn::ManualBuilder::Example.generate(filename) do
44
44
  number_pages string, options
45
45
 
46
46
  # Gray page numbers from 8 on up
47
- options[:page_filter] = lambda{ |pg| pg > 7}
47
+ options[:page_filter] = lambda{ |pg| pg > 7 }
48
48
  options[:start_count_at] = 8
49
49
  options[:color] = "333333"
50
50
  number_pages string, options
@@ -6,9 +6,7 @@ require File.expand_path(File.join(File.dirname(__FILE__),
6
6
  %w[.. example_helper]))
7
7
 
8
8
  Prawn::ManualBuilder::Example.generate("repeatable_content.pdf", :page_size => "FOLIO") do
9
-
10
9
  package "repeatable_content" do |p|
11
-
12
10
  p.example "repeater", :eval_source => false
13
11
  p.example "stamp"
14
12
  p.example "page_numbering", :eval_source => false
@@ -27,6 +25,5 @@ Prawn::ManualBuilder::Example.generate("repeatable_content.pdf", :page_size => "
27
25
  "How to number the document pages with one simple call"
28
26
  )
29
27
  end
30
-
31
28
  end
32
29
  end
@@ -25,19 +25,19 @@ Prawn::ManualBuilder::Example.generate(filename) do
25
25
  end
26
26
 
27
27
  repeat(:odd) do
28
- draw_text "Only odd pages", :at => [0,0]
28
+ draw_text "Only odd pages", :at => [0, 0]
29
29
  end
30
30
 
31
31
  repeat(:even) do
32
- draw_text "Only even pages", :at => [0,0]
32
+ draw_text "Only even pages", :at => [0, 0]
33
33
  end
34
34
 
35
- repeat([1,3,7]) do
36
- draw_text "Only on pages 1, 3 and 7", :at => [100,0]
35
+ repeat([1, 3, 7]) do
36
+ draw_text "Only on pages 1, 3 and 7", :at => [100, 0]
37
37
  end
38
38
 
39
39
  repeat(2..4) do
40
- draw_text "From the 2nd to the 4th page", :at => [300,0]
40
+ draw_text "From the 2nd to the 4th page", :at => [300, 0]
41
41
  end
42
42
 
43
43
  repeat(lambda { |pg| pg % 3 == 0 }) do
@@ -50,6 +50,6 @@ Prawn::ManualBuilder::Example.generate(filename) do
50
50
 
51
51
  10.times do
52
52
  start_new_page
53
- draw_text "A wonderful page", :at => [400,400]
53
+ draw_text "A wonderful page", :at => [400, 400]
54
54
  end
55
55
  end