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.
- data/README.markdown +51 -2
- data/Rakefile +16 -2
- data/lib/prawn/graph.rb +1 -4
- data/lib/prawn/graph/bar.rb +39 -143
- data/lib/prawn/graph/base.rb +207 -0
- data/lib/prawn/graph/errors.rb +2 -1
- data/lib/prawn/graph/grid.rb +5 -0
- data/lib/prawn/graph/line.rb +40 -1
- data/lib/prawn/graph/theme.rb +24 -0
- metadata +19 -312
- data/vendor/prawn-core/COPYING +0 -340
- data/vendor/prawn-core/HACKING +0 -46
- data/vendor/prawn-core/LICENSE +0 -56
- data/vendor/prawn-core/README +0 -138
- data/vendor/prawn-core/Rakefile +0 -75
- data/vendor/prawn-core/bench/afm_text_bench.rb +0 -18
- data/vendor/prawn-core/bench/png_type_6.rb +0 -15
- data/vendor/prawn-core/bench/ttf_text_bench.rb +0 -19
- data/vendor/prawn-core/bugs/indentation_across_pagebreaks.rb +0 -15
- data/vendor/prawn-core/bugs/resolved/canvas_sets_y_to_0.rb +0 -15
- data/vendor/prawn-core/bugs/resolved/png_barcode_issue.rb +0 -11
- data/vendor/prawn-core/bugs/resolved/transaction_page_number_issue_79.rb +0 -21
- data/vendor/prawn-core/bugs/resolved/ttf_fails_in_transactions.rb +0 -24
- data/vendor/prawn-core/data/encodings/win_ansi.txt +0 -29
- data/vendor/prawn-core/data/fonts/Action Man.dfont +0 -0
- data/vendor/prawn-core/data/fonts/Activa.ttf +0 -0
- data/vendor/prawn-core/data/fonts/Chalkboard.ttf +0 -0
- data/vendor/prawn-core/data/fonts/Courier-Bold.afm +0 -342
- data/vendor/prawn-core/data/fonts/Courier-BoldOblique.afm +0 -342
- data/vendor/prawn-core/data/fonts/Courier-Oblique.afm +0 -342
- data/vendor/prawn-core/data/fonts/Courier.afm +0 -342
- data/vendor/prawn-core/data/fonts/DejaVuSans.ttf +0 -0
- data/vendor/prawn-core/data/fonts/Dustismo_Roman.ttf +0 -0
- data/vendor/prawn-core/data/fonts/Helvetica-Bold.afm +0 -2827
- data/vendor/prawn-core/data/fonts/Helvetica-BoldOblique.afm +0 -2827
- data/vendor/prawn-core/data/fonts/Helvetica-Oblique.afm +0 -3051
- data/vendor/prawn-core/data/fonts/Helvetica.afm +0 -3051
- data/vendor/prawn-core/data/fonts/MustRead.html +0 -19
- data/vendor/prawn-core/data/fonts/Symbol.afm +0 -213
- data/vendor/prawn-core/data/fonts/Times-Bold.afm +0 -2588
- data/vendor/prawn-core/data/fonts/Times-BoldItalic.afm +0 -2384
- data/vendor/prawn-core/data/fonts/Times-Italic.afm +0 -2667
- data/vendor/prawn-core/data/fonts/Times-Roman.afm +0 -2419
- data/vendor/prawn-core/data/fonts/ZapfDingbats.afm +0 -225
- data/vendor/prawn-core/data/fonts/comicsans.ttf +0 -0
- data/vendor/prawn-core/data/fonts/gkai00mp.ttf +0 -0
- data/vendor/prawn-core/data/images/16bit.alpha +0 -0
- data/vendor/prawn-core/data/images/16bit.dat +0 -0
- data/vendor/prawn-core/data/images/16bit.png +0 -0
- data/vendor/prawn-core/data/images/arrow.png +0 -0
- data/vendor/prawn-core/data/images/arrow2.png +0 -0
- data/vendor/prawn-core/data/images/barcode_issue.png +0 -0
- data/vendor/prawn-core/data/images/dice.alpha +0 -0
- data/vendor/prawn-core/data/images/dice.dat +0 -0
- data/vendor/prawn-core/data/images/dice.png +0 -0
- data/vendor/prawn-core/data/images/dice_interlaced.png +0 -0
- data/vendor/prawn-core/data/images/fractal.jpg +0 -0
- data/vendor/prawn-core/data/images/letterhead.jpg +0 -0
- data/vendor/prawn-core/data/images/page_white_text.alpha +0 -0
- data/vendor/prawn-core/data/images/page_white_text.dat +0 -0
- data/vendor/prawn-core/data/images/page_white_text.png +0 -0
- data/vendor/prawn-core/data/images/pigs.jpg +0 -0
- data/vendor/prawn-core/data/images/rails.dat +0 -0
- data/vendor/prawn-core/data/images/rails.png +0 -0
- data/vendor/prawn-core/data/images/ruport.png +0 -0
- data/vendor/prawn-core/data/images/ruport_data.dat +0 -0
- data/vendor/prawn-core/data/images/ruport_transparent.png +0 -0
- data/vendor/prawn-core/data/images/ruport_type0.png +0 -0
- data/vendor/prawn-core/data/images/stef.jpg +0 -0
- data/vendor/prawn-core/data/images/tru256.bmp +0 -0
- data/vendor/prawn-core/data/images/web-links.dat +0 -1
- data/vendor/prawn-core/data/images/web-links.png +0 -0
- data/vendor/prawn-core/data/shift_jis_text.txt +0 -1
- data/vendor/prawn-core/examples/bounding_box/bounding_boxes.rb +0 -43
- data/vendor/prawn-core/examples/bounding_box/indentation.rb +0 -34
- data/vendor/prawn-core/examples/bounding_box/russian_boxes.rb +0 -36
- data/vendor/prawn-core/examples/bounding_box/stretched_nesting.rb +0 -67
- data/vendor/prawn-core/examples/column_box/column_box_example.rb +0 -43
- data/vendor/prawn-core/examples/example_helper.rb +0 -3
- data/vendor/prawn-core/examples/general/background.rb +0 -23
- data/vendor/prawn-core/examples/general/canvas.rb +0 -15
- data/vendor/prawn-core/examples/general/context_sensitive_headers.rb +0 -37
- data/vendor/prawn-core/examples/general/float.rb +0 -11
- data/vendor/prawn-core/examples/general/margin.rb +0 -36
- data/vendor/prawn-core/examples/general/measurement_units.rb +0 -51
- data/vendor/prawn-core/examples/general/metadata-info.rb +0 -16
- data/vendor/prawn-core/examples/general/multi_page_layout.rb +0 -18
- data/vendor/prawn-core/examples/general/outlines.rb +0 -50
- data/vendor/prawn-core/examples/general/page_geometry.rb +0 -31
- data/vendor/prawn-core/examples/general/page_numbering.rb +0 -15
- data/vendor/prawn-core/examples/general/repeaters.rb +0 -47
- data/vendor/prawn-core/examples/general/stamp.rb +0 -41
- data/vendor/prawn-core/examples/graphics/basic_images.rb +0 -23
- data/vendor/prawn-core/examples/graphics/cmyk.rb +0 -12
- data/vendor/prawn-core/examples/graphics/curves.rb +0 -11
- data/vendor/prawn-core/examples/graphics/hexagon.rb +0 -13
- data/vendor/prawn-core/examples/graphics/image_fit.rb +0 -15
- data/vendor/prawn-core/examples/graphics/image_flow.rb +0 -37
- data/vendor/prawn-core/examples/graphics/image_position.rb +0 -17
- data/vendor/prawn-core/examples/graphics/line.rb +0 -32
- data/vendor/prawn-core/examples/graphics/png_types.rb +0 -22
- data/vendor/prawn-core/examples/graphics/polygons.rb +0 -16
- data/vendor/prawn-core/examples/graphics/remote_images.rb +0 -12
- data/vendor/prawn-core/examples/graphics/rounded_polygons.rb +0 -19
- data/vendor/prawn-core/examples/graphics/rounded_rectangle.rb +0 -20
- data/vendor/prawn-core/examples/graphics/ruport_style_helpers.rb +0 -19
- data/vendor/prawn-core/examples/graphics/stroke_bounds.rb +0 -20
- data/vendor/prawn-core/examples/graphics/stroke_cap_and_join.rb +0 -45
- data/vendor/prawn-core/examples/graphics/stroke_dash.rb +0 -42
- data/vendor/prawn-core/examples/graphics/transformations.rb +0 -52
- data/vendor/prawn-core/examples/graphics/transparency.rb +0 -26
- data/vendor/prawn-core/examples/m17n/chinese_text_wrapping.rb +0 -17
- data/vendor/prawn-core/examples/m17n/euro.rb +0 -15
- data/vendor/prawn-core/examples/m17n/sjis.rb +0 -28
- data/vendor/prawn-core/examples/m17n/utf8.rb +0 -13
- data/vendor/prawn-core/examples/m17n/win_ansi_charset.rb +0 -54
- data/vendor/prawn-core/examples/text/alignment.rb +0 -18
- data/vendor/prawn-core/examples/text/dfont.rb +0 -48
- data/vendor/prawn-core/examples/text/family_based_styling.rb +0 -24
- data/vendor/prawn-core/examples/text/font_calculations.rb +0 -91
- data/vendor/prawn-core/examples/text/font_size.rb +0 -33
- data/vendor/prawn-core/examples/text/indent_paragraphs.rb +0 -18
- data/vendor/prawn-core/examples/text/kerning.rb +0 -30
- data/vendor/prawn-core/examples/text/rotated.rb +0 -98
- data/vendor/prawn-core/examples/text/simple_text.rb +0 -17
- data/vendor/prawn-core/examples/text/simple_text_ttf.rb +0 -17
- data/vendor/prawn-core/examples/text/span.rb +0 -29
- data/vendor/prawn-core/examples/text/text_box.rb +0 -88
- data/vendor/prawn-core/examples/text/text_box_returning_excess.rb +0 -51
- data/vendor/prawn-core/examples/text/text_flow.rb +0 -67
- data/vendor/prawn-core/lib/prawn/byte_string.rb +0 -7
- data/vendor/prawn-core/lib/prawn/compatibility.rb +0 -51
- data/vendor/prawn-core/lib/prawn/core.rb +0 -87
- data/vendor/prawn-core/lib/prawn/core/page.rb +0 -88
- data/vendor/prawn-core/lib/prawn/core/text.rb +0 -65
- data/vendor/prawn-core/lib/prawn/document.rb +0 -596
- data/vendor/prawn-core/lib/prawn/document/annotations.rb +0 -65
- data/vendor/prawn-core/lib/prawn/document/bounding_box.rb +0 -402
- data/vendor/prawn-core/lib/prawn/document/column_box.rb +0 -113
- data/vendor/prawn-core/lib/prawn/document/destinations.rb +0 -92
- data/vendor/prawn-core/lib/prawn/document/graphics_state.rb +0 -49
- data/vendor/prawn-core/lib/prawn/document/internals.rb +0 -153
- data/vendor/prawn-core/lib/prawn/document/page_geometry.rb +0 -136
- data/vendor/prawn-core/lib/prawn/document/snapshot.rb +0 -80
- data/vendor/prawn-core/lib/prawn/document/span.rb +0 -55
- data/vendor/prawn-core/lib/prawn/encoding.rb +0 -121
- data/vendor/prawn-core/lib/prawn/errors.rb +0 -83
- data/vendor/prawn-core/lib/prawn/font.rb +0 -329
- data/vendor/prawn-core/lib/prawn/font/afm.rb +0 -217
- data/vendor/prawn-core/lib/prawn/font/dfont.rb +0 -34
- data/vendor/prawn-core/lib/prawn/font/ttf.rb +0 -341
- data/vendor/prawn-core/lib/prawn/graphics.rb +0 -321
- data/vendor/prawn-core/lib/prawn/graphics/cap_style.rb +0 -38
- data/vendor/prawn-core/lib/prawn/graphics/color.rb +0 -205
- data/vendor/prawn-core/lib/prawn/graphics/dash.rb +0 -71
- data/vendor/prawn-core/lib/prawn/graphics/join_style.rb +0 -38
- data/vendor/prawn-core/lib/prawn/graphics/transformation.rb +0 -157
- data/vendor/prawn-core/lib/prawn/graphics/transparency.rb +0 -99
- data/vendor/prawn-core/lib/prawn/images.rb +0 -337
- data/vendor/prawn-core/lib/prawn/images/jpg.rb +0 -46
- data/vendor/prawn-core/lib/prawn/images/png.rb +0 -219
- data/vendor/prawn-core/lib/prawn/literal_string.rb +0 -14
- data/vendor/prawn-core/lib/prawn/measurement_extensions.rb +0 -46
- data/vendor/prawn-core/lib/prawn/measurements.rb +0 -71
- data/vendor/prawn-core/lib/prawn/name_tree.rb +0 -166
- data/vendor/prawn-core/lib/prawn/object_store.rb +0 -93
- data/vendor/prawn-core/lib/prawn/outline.rb +0 -278
- data/vendor/prawn-core/lib/prawn/pdf_object.rb +0 -83
- data/vendor/prawn-core/lib/prawn/reference.rb +0 -92
- data/vendor/prawn-core/lib/prawn/repeater.rb +0 -129
- data/vendor/prawn-core/lib/prawn/stamp.rb +0 -128
- data/vendor/prawn-core/lib/prawn/text.rb +0 -271
- data/vendor/prawn-core/lib/prawn/text/box.rb +0 -414
- data/vendor/prawn-core/meta/Rakefile +0 -36
- data/vendor/prawn-core/meta/lib/prawn.rb +0 -2
- data/vendor/prawn-core/reference_pdfs/alignment.pdf +0 -229
- data/vendor/prawn-core/reference_pdfs/background.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/basic_images.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/bounding_boxes.pdf +0 -128
- data/vendor/prawn-core/reference_pdfs/canvas.pdf +0 -78
- data/vendor/prawn-core/reference_pdfs/chinese_flow.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/cmyk.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/column_box.pdf +0 -3671
- data/vendor/prawn-core/reference_pdfs/context_sensitive_headers.pdf +0 -2331
- data/vendor/prawn-core/reference_pdfs/curves.pdf +0 -62
- data/vendor/prawn-core/reference_pdfs/dfont.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/euro.pdf +0 -75
- data/vendor/prawn-core/reference_pdfs/family_style.pdf +0 -286
- data/vendor/prawn-core/reference_pdfs/flow.pdf +0 -964
- data/vendor/prawn-core/reference_pdfs/font_calculations.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/font_size.pdf +0 -142
- data/vendor/prawn-core/reference_pdfs/hexagon.pdf +0 -61
- data/vendor/prawn-core/reference_pdfs/image-flow.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/image_fit.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/image_position.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/indentation.pdf +0 -124
- data/vendor/prawn-core/reference_pdfs/kerning.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/landscape_a4.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/landscape_legal.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/landscape_letter.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/lines.pdf +0 -116
- data/vendor/prawn-core/reference_pdfs/margin.pdf +0 -3850
- data/vendor/prawn-core/reference_pdfs/measurement_units.pdf +0 -4667
- data/vendor/prawn-core/reference_pdfs/metadata-info.pdf +0 -88
- data/vendor/prawn-core/reference_pdfs/multi-layout.pdf +0 -209
- data/vendor/prawn-core/reference_pdfs/page_with_numbering.pdf +0 -156
- data/vendor/prawn-core/reference_pdfs/png_types.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/portrait_a4.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/portrait_legal.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/portrait_letter.pdf +0 -52
- data/vendor/prawn-core/reference_pdfs/pretty_polygons.pdf +0 -122
- data/vendor/prawn-core/reference_pdfs/remote_images.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/ruport.pdf +0 -101
- data/vendor/prawn-core/reference_pdfs/russian_boxes.pdf +0 -2780
- data/vendor/prawn-core/reference_pdfs/simple_text.pdf +0 -136
- data/vendor/prawn-core/reference_pdfs/simple_text_ttf.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/sjis.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/span.pdf +0 -1975
- data/vendor/prawn-core/reference_pdfs/stamp.pdf +0 -649
- data/vendor/prawn-core/reference_pdfs/stretched_nesting.pdf +0 -200
- data/vendor/prawn-core/reference_pdfs/stroke_bounds.pdf +0 -135
- data/vendor/prawn-core/reference_pdfs/stroke_cap_and_join.pdf +0 -80
- data/vendor/prawn-core/reference_pdfs/stroke_dash.pdf +0 -457
- data/vendor/prawn-core/reference_pdfs/text_box.pdf +0 -962
- data/vendor/prawn-core/reference_pdfs/text_box_returning_excess.pdf +0 -271
- data/vendor/prawn-core/reference_pdfs/transparency.pdf +0 -347
- data/vendor/prawn-core/reference_pdfs/utf8.pdf +0 -0
- data/vendor/prawn-core/reference_pdfs/win-ansi.pdf +0 -6172
- data/vendor/prawn-core/spec/annotations_spec.rb +0 -90
- data/vendor/prawn-core/spec/bounding_box_spec.rb +0 -185
- data/vendor/prawn-core/spec/destinations_spec.rb +0 -15
- data/vendor/prawn-core/spec/document_spec.rb +0 -408
- data/vendor/prawn-core/spec/font_spec.rb +0 -314
- data/vendor/prawn-core/spec/graphics_spec.rb +0 -438
- data/vendor/prawn-core/spec/images_spec.rb +0 -79
- data/vendor/prawn-core/spec/jpg_spec.rb +0 -25
- data/vendor/prawn-core/spec/measurement_units_spec.rb +0 -23
- data/vendor/prawn-core/spec/name_tree_spec.rb +0 -112
- data/vendor/prawn-core/spec/object_store_spec.rb +0 -75
- data/vendor/prawn-core/spec/outline_spec.rb +0 -229
- data/vendor/prawn-core/spec/pdf_object_spec.rb +0 -122
- data/vendor/prawn-core/spec/png_spec.rb +0 -236
- data/vendor/prawn-core/spec/reference_spec.rb +0 -82
- data/vendor/prawn-core/spec/repeater_spec.rb +0 -96
- data/vendor/prawn-core/spec/snapshot_spec.rb +0 -138
- data/vendor/prawn-core/spec/span_spec.rb +0 -49
- data/vendor/prawn-core/spec/spec_helper.rb +0 -24
- data/vendor/prawn-core/spec/stamp_spec.rb +0 -108
- data/vendor/prawn-core/spec/stroke_styles_spec.rb +0 -152
- data/vendor/prawn-core/spec/text_at_spec.rb +0 -119
- data/vendor/prawn-core/spec/text_box_spec.rb +0 -603
- data/vendor/prawn-core/spec/text_spec.rb +0 -308
- data/vendor/prawn-core/spec/transparency_spec.rb +0 -75
- data/vendor/prawn-core/vendor/pdf-inspector/README +0 -18
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector.rb +0 -26
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/extgstate.rb +0 -18
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/graphics.rb +0 -131
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/page.rb +0 -25
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/text.rb +0 -31
- data/vendor/prawn-core/vendor/pdf-inspector/lib/pdf/inspector/xobject.rb +0 -19
- data/vendor/prawn-core/vendor/ttfunk/data/fonts/DejaVuSans.ttf +0 -0
- data/vendor/prawn-core/vendor/ttfunk/data/fonts/comicsans.ttf +0 -0
- data/vendor/prawn-core/vendor/ttfunk/example.rb +0 -45
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk.rb +0 -102
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/directory.rb +0 -17
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/encoding/mac_roman.rb +0 -88
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/encoding/windows_1252.rb +0 -69
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/reader.rb +0 -44
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/resource_file.rb +0 -78
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset.rb +0 -18
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/base.rb +0 -141
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/mac_roman.rb +0 -46
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/unicode.rb +0 -48
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/unicode_8bit.rb +0 -63
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset/windows_1252.rb +0 -51
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/subset_collection.rb +0 -72
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table.rb +0 -46
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap.rb +0 -34
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/format00.rb +0 -54
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/format04.rb +0 -126
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/cmap/subtable.rb +0 -79
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf.rb +0 -64
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf/compound.rb +0 -81
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/glyf/simple.rb +0 -37
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/head.rb +0 -44
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/hhea.rb +0 -41
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/hmtx.rb +0 -47
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/kern.rb +0 -79
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/kern/format0.rb +0 -62
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/loca.rb +0 -43
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/maxp.rb +0 -40
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/name.rb +0 -119
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/os2.rb +0 -78
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post.rb +0 -91
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format10.rb +0 -43
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format20.rb +0 -35
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format25.rb +0 -23
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format30.rb +0 -17
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/post/format40.rb +0 -17
- data/vendor/prawn-core/vendor/ttfunk/lib/ttfunk/table/simple.rb +0 -14
- data/vendor/prawn-core/www/index.html +0 -196
- data/vendor/prawn-core/www/media/bounding_boxes.pdf +0 -146
- data/vendor/prawn-core/www/media/bounding_boxes.png +0 -0
- data/vendor/prawn-core/www/media/bounding_boxes_out.png +0 -0
- data/vendor/prawn-core/www/media/fancy_table.pdf +0 -350
- data/vendor/prawn-core/www/media/image.pdf +0 -0
- data/vendor/prawn-core/www/media/images.png +0 -0
- data/vendor/prawn-core/www/media/prawn_logo.png +0 -0
- data/vendor/prawn-core/www/media/tables.png +0 -0
- data/vendor/prawn-core/www/media/utf8.pdf +0 -0
- data/vendor/prawn-core/www/media/utf8.png +0 -0
- data/vendor/prawn-core/www/prawn-Chinese.html +0 -113
- data/vendor/prawn-core/www/prawn.css +0 -86
- 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,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,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
|