prawn-graph 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (314) hide show
  1. data/README.markdown +51 -2
  2. data/Rakefile +16 -2
  3. data/lib/prawn/graph.rb +1 -4
  4. data/lib/prawn/graph/bar.rb +39 -143
  5. data/lib/prawn/graph/base.rb +207 -0
  6. data/lib/prawn/graph/errors.rb +2 -1
  7. data/lib/prawn/graph/grid.rb +5 -0
  8. data/lib/prawn/graph/line.rb +40 -1
  9. data/lib/prawn/graph/theme.rb +24 -0
  10. metadata +19 -312
  11. data/vendor/prawn-core/COPYING +0 -340
  12. data/vendor/prawn-core/HACKING +0 -46
  13. data/vendor/prawn-core/LICENSE +0 -56
  14. data/vendor/prawn-core/README +0 -138
  15. data/vendor/prawn-core/Rakefile +0 -75
  16. data/vendor/prawn-core/bench/afm_text_bench.rb +0 -18
  17. data/vendor/prawn-core/bench/png_type_6.rb +0 -15
  18. data/vendor/prawn-core/bench/ttf_text_bench.rb +0 -19
  19. data/vendor/prawn-core/bugs/indentation_across_pagebreaks.rb +0 -15
  20. data/vendor/prawn-core/bugs/resolved/canvas_sets_y_to_0.rb +0 -15
  21. data/vendor/prawn-core/bugs/resolved/png_barcode_issue.rb +0 -11
  22. data/vendor/prawn-core/bugs/resolved/transaction_page_number_issue_79.rb +0 -21
  23. data/vendor/prawn-core/bugs/resolved/ttf_fails_in_transactions.rb +0 -24
  24. data/vendor/prawn-core/data/encodings/win_ansi.txt +0 -29
  25. data/vendor/prawn-core/data/fonts/Action Man.dfont +0 -0
  26. data/vendor/prawn-core/data/fonts/Activa.ttf +0 -0
  27. data/vendor/prawn-core/data/fonts/Chalkboard.ttf +0 -0
  28. data/vendor/prawn-core/data/fonts/Courier-Bold.afm +0 -342
  29. data/vendor/prawn-core/data/fonts/Courier-BoldOblique.afm +0 -342
  30. data/vendor/prawn-core/data/fonts/Courier-Oblique.afm +0 -342
  31. data/vendor/prawn-core/data/fonts/Courier.afm +0 -342
  32. data/vendor/prawn-core/data/fonts/DejaVuSans.ttf +0 -0
  33. data/vendor/prawn-core/data/fonts/Dustismo_Roman.ttf +0 -0
  34. data/vendor/prawn-core/data/fonts/Helvetica-Bold.afm +0 -2827
  35. data/vendor/prawn-core/data/fonts/Helvetica-BoldOblique.afm +0 -2827
  36. data/vendor/prawn-core/data/fonts/Helvetica-Oblique.afm +0 -3051
  37. data/vendor/prawn-core/data/fonts/Helvetica.afm +0 -3051
  38. data/vendor/prawn-core/data/fonts/MustRead.html +0 -19
  39. data/vendor/prawn-core/data/fonts/Symbol.afm +0 -213
  40. data/vendor/prawn-core/data/fonts/Times-Bold.afm +0 -2588
  41. data/vendor/prawn-core/data/fonts/Times-BoldItalic.afm +0 -2384
  42. data/vendor/prawn-core/data/fonts/Times-Italic.afm +0 -2667
  43. data/vendor/prawn-core/data/fonts/Times-Roman.afm +0 -2419
  44. data/vendor/prawn-core/data/fonts/ZapfDingbats.afm +0 -225
  45. data/vendor/prawn-core/data/fonts/comicsans.ttf +0 -0
  46. data/vendor/prawn-core/data/fonts/gkai00mp.ttf +0 -0
  47. data/vendor/prawn-core/data/images/16bit.alpha +0 -0
  48. data/vendor/prawn-core/data/images/16bit.dat +0 -0
  49. data/vendor/prawn-core/data/images/16bit.png +0 -0
  50. data/vendor/prawn-core/data/images/arrow.png +0 -0
  51. data/vendor/prawn-core/data/images/arrow2.png +0 -0
  52. data/vendor/prawn-core/data/images/barcode_issue.png +0 -0
  53. data/vendor/prawn-core/data/images/dice.alpha +0 -0
  54. data/vendor/prawn-core/data/images/dice.dat +0 -0
  55. data/vendor/prawn-core/data/images/dice.png +0 -0
  56. data/vendor/prawn-core/data/images/dice_interlaced.png +0 -0
  57. data/vendor/prawn-core/data/images/fractal.jpg +0 -0
  58. data/vendor/prawn-core/data/images/letterhead.jpg +0 -0
  59. data/vendor/prawn-core/data/images/page_white_text.alpha +0 -0
  60. data/vendor/prawn-core/data/images/page_white_text.dat +0 -0
  61. data/vendor/prawn-core/data/images/page_white_text.png +0 -0
  62. data/vendor/prawn-core/data/images/pigs.jpg +0 -0
  63. data/vendor/prawn-core/data/images/rails.dat +0 -0
  64. data/vendor/prawn-core/data/images/rails.png +0 -0
  65. data/vendor/prawn-core/data/images/ruport.png +0 -0
  66. data/vendor/prawn-core/data/images/ruport_data.dat +0 -0
  67. data/vendor/prawn-core/data/images/ruport_transparent.png +0 -0
  68. data/vendor/prawn-core/data/images/ruport_type0.png +0 -0
  69. data/vendor/prawn-core/data/images/stef.jpg +0 -0
  70. data/vendor/prawn-core/data/images/tru256.bmp +0 -0
  71. data/vendor/prawn-core/data/images/web-links.dat +0 -1
  72. data/vendor/prawn-core/data/images/web-links.png +0 -0
  73. data/vendor/prawn-core/data/shift_jis_text.txt +0 -1
  74. data/vendor/prawn-core/examples/bounding_box/bounding_boxes.rb +0 -43
  75. data/vendor/prawn-core/examples/bounding_box/indentation.rb +0 -34
  76. data/vendor/prawn-core/examples/bounding_box/russian_boxes.rb +0 -36
  77. data/vendor/prawn-core/examples/bounding_box/stretched_nesting.rb +0 -67
  78. data/vendor/prawn-core/examples/column_box/column_box_example.rb +0 -43
  79. data/vendor/prawn-core/examples/example_helper.rb +0 -3
  80. data/vendor/prawn-core/examples/general/background.rb +0 -23
  81. data/vendor/prawn-core/examples/general/canvas.rb +0 -15
  82. data/vendor/prawn-core/examples/general/context_sensitive_headers.rb +0 -37
  83. data/vendor/prawn-core/examples/general/float.rb +0 -11
  84. data/vendor/prawn-core/examples/general/margin.rb +0 -36
  85. data/vendor/prawn-core/examples/general/measurement_units.rb +0 -51
  86. data/vendor/prawn-core/examples/general/metadata-info.rb +0 -16
  87. data/vendor/prawn-core/examples/general/multi_page_layout.rb +0 -18
  88. data/vendor/prawn-core/examples/general/outlines.rb +0 -50
  89. data/vendor/prawn-core/examples/general/page_geometry.rb +0 -31
  90. data/vendor/prawn-core/examples/general/page_numbering.rb +0 -15
  91. data/vendor/prawn-core/examples/general/repeaters.rb +0 -47
  92. data/vendor/prawn-core/examples/general/stamp.rb +0 -41
  93. data/vendor/prawn-core/examples/graphics/basic_images.rb +0 -23
  94. data/vendor/prawn-core/examples/graphics/cmyk.rb +0 -12
  95. data/vendor/prawn-core/examples/graphics/curves.rb +0 -11
  96. data/vendor/prawn-core/examples/graphics/hexagon.rb +0 -13
  97. data/vendor/prawn-core/examples/graphics/image_fit.rb +0 -15
  98. data/vendor/prawn-core/examples/graphics/image_flow.rb +0 -37
  99. data/vendor/prawn-core/examples/graphics/image_position.rb +0 -17
  100. data/vendor/prawn-core/examples/graphics/line.rb +0 -32
  101. data/vendor/prawn-core/examples/graphics/png_types.rb +0 -22
  102. data/vendor/prawn-core/examples/graphics/polygons.rb +0 -16
  103. data/vendor/prawn-core/examples/graphics/remote_images.rb +0 -12
  104. data/vendor/prawn-core/examples/graphics/rounded_polygons.rb +0 -19
  105. data/vendor/prawn-core/examples/graphics/rounded_rectangle.rb +0 -20
  106. data/vendor/prawn-core/examples/graphics/ruport_style_helpers.rb +0 -19
  107. data/vendor/prawn-core/examples/graphics/stroke_bounds.rb +0 -20
  108. data/vendor/prawn-core/examples/graphics/stroke_cap_and_join.rb +0 -45
  109. data/vendor/prawn-core/examples/graphics/stroke_dash.rb +0 -42
  110. data/vendor/prawn-core/examples/graphics/transformations.rb +0 -52
  111. data/vendor/prawn-core/examples/graphics/transparency.rb +0 -26
  112. data/vendor/prawn-core/examples/m17n/chinese_text_wrapping.rb +0 -17
  113. data/vendor/prawn-core/examples/m17n/euro.rb +0 -15
  114. data/vendor/prawn-core/examples/m17n/sjis.rb +0 -28
  115. data/vendor/prawn-core/examples/m17n/utf8.rb +0 -13
  116. data/vendor/prawn-core/examples/m17n/win_ansi_charset.rb +0 -54
  117. data/vendor/prawn-core/examples/text/alignment.rb +0 -18
  118. data/vendor/prawn-core/examples/text/dfont.rb +0 -48
  119. data/vendor/prawn-core/examples/text/family_based_styling.rb +0 -24
  120. data/vendor/prawn-core/examples/text/font_calculations.rb +0 -91
  121. data/vendor/prawn-core/examples/text/font_size.rb +0 -33
  122. data/vendor/prawn-core/examples/text/indent_paragraphs.rb +0 -18
  123. data/vendor/prawn-core/examples/text/kerning.rb +0 -30
  124. data/vendor/prawn-core/examples/text/rotated.rb +0 -98
  125. data/vendor/prawn-core/examples/text/simple_text.rb +0 -17
  126. data/vendor/prawn-core/examples/text/simple_text_ttf.rb +0 -17
  127. data/vendor/prawn-core/examples/text/span.rb +0 -29
  128. data/vendor/prawn-core/examples/text/text_box.rb +0 -88
  129. data/vendor/prawn-core/examples/text/text_box_returning_excess.rb +0 -51
  130. data/vendor/prawn-core/examples/text/text_flow.rb +0 -67
  131. data/vendor/prawn-core/lib/prawn/byte_string.rb +0 -7
  132. data/vendor/prawn-core/lib/prawn/compatibility.rb +0 -51
  133. data/vendor/prawn-core/lib/prawn/core.rb +0 -87
  134. data/vendor/prawn-core/lib/prawn/core/page.rb +0 -88
  135. data/vendor/prawn-core/lib/prawn/core/text.rb +0 -65
  136. data/vendor/prawn-core/lib/prawn/document.rb +0 -596
  137. data/vendor/prawn-core/lib/prawn/document/annotations.rb +0 -65
  138. data/vendor/prawn-core/lib/prawn/document/bounding_box.rb +0 -402
  139. data/vendor/prawn-core/lib/prawn/document/column_box.rb +0 -113
  140. data/vendor/prawn-core/lib/prawn/document/destinations.rb +0 -92
  141. data/vendor/prawn-core/lib/prawn/document/graphics_state.rb +0 -49
  142. data/vendor/prawn-core/lib/prawn/document/internals.rb +0 -153
  143. data/vendor/prawn-core/lib/prawn/document/page_geometry.rb +0 -136
  144. data/vendor/prawn-core/lib/prawn/document/snapshot.rb +0 -80
  145. data/vendor/prawn-core/lib/prawn/document/span.rb +0 -55
  146. data/vendor/prawn-core/lib/prawn/encoding.rb +0 -121
  147. data/vendor/prawn-core/lib/prawn/errors.rb +0 -83
  148. data/vendor/prawn-core/lib/prawn/font.rb +0 -329
  149. data/vendor/prawn-core/lib/prawn/font/afm.rb +0 -217
  150. data/vendor/prawn-core/lib/prawn/font/dfont.rb +0 -34
  151. data/vendor/prawn-core/lib/prawn/font/ttf.rb +0 -341
  152. data/vendor/prawn-core/lib/prawn/graphics.rb +0 -321
  153. data/vendor/prawn-core/lib/prawn/graphics/cap_style.rb +0 -38
  154. data/vendor/prawn-core/lib/prawn/graphics/color.rb +0 -205
  155. data/vendor/prawn-core/lib/prawn/graphics/dash.rb +0 -71
  156. data/vendor/prawn-core/lib/prawn/graphics/join_style.rb +0 -38
  157. data/vendor/prawn-core/lib/prawn/graphics/transformation.rb +0 -157
  158. data/vendor/prawn-core/lib/prawn/graphics/transparency.rb +0 -99
  159. data/vendor/prawn-core/lib/prawn/images.rb +0 -337
  160. data/vendor/prawn-core/lib/prawn/images/jpg.rb +0 -46
  161. data/vendor/prawn-core/lib/prawn/images/png.rb +0 -219
  162. data/vendor/prawn-core/lib/prawn/literal_string.rb +0 -14
  163. data/vendor/prawn-core/lib/prawn/measurement_extensions.rb +0 -46
  164. data/vendor/prawn-core/lib/prawn/measurements.rb +0 -71
  165. data/vendor/prawn-core/lib/prawn/name_tree.rb +0 -166
  166. data/vendor/prawn-core/lib/prawn/object_store.rb +0 -93
  167. data/vendor/prawn-core/lib/prawn/outline.rb +0 -278
  168. data/vendor/prawn-core/lib/prawn/pdf_object.rb +0 -83
  169. data/vendor/prawn-core/lib/prawn/reference.rb +0 -92
  170. data/vendor/prawn-core/lib/prawn/repeater.rb +0 -129
  171. data/vendor/prawn-core/lib/prawn/stamp.rb +0 -128
  172. data/vendor/prawn-core/lib/prawn/text.rb +0 -271
  173. data/vendor/prawn-core/lib/prawn/text/box.rb +0 -414
  174. data/vendor/prawn-core/meta/Rakefile +0 -36
  175. data/vendor/prawn-core/meta/lib/prawn.rb +0 -2
  176. data/vendor/prawn-core/reference_pdfs/alignment.pdf +0 -229
  177. data/vendor/prawn-core/reference_pdfs/background.pdf +0 -0
  178. data/vendor/prawn-core/reference_pdfs/basic_images.pdf +0 -0
  179. data/vendor/prawn-core/reference_pdfs/bounding_boxes.pdf +0 -128
  180. data/vendor/prawn-core/reference_pdfs/canvas.pdf +0 -78
  181. data/vendor/prawn-core/reference_pdfs/chinese_flow.pdf +0 -0
  182. data/vendor/prawn-core/reference_pdfs/cmyk.pdf +0 -0
  183. data/vendor/prawn-core/reference_pdfs/column_box.pdf +0 -3671
  184. data/vendor/prawn-core/reference_pdfs/context_sensitive_headers.pdf +0 -2331
  185. data/vendor/prawn-core/reference_pdfs/curves.pdf +0 -62
  186. data/vendor/prawn-core/reference_pdfs/dfont.pdf +0 -0
  187. data/vendor/prawn-core/reference_pdfs/euro.pdf +0 -75
  188. data/vendor/prawn-core/reference_pdfs/family_style.pdf +0 -286
  189. data/vendor/prawn-core/reference_pdfs/flow.pdf +0 -964
  190. data/vendor/prawn-core/reference_pdfs/font_calculations.pdf +0 -0
  191. data/vendor/prawn-core/reference_pdfs/font_size.pdf +0 -142
  192. data/vendor/prawn-core/reference_pdfs/hexagon.pdf +0 -61
  193. data/vendor/prawn-core/reference_pdfs/image-flow.pdf +0 -0
  194. data/vendor/prawn-core/reference_pdfs/image_fit.pdf +0 -0
  195. data/vendor/prawn-core/reference_pdfs/image_position.pdf +0 -0
  196. data/vendor/prawn-core/reference_pdfs/indentation.pdf +0 -124
  197. data/vendor/prawn-core/reference_pdfs/kerning.pdf +0 -0
  198. data/vendor/prawn-core/reference_pdfs/landscape_a4.pdf +0 -52
  199. data/vendor/prawn-core/reference_pdfs/landscape_legal.pdf +0 -52
  200. data/vendor/prawn-core/reference_pdfs/landscape_letter.pdf +0 -52
  201. data/vendor/prawn-core/reference_pdfs/lines.pdf +0 -116
  202. data/vendor/prawn-core/reference_pdfs/margin.pdf +0 -3850
  203. data/vendor/prawn-core/reference_pdfs/measurement_units.pdf +0 -4667
  204. data/vendor/prawn-core/reference_pdfs/metadata-info.pdf +0 -88
  205. data/vendor/prawn-core/reference_pdfs/multi-layout.pdf +0 -209
  206. data/vendor/prawn-core/reference_pdfs/page_with_numbering.pdf +0 -156
  207. data/vendor/prawn-core/reference_pdfs/png_types.pdf +0 -0
  208. data/vendor/prawn-core/reference_pdfs/portrait_a4.pdf +0 -52
  209. data/vendor/prawn-core/reference_pdfs/portrait_legal.pdf +0 -52
  210. data/vendor/prawn-core/reference_pdfs/portrait_letter.pdf +0 -52
  211. data/vendor/prawn-core/reference_pdfs/pretty_polygons.pdf +0 -122
  212. data/vendor/prawn-core/reference_pdfs/remote_images.pdf +0 -0
  213. data/vendor/prawn-core/reference_pdfs/ruport.pdf +0 -101
  214. data/vendor/prawn-core/reference_pdfs/russian_boxes.pdf +0 -2780
  215. data/vendor/prawn-core/reference_pdfs/simple_text.pdf +0 -136
  216. data/vendor/prawn-core/reference_pdfs/simple_text_ttf.pdf +0 -0
  217. data/vendor/prawn-core/reference_pdfs/sjis.pdf +0 -0
  218. data/vendor/prawn-core/reference_pdfs/span.pdf +0 -1975
  219. data/vendor/prawn-core/reference_pdfs/stamp.pdf +0 -649
  220. data/vendor/prawn-core/reference_pdfs/stretched_nesting.pdf +0 -200
  221. data/vendor/prawn-core/reference_pdfs/stroke_bounds.pdf +0 -135
  222. data/vendor/prawn-core/reference_pdfs/stroke_cap_and_join.pdf +0 -80
  223. data/vendor/prawn-core/reference_pdfs/stroke_dash.pdf +0 -457
  224. data/vendor/prawn-core/reference_pdfs/text_box.pdf +0 -962
  225. data/vendor/prawn-core/reference_pdfs/text_box_returning_excess.pdf +0 -271
  226. data/vendor/prawn-core/reference_pdfs/transparency.pdf +0 -347
  227. data/vendor/prawn-core/reference_pdfs/utf8.pdf +0 -0
  228. data/vendor/prawn-core/reference_pdfs/win-ansi.pdf +0 -6172
  229. data/vendor/prawn-core/spec/annotations_spec.rb +0 -90
  230. data/vendor/prawn-core/spec/bounding_box_spec.rb +0 -185
  231. data/vendor/prawn-core/spec/destinations_spec.rb +0 -15
  232. data/vendor/prawn-core/spec/document_spec.rb +0 -408
  233. data/vendor/prawn-core/spec/font_spec.rb +0 -314
  234. data/vendor/prawn-core/spec/graphics_spec.rb +0 -438
  235. data/vendor/prawn-core/spec/images_spec.rb +0 -79
  236. data/vendor/prawn-core/spec/jpg_spec.rb +0 -25
  237. data/vendor/prawn-core/spec/measurement_units_spec.rb +0 -23
  238. data/vendor/prawn-core/spec/name_tree_spec.rb +0 -112
  239. data/vendor/prawn-core/spec/object_store_spec.rb +0 -75
  240. data/vendor/prawn-core/spec/outline_spec.rb +0 -229
  241. data/vendor/prawn-core/spec/pdf_object_spec.rb +0 -122
  242. data/vendor/prawn-core/spec/png_spec.rb +0 -236
  243. data/vendor/prawn-core/spec/reference_spec.rb +0 -82
  244. data/vendor/prawn-core/spec/repeater_spec.rb +0 -96
  245. data/vendor/prawn-core/spec/snapshot_spec.rb +0 -138
  246. data/vendor/prawn-core/spec/span_spec.rb +0 -49
  247. data/vendor/prawn-core/spec/spec_helper.rb +0 -24
  248. data/vendor/prawn-core/spec/stamp_spec.rb +0 -108
  249. data/vendor/prawn-core/spec/stroke_styles_spec.rb +0 -152
  250. data/vendor/prawn-core/spec/text_at_spec.rb +0 -119
  251. data/vendor/prawn-core/spec/text_box_spec.rb +0 -603
  252. data/vendor/prawn-core/spec/text_spec.rb +0 -308
  253. data/vendor/prawn-core/spec/transparency_spec.rb +0 -75
  254. data/vendor/prawn-core/vendor/pdf-inspector/README +0 -18
  255. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector.rb +0 -26
  256. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/extgstate.rb +0 -18
  257. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/graphics.rb +0 -131
  258. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/page.rb +0 -25
  259. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/text.rb +0 -31
  260. data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/xobject.rb +0 -19
  261. data/vendor/prawn-core/vendor/ttfunk/data/fonts/DejaVuSans.ttf +0 -0
  262. data/vendor/prawn-core/vendor/ttfunk/data/fonts/comicsans.ttf +0 -0
  263. data/vendor/prawn-core/vendor/ttfunk/example.rb +0 -45
  264. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk.rb +0 -102
  265. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/directory.rb +0 -17
  266. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/encoding/mac_roman.rb +0 -88
  267. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/encoding/windows_1252.rb +0 -69
  268. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/reader.rb +0 -44
  269. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/resource_file.rb +0 -78
  270. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset.rb +0 -18
  271. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/base.rb +0 -141
  272. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/mac_roman.rb +0 -46
  273. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/unicode.rb +0 -48
  274. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/unicode_8bit.rb +0 -63
  275. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/windows_1252.rb +0 -51
  276. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset_collection.rb +0 -72
  277. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table.rb +0 -46
  278. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb +0 -34
  279. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/format00.rb +0 -54
  280. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/format04.rb +0 -126
  281. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/subtable.rb +0 -79
  282. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf.rb +0 -64
  283. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf/compound.rb +0 -81
  284. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf/simple.rb +0 -37
  285. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/head.rb +0 -44
  286. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/hhea.rb +0 -41
  287. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/hmtx.rb +0 -47
  288. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/kern.rb +0 -79
  289. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/kern/format0.rb +0 -62
  290. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/loca.rb +0 -43
  291. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/maxp.rb +0 -40
  292. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/name.rb +0 -119
  293. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/os2.rb +0 -78
  294. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post.rb +0 -91
  295. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format10.rb +0 -43
  296. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format20.rb +0 -35
  297. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format25.rb +0 -23
  298. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format30.rb +0 -17
  299. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format40.rb +0 -17
  300. data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/simple.rb +0 -14
  301. data/vendor/prawn-core/www/index.html +0 -196
  302. data/vendor/prawn-core/www/media/bounding_boxes.pdf +0 -146
  303. data/vendor/prawn-core/www/media/bounding_boxes.png +0 -0
  304. data/vendor/prawn-core/www/media/bounding_boxes_out.png +0 -0
  305. data/vendor/prawn-core/www/media/fancy_table.pdf +0 -350
  306. data/vendor/prawn-core/www/media/image.pdf +0 -0
  307. data/vendor/prawn-core/www/media/images.png +0 -0
  308. data/vendor/prawn-core/www/media/prawn_logo.png +0 -0
  309. data/vendor/prawn-core/www/media/tables.png +0 -0
  310. data/vendor/prawn-core/www/media/utf8.pdf +0 -0
  311. data/vendor/prawn-core/www/media/utf8.png +0 -0
  312. data/vendor/prawn-core/www/prawn-Chinese.html +0 -113
  313. data/vendor/prawn-core/www/prawn.css +0 -86
  314. data/vendor/prawn-core/www/twilight.css +0 -266
@@ -1,43 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Text should flow between columns before wrapping to the next page, like a printed newspaper.
4
- #
5
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
6
-
7
- paragraphs = []
8
- paragraphs << <<-ONE
9
- Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Vivamus vitae risus vitae lorem iaculis placerat. Aliquam sit amet felis. Etiam congue. Donec risus risus, pretium ac, tincidunt eu, tempor eu, quam. Morbi blandit mollis magna. Suspendisse eu tortor. Donec vitae felis nec ligula blandit rhoncus. Ut a pede ac neque mattis facilisis. Nulla nunc ipsum, sodales vitae, hendrerit non, imperdiet ac, ante. Morbi sit amet mi. Ut magna. Curabitur id est. Nulla velit. Sed consectetuer sodales justo. Aliquam dictum gravida libero. Sed eu turpis. Nunc id lorem. Aenean consequat tempor mi. Phasellus in neque. Nunc fermentum convallis ligula.
10
- ONE
11
- paragraphs << <<-TWO
12
- Suspendisse in nulla. Nunc eu ipsum tincidunt risus pellentesque fringilla. Integer iaculis pharetra eros. Nam ut sapien quis arcu ullamcorper cursus. Vestibulum tempor nisi rhoncus eros. Sed iaculis ultricies tellus. Cras pellentesque erat eu urna. Cras malesuada. Quisque congue ultricies neque. Nullam a nisl. Sed convallis turpis a ante. Morbi eu justo sed tortor euismod porttitor. Aenean ut lacus. Maecenas nibh eros, dapibus at, pellentesque in, auctor a, enim. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Aliquam congue pede a ipsum. Sed libero quam, sodales eget, venenatis non, cursus vel, velit. In vulputate.
13
- TWO
14
- paragraphs << <<-THREE
15
- In vehicula. Aenean quam mauris, vehicula non, suscipit at, venenatis sed, arcu. Etiam ornare fermentum felis. Donec ligula metus, placerat quis, blandit at, congue molestie, ante. Donec viverra nibh et dolor. Sed elementum, nunc ac gravida pulvinar, libero ligula vestibulum urna, eget luctus eros ipsum ut velit. Vestibulum at diam. Suspendisse hendrerit. Sed facilisis libero pretium nisl. Morbi eget urna ut mi egestas aliquet. Donec interdum, urna eget semper ultrices, nibh sapien laoreet massa, at laoreet nulla metus sit amet nunc. In augue. Etiam sit amet sapien. Aliquam nulla mi, tincidunt a, ullamcorper pharetra, mollis eu, purus.
16
- Suspendisse auctor nunc a dolor. Donec elit diam, fringilla nec, cursus a, dapibus ut, justo. Maecenas rhoncus lacinia mi. Sed tempus leo in risus. Quisque vitae est. Integer eu mi vel justo lacinia posuere. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Donec pretium auctor mauris. Cras at risus. Vestibulum ligula purus, venenatis varius, tincidunt aliquam, volutpat ut, felis. In nulla. Suspendisse magna. Fusce ac tortor. Morbi semper hendrerit purus. Donec scelerisque erat quis magna. Vivamus interdum metus at tellus.
17
- Nam molestie suscipit arcu. Sed sed leo non sapien lobortis gravida. Mauris ultricies imperdiet lacus. Maecenas semper sapien in mauris. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc euismod odio eget lectus. Vestibulum nonummy pharetra eros. Donec semper venenatis sapien. Phasellus scelerisque lectus quis tortor. Quisque turpis. Etiam rutrum metus eget nisi. Morbi varius ligula id elit. Ut augue.
18
- Nulla arcu est, rhoncus non, eleifend ut, imperdiet vel, magna. Sed pretium pulvinar augue. Sed sit amet nulla eget lacus viverra sollicitudin. Nulla facilisi. Proin sed ipsum vel lacus faucibus dignissim. Nulla purus. Nullam sapien elit, elementum eget, consequat vitae, vehicula cursus, pede. Sed quis leo. Praesent tincidunt convallis ligula. Sed purus eros, malesuada eget, posuere a, convallis suscipit, tellus. Proin tincidunt. Suspendisse leo. Suspendisse risus nisi, hendrerit in, ullamcorper id, porta in, pede. Maecenas lectus mi, congue vitae, ullamcorper vitae, bibendum sit amet, dui. Ut volutpat, nibh scelerisque malesuada bibendum, ipsum felis elementum lacus, nec pretium libero neque ut elit. Duis enim. Fusce arcu nulla, sodales eget, rhoncus sed, fermentum a, erat. Donec vitae mi.
19
- Duis sed nunc a justo egestas tincidunt. Morbi elit. Morbi venenatis fermentum erat. Cras purus orci, imperdiet a, sodales vel, aliquet at, quam. Etiam erat diam, ornare a, nonummy ut, accumsan non, felis. Fusce dignissim. Ut in ligula vitae risus varius viverra. Aenean elit diam, dapibus et, imperdiet in, suscipit at, felis. Curabitur vitae nunc ac mauris tincidunt posuere. Morbi id tortor. Nam sagittis. Sed dolor. Nulla imperdiet magna et lectus. Vivamus sapien diam, condimentum at, ultricies nec, vestibulum sit amet, pede. Nunc non orci vel magna lacinia sodales. In ac nunc vel mauris pharetra pharetra.
20
- Integer quis orci. Nam ultrices, magna nec ullamcorper tincidunt, enim massa semper arcu, sit amet malesuada velit nibh a enim. Phasellus molestie neque eget lorem semper convallis. Duis eget leo. Maecenas commodo vehicula nisi. In viverra massa sed justo. Vestibulum quis velit. Nunc id nulla. Ut eget sem. Nullam congue placerat ante. Mauris ut leo. Cras semper dolor at odio. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas.
21
- Vivamus quis velit. Aliquam erat volutpat. Praesent malesuada tincidunt purus. Vestibulum quis pede. Praesent luctus, nunc in eleifend fermentum, risus lacus tristique mi, ac mollis metus mi at lectus. Proin tortor. Phasellus erat. Duis cursus nunc non metus. Vivamus hendrerit neque eu felis. Sed interdum metus a enim. Aliquam aliquet vehicula erat. Vivamus tortor neque, ornare ac, cursus id, nonummy ultricies, turpis. Proin tempor nonummy tellus. Praesent metus neque, accumsan eu, tempor sed, porta facilisis, pede. Cras nec nisl in turpis porta congue.
22
- Maecenas sollicitudin feugiat urna. Maecenas tellus. Vestibulum semper, lacus in blandit blandit, neque lectus ullamcorper nulla, at viverra elit justo ac lacus. Proin gravida enim non neque ultricies dictum. In vulputate mattis lacus. In mollis nibh a lacus. Aenean a ipsum. Vivamus egestas adipiscing eros. Cras gravida suscipit risus. Maecenas varius sagittis velit. Phasellus rhoncus risus. Nunc quis urna at neque convallis hendrerit. Mauris metus. Integer eleifend eros nec nunc venenatis ultrices. Curabitur placerat. Nam eros dui, semper vitae, tincidunt quis, tincidunt eu, risus. Ut in pede a neque condimentum feugiat. Maecenas dictum tortor non neque.
23
- THREE
24
-
25
-
26
-
27
- Prawn::Document.generate "column_box.pdf" do
28
- font "Helvetica", :size => 12
29
- column_box([0,750], :columns => 2, :spacer => 3, :width => bounds.width, :height => 100) do
30
- text paragraphs.shift
31
- end
32
-
33
- font "Courier", :size => 10
34
- column_box([0,600], :width => bounds.width, :height => 100) do
35
- text paragraphs.shift
36
- end
37
-
38
- font "Times-Roman", :size => 16
39
- column_box([0,450], :columns => 4, :spacer => font_size * 3, :width => bounds.width) do
40
- text paragraphs.shift
41
- end
42
- end
43
-
@@ -1,3 +0,0 @@
1
- $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), '..', 'lib'))
2
- require 'prawn/core'
3
- Prawn.debug = true
@@ -1,23 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This example demonstrates the use of the new :background option when
4
- # generating a new Document. Image is assumed to be pre-fit for your page
5
- # size, and will not be rescaled.
6
- #
7
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
8
-
9
- img = "#{Prawn::BASEDIR}/data/images/letterhead.jpg"
10
-
11
- Prawn::Document.generate("background.pdf", :background => img, :margin => 100) do
12
- text "My report caption", :size => 18, :align => :right
13
-
14
- move_down font.height * 2
15
-
16
- text "Here is my text explaning this report. " * 20,
17
- :size => 12, :align => :left, :leading => 2
18
-
19
- move_down font.height
20
-
21
- text "I'm using a soft background. " * 40,
22
- :size => 12, :align => :left, :leading => 2
23
- end
@@ -1,15 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Demonstrates how to enable absolute positioning in Prawn by temporarily
4
- # removing the margin_box via Document#canvas()
5
- #
6
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
7
-
8
- Prawn::Document.generate("canvas.pdf") do
9
- canvas do
10
- text "This text should appear at the absolute top left"
11
-
12
- # stroke a line to show that the relative coordinates are the same as absolute
13
- stroke_line [bounds.left,bounds.bottom], [bounds.right,bounds.top]
14
- end
15
- end
@@ -1,37 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
2
-
3
- # Ex. Generate a roster of meeting attendees given a set of meetings.
4
- # Attendees for a meeting may overflow to accross page boundaries but
5
- # each meeting starts on a separate page. Each page for any given
6
- # meeting will have the heading for that meeting.
7
-
8
- #dummying up some meetings
9
- meetings = []
10
- 5.times do |i|
11
- meetings << "Meeting number #{i}"
12
- end
13
-
14
- Prawn::Document.generate('context_sensitive_headers.pdf', :margin => [100, 100], :skip_page_creation => true) do
15
- meetings.each_with_index do |meeting,i|
16
-
17
- create_stamp(meeting.to_s) do
18
- canvas do
19
- text_box("header for #{meeting}",
20
- :at => [bounds.left + 50, bounds.top - 20],
21
- :height => 50,
22
- :width => margin_box.width)
23
- end
24
- end
25
- on_page_create { stamp(meeting.to_s) }
26
-
27
- start_new_page
28
-
29
- #simulate some meetings with content over multiple pages
30
- (15 + 20*i).times do |i|
31
- text "#{meeting} attendee #{i}"
32
- end
33
-
34
- end
35
-
36
- end
37
-
@@ -1,11 +0,0 @@
1
- require "#{File.dirname(__FILE__)}/../example_helper"
2
-
3
- Prawn::Document.generate('float.pdf') do
4
- float do
5
- bounding_box [bounds.width / 2.0, bounds.top], :width => 100 do
6
- text "Hello world. " * 50
7
- end
8
- end
9
-
10
- text "Hello world again"
11
- end
@@ -1,36 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This demonstrates the Prawn options for document and page margin, similar to CSS shorthand.
4
- #
5
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
6
-
7
- LOREM = ("Lorem ipsum dolor sit amet, consectetur adipisicing elit, "+
8
- "sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. "+
9
- "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris "+
10
- "nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in "+
11
- "reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla "+
12
- "pariatur. Excepteur sint occaecat cupidatat non proident, sunt in " +
13
- "culpa qui officia deserunt mollit anim id est laborum. ") * 20
14
-
15
- Prawn::Document.generate("margin.pdf", :margin => 100) do |pdf|
16
-
17
- pdf.text "100 on all sides", :style => :bold
18
- pdf.text LOREM
19
-
20
- pdf.start_new_page(:margin => 100, :left_margin => 0)
21
- pdf.text "100 on all sides but 0 on the left", :style => :bold
22
- pdf.text LOREM
23
-
24
- pdf.start_new_page(:margin => [100, 0])
25
- pdf.text "100 top and bottom, 0 left and right.", :style => :bold
26
- pdf.text LOREM
27
-
28
- pdf.start_new_page(:margin => [100, 0, 50])
29
- pdf.text "100 top, 0 left and right, 50 bottom.", :style => :bold
30
- pdf.text LOREM
31
-
32
- pdf.start_new_page(:margin => [0, 50, 100, 150])
33
- pdf.text "0 top, 50 right, 100 bottom, 150 left.", :style => :bold
34
- pdf.text LOREM
35
-
36
- end
@@ -1,51 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Generates a ruler and also demonstrates prawn/measurement_extensions.
4
- # It's better to run this example and examine its output than to worry about
5
- # its particular implementation, though some might find that interesting as
6
- # well.
7
- #
8
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
9
-
10
- require "prawn/measurement_extensions"
11
-
12
- # this makes the following units available (Millimeters, Centimeters, Decimeters, Meters, Inches, Foot, Yards, Points)
13
- # Methodname is the common abbravation for the unit (mm, cm, dm, m, in, ft, yd, pt)
14
- # Usage: '10.mm'.
15
- # This converts 10mm to PDF points, which Prawn uses internally.
16
-
17
- pdf = Prawn::Document.new(
18
- :page_size => "A4",
19
- :left_margin => 10.mm, # different
20
- :right_margin => 1.cm, # units
21
- :top_margin => 0.1.dm, # work
22
- :bottom_margin => 0.01.m) # well
23
-
24
- pdf.font_size = 6
25
- pdf.line_width = 0.05
26
-
27
- units_long = %w[Millimeters Centimeters Decimeters Inches Foot Points]
28
- units = %w[mm cm dm in ft pt]
29
- offset_multiplier = 2.cm
30
- temp = "Units\n"
31
-
32
- units.each_with_index do |unit, unit_index| #iterate through all units that make sense to display on a sheet of paper
33
- one_unit_in_pt = eval "1.#{unit}" # calc the width of one unit
34
- temp << "1#{unit} => #{one_unit_in_pt}pt\n" #puts converted unit in points
35
-
36
- offset = offset_multiplier * unit_index
37
- pdf.draw_text units[unit_index], :at => [offset + 0.5.mm, pdf.bounds.top - 2.mm]
38
-
39
- pdf.stroke_line(offset, pdf.bounds.top, offset, pdf.bounds.bottom)
40
-
41
- 0.upto(((pdf.bounds.height - 5.mm) / one_unit_in_pt).to_i) do |i| # checks, how many strokes can be drawn
42
- pdf.stroke_line(offset, i * one_unit_in_pt, (i % 5 == 0 ? 6.mm : 3.mm) + offset, i * one_unit_in_pt) # every fifth stroke is twice as large like on a real ruler
43
- pdf.draw_text "#{i}#{unit}", :at => [7.mm + offset, i * one_unit_in_pt] unless unit == "mm" && i % 5 != 0 || unit == "pt" && i % 10 != 0 # avoid text too close to each other
44
- end
45
- end
46
-
47
- pdf.text_box temp,
48
- :width => 5.cm, :height => pdf.font.height * units_long.length,
49
- :at => [offset_multiplier * units_long.length, pdf.bounds.top]
50
-
51
- pdf.render_file "measurement_units.pdf"
@@ -1,16 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Demonstrates how to set metadata properties via the info option
4
- # It allows one to specify no standard properties
5
- #
6
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
7
-
8
- Prawn::Document.generate "metadata-info.pdf",
9
- :info => {
10
- :Title => "My title", :Author => "John Doe", :Subject => "My Subject",
11
- :Keywords => "test metadata ruby pdf dry", :Creator => "ACME Soft App",
12
- :Producer => "Prawn", :CreationDate => Time.now, :Grok => "Test Property"
13
- } do
14
- text "This is a test of setting metadata properties via the info option"
15
- text "It allows one to specify no standard properties like 'Grok'"
16
- end
@@ -1,18 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This demonstrates that Prawn can modify page size, margins and layout for
4
- # each individual page, via Document#start_new_page()
5
- #
6
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
7
-
8
- Prawn::Document.generate("multi-layout.pdf", :page_layout => :landscape) do |pdf|
9
- pdf.text "This is on a landscaped page"
10
- pdf.start_new_page(:layout => :portrait)
11
- pdf.text "This is on a portrait page"
12
- pdf.start_new_page(:size => "LEGAL")
13
- pdf.text "This is on legal paper size"
14
- pdf.start_new_page(:left_margin => 150, :right_margin => 150)
15
- pdf.text "This page has very wide left and right margins, causing a squeeze"
16
- pdf.start_new_page(:margin => 300, :right_margin => 0)
17
- pdf.text "This page has even wider margins on all sides except for the right side, where it's 0"
18
- end
@@ -1,50 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This example demonstrates the use of the the outlines option for a new document
4
- # it sets an initial outline item with a title
5
- #
6
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
7
-
8
- Prawn::Document.generate('outlines.pdf') do
9
- text "Page 1. This is the first Chapter. "
10
- start_new_page
11
- text "Page 2. More in the first Chapter. "
12
- start_new_page
13
- text "Page 3. This is the second Chapter. It has a subsection. "
14
- start_new_page
15
- text "Page 4. More in the second Chapter. "
16
- define_outline do
17
- section 'Chapter 1', :page => 1, :closed => true do
18
- page 1, :title => 'Page 1'
19
- page 2, :title => 'Page 2'
20
- end
21
- section 'Chapter 2', :page => 3 do
22
- section 'Chapter 2 Subsection' do
23
- page nil, :title => 'Page 3'
24
- end
25
- page 4, :title => 'Page 4'
26
- end
27
- end
28
- start_new_page
29
- text "Page 5. Appendix"
30
- start_new_page
31
- text "Page 6. More in the Appendix"
32
- outline.add_section do
33
- section 'Appendix', :page => 5 do
34
- page 5, :title => 'Page 5'
35
- page 6, :title => 'Page 6'
36
- end
37
- end
38
- go_to_page 4
39
- start_new_page
40
- text "inserted before the Appendix"
41
- outline.insert_section_after 'Chapter 2' do
42
- page page_number, :title => "Pre-Appendix"
43
- end
44
- go_to_page 7
45
- start_new_page
46
- text "One last page"
47
- outline.insert_section_after 'Page 6' do
48
- page page_number, :title => "Inserted after 6"
49
- end
50
- end
@@ -1,31 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This demonstrates basic page layout and landscape options for Prawn
4
- # documents. The style used here is a bit out of date, see
5
- # multi_page_layout.rb for a more modern example.
6
- #
7
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
8
-
9
- def pdf(*options)
10
- Prawn::Document.new(*options)
11
- end
12
-
13
- # defaults to portrait and US letter
14
- portrait_letter = pdf
15
- portrait_letter.render_file "portrait_letter.pdf"
16
-
17
- landscape_letter = pdf(:page_layout => :landscape)
18
- landscape_letter.render_file "landscape_letter.pdf"
19
-
20
- portrait_legal = pdf(:page_size => "LEGAL")
21
- portrait_legal.render_file "portrait_legal.pdf"
22
-
23
- landscape_legal = pdf(:page_size => "LEGAL", :page_layout => :landscape)
24
- landscape_legal.render_file "landscape_legal.pdf"
25
-
26
- portrait_a4 = pdf(:page_size => "A4")
27
- portrait_a4.render_file "portrait_a4.pdf"
28
-
29
- landscape_a4 = pdf(:page_size => "A4", :page_layout => :landscape)
30
- landscape_a4.render_file("landscape_a4.pdf")
31
-
@@ -1,15 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This example demonstrates how to add a "page k of n"
4
- # template to your documents.
5
- #
6
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
7
-
8
- Prawn::Document.generate("page_with_numbering.pdf") do
9
- text "Hai"
10
- start_new_page
11
- text "bai"
12
- start_new_page
13
- text "-- Hai again"
14
- number_pages "<page> in a total of <total>", [bounds.right - 50, 0]
15
- end
@@ -1,47 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # This example demonstrates how to make use of Prawn's repeating element
4
- # support. Note that all repeated elements are generated using XObjects, so
5
- # they should be pretty efficient.
6
- #
7
- #
8
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
9
-
10
- Prawn::Document.generate("repeat.pdf", :skip_page_creation => true) do
11
-
12
- repeat :all do
13
- draw_text "ALLLLLL", :at => bounds.top_left
14
- end
15
-
16
- repeat :odd do
17
- draw_text "ODD", :at => [0,0]
18
- end
19
-
20
- repeat :even do
21
- draw_text "EVEN", :at => [0,0]
22
- end
23
-
24
- repeat [1,2] do
25
- draw_text "[1,2]", :at => [100,0]
26
- end
27
-
28
- repeat 2..4 do
29
- draw_text "2..4", :at => [200,0]
30
- end
31
-
32
- repeat(lambda { |pg| pg % 3 == 0 }) do
33
- draw_text "Every third", :at => [250, 20]
34
- end
35
-
36
- repeat(:all, :dynamic => true) do
37
- draw_text page_number, :at => [500, 0]
38
- end
39
-
40
- 10.times do
41
- start_new_page
42
- draw_text "A wonderful page", :at => [400,400]
43
- end
44
-
45
- end
46
-
47
-
@@ -1,41 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- # Demonstrate use of stamps
4
- #
5
- require "#{File.dirname(__FILE__)}/../example_helper.rb"
6
-
7
- Prawn::Document.generate("stamp.pdf", :skip_page_creation => true) do
8
-
9
- create_stamp("odd_page_template") do
10
- draw_text "This is the odd page template",
11
- :at => [0, bounds.top - font.height]
12
- draw_text "This is also in the odd page template", :at => [0, 0]
13
- end
14
-
15
- create_stamp("even_page_template") do
16
- draw_text "This is the even page template",
17
- :at => [0, bounds.top - font.height]
18
- draw_text "This is also in the even page template", :at => [0, 0]
19
- end
20
-
21
- start_new_page
22
- stamp("odd_page_template")
23
-
24
- create_stamp("MyStamp") do
25
- fill_color("ff0000")
26
- fill_circle_at([0, 0], :radius => 20)
27
- fill_color("000000")
28
- fill_circle_at([10, 10], :radius => 20)
29
- end
30
-
31
- 10.times do |i|
32
- 10.times do |j|
33
- stamp_at("MyStamp", [100 + j * 50, bounds.top - 100 - i * 50])
34
- end
35
- end
36
-
37
- 4.times do |i|
38
- start_new_page
39
- stamp("#{i % 2 == 0 ? 'even' : 'odd'}_page_template")
40
- end
41
- end