prawn 2.4.0 → 2.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/prawn/document/bounding_box.rb +213 -141
- data/lib/prawn/document/column_box.rb +61 -26
- data/lib/prawn/document/internals.rb +25 -16
- data/lib/prawn/document/span.rb +20 -18
- data/lib/prawn/document.rb +257 -171
- data/lib/prawn/encoding.rb +2 -5
- data/lib/prawn/errors.rb +23 -34
- data/lib/prawn/font.rb +248 -135
- data/lib/prawn/font_metric_cache.rb +11 -10
- data/lib/prawn/fonts/afm.rb +85 -45
- data/lib/prawn/fonts/dfont.rb +7 -1
- data/lib/prawn/fonts/otf.rb +4 -1
- data/lib/prawn/fonts/to_unicode_cmap.rb +151 -0
- data/lib/prawn/fonts/ttc.rb +7 -2
- data/lib/prawn/fonts/ttf.rb +305 -93
- data/lib/prawn/fonts.rb +14 -0
- data/lib/prawn/graphics/blend_mode.rb +25 -28
- data/lib/prawn/graphics/cap_style.rb +9 -12
- data/lib/prawn/graphics/color.rb +57 -34
- data/lib/prawn/graphics/dash.rb +45 -42
- data/lib/prawn/graphics/join_style.rb +17 -11
- data/lib/prawn/graphics/patterns.rb +190 -69
- data/lib/prawn/graphics/transformation.rb +48 -41
- data/lib/prawn/graphics/transparency.rb +16 -40
- data/lib/prawn/graphics.rb +363 -253
- data/lib/prawn/grid.rb +184 -57
- data/lib/prawn/image_handler.rb +27 -10
- data/lib/prawn/images/image.rb +8 -10
- data/lib/prawn/images/jpg.rb +42 -19
- data/lib/prawn/images/png.rb +92 -41
- data/lib/prawn/images.rb +44 -57
- data/lib/prawn/measurement_extensions.rb +39 -8
- data/lib/prawn/measurements.rb +60 -5
- data/lib/prawn/outline.rb +114 -108
- data/lib/prawn/repeater.rb +51 -35
- data/lib/prawn/security/arcfour.rb +4 -4
- data/lib/prawn/security.rb +75 -70
- data/lib/prawn/soft_mask.rb +42 -30
- data/lib/prawn/stamp.rb +38 -42
- data/lib/prawn/text/box.rb +146 -96
- data/lib/prawn/text/formatted/arranger.rb +87 -26
- data/lib/prawn/text/formatted/box.rb +221 -150
- data/lib/prawn/text/formatted/fragment.rb +130 -14
- data/lib/prawn/text/formatted/line_wrap.rb +33 -24
- data/lib/prawn/text/formatted/parser.rb +112 -72
- data/lib/prawn/text/formatted/wrap.rb +12 -17
- data/lib/prawn/text/formatted.rb +75 -0
- data/lib/prawn/text.rb +441 -196
- data/lib/prawn/transformation_stack.rb +29 -10
- data/lib/prawn/utilities.rb +13 -13
- data/lib/prawn/version.rb +2 -1
- data/lib/prawn/view.rb +68 -53
- data/lib/prawn.rb +23 -18
- data.tar.gz.sig +0 -0
- metadata +54 -177
- metadata.gz.sig +0 -0
- data/.yardopts +0 -10
- data/Gemfile +0 -5
- data/Rakefile +0 -25
- data/manual/absolute_position.pdf +0 -0
- data/manual/basic_concepts/adding_pages.rb +0 -26
- data/manual/basic_concepts/basic_concepts.rb +0 -43
- data/manual/basic_concepts/creation.rb +0 -38
- data/manual/basic_concepts/cursor.rb +0 -32
- data/manual/basic_concepts/measurement.rb +0 -24
- data/manual/basic_concepts/origin.rb +0 -37
- data/manual/basic_concepts/other_cursor_helpers.rb +0 -39
- data/manual/basic_concepts/view.rb +0 -48
- data/manual/bounding_box/bounding_box.rb +0 -41
- data/manual/bounding_box/bounds.rb +0 -48
- data/manual/bounding_box/canvas.rb +0 -23
- data/manual/bounding_box/creation.rb +0 -22
- data/manual/bounding_box/indentation.rb +0 -45
- data/manual/bounding_box/nesting.rb +0 -52
- data/manual/bounding_box/russian_boxes.rb +0 -40
- data/manual/bounding_box/stretchy.rb +0 -29
- data/manual/contents.rb +0 -35
- data/manual/cover.rb +0 -43
- data/manual/document_and_page_options/background.rb +0 -29
- data/manual/document_and_page_options/document_and_page_options.rb +0 -34
- data/manual/document_and_page_options/metadata.rb +0 -25
- data/manual/document_and_page_options/page_margins.rb +0 -36
- data/manual/document_and_page_options/page_size.rb +0 -34
- data/manual/document_and_page_options/print_scaling.rb +0 -23
- data/manual/example_helper.rb +0 -8
- data/manual/graphics/blend_mode.rb +0 -52
- data/manual/graphics/circle_and_ellipse.rb +0 -21
- data/manual/graphics/color.rb +0 -22
- data/manual/graphics/common_lines.rb +0 -29
- data/manual/graphics/fill_and_stroke.rb +0 -41
- data/manual/graphics/fill_rules.rb +0 -38
- data/manual/graphics/gradients.rb +0 -43
- data/manual/graphics/graphics.rb +0 -64
- data/manual/graphics/helper.rb +0 -34
- data/manual/graphics/line_width.rb +0 -36
- data/manual/graphics/lines_and_curves.rb +0 -40
- data/manual/graphics/polygon.rb +0 -27
- data/manual/graphics/rectangle.rb +0 -20
- data/manual/graphics/rotate.rb +0 -25
- data/manual/graphics/scale.rb +0 -42
- data/manual/graphics/soft_masks.rb +0 -44
- data/manual/graphics/stroke_cap.rb +0 -30
- data/manual/graphics/stroke_dash.rb +0 -47
- data/manual/graphics/stroke_join.rb +0 -29
- data/manual/graphics/translate.rb +0 -29
- data/manual/graphics/transparency.rb +0 -33
- data/manual/how_to_read_this_manual.rb +0 -39
- data/manual/images/absolute_position.rb +0 -22
- data/manual/images/fit.rb +0 -20
- data/manual/images/horizontal.rb +0 -24
- data/manual/images/images.rb +0 -41
- data/manual/images/plain_image.rb +0 -17
- data/manual/images/scale.rb +0 -21
- data/manual/images/vertical.rb +0 -30
- data/manual/images/width_and_height.rb +0 -24
- data/manual/layout/boxes.rb +0 -26
- data/manual/layout/content.rb +0 -24
- data/manual/layout/layout.rb +0 -27
- data/manual/layout/simple_grid.rb +0 -22
- data/manual/outline/add_subsection_to.rb +0 -60
- data/manual/outline/insert_section_after.rb +0 -46
- data/manual/outline/outline.rb +0 -33
- data/manual/outline/sections_and_pages.rb +0 -66
- data/manual/repeatable_content/alternate_page_numbering.rb +0 -36
- data/manual/repeatable_content/page_numbering.rb +0 -55
- data/manual/repeatable_content/repeatable_content.rb +0 -35
- data/manual/repeatable_content/repeater.rb +0 -54
- data/manual/repeatable_content/stamp.rb +0 -40
- data/manual/security/encryption.rb +0 -28
- data/manual/security/permissions.rb +0 -43
- data/manual/security/security.rb +0 -28
- data/manual/table.rb +0 -16
- data/manual/text/alignment.rb +0 -43
- data/manual/text/color.rb +0 -24
- data/manual/text/column_box.rb +0 -30
- data/manual/text/fallback_fonts.rb +0 -41
- data/manual/text/font.rb +0 -40
- data/manual/text/font_size.rb +0 -44
- data/manual/text/font_style.rb +0 -25
- data/manual/text/formatted_callbacks.rb +0 -70
- data/manual/text/formatted_text.rb +0 -61
- data/manual/text/free_flowing_text.rb +0 -50
- data/manual/text/inline.rb +0 -40
- data/manual/text/kerning_and_character_spacing.rb +0 -38
- data/manual/text/leading.rb +0 -24
- data/manual/text/line_wrapping.rb +0 -60
- data/manual/text/paragraph_indentation.rb +0 -31
- data/manual/text/positioned_text.rb +0 -37
- data/manual/text/registering_families.rb +0 -51
- data/manual/text/rendering_and_color.rb +0 -36
- data/manual/text/right_to_left_text.rb +0 -54
- data/manual/text/rotation.rb +0 -52
- data/manual/text/single_usage.rb +0 -36
- data/manual/text/text.rb +0 -75
- data/manual/text/text_box_excess.rb +0 -35
- data/manual/text/text_box_extensions.rb +0 -48
- data/manual/text/text_box_overflow.rb +0 -51
- data/manual/text/utf8.rb +0 -27
- data/manual/text/win_ansi_charset.rb +0 -62
- data/prawn.gemspec +0 -51
- data/spec/data/curves.pdf +0 -66
- data/spec/extensions/encoding_helpers.rb +0 -11
- data/spec/prawn/document/bounding_box_spec.rb +0 -550
- data/spec/prawn/document/column_box_spec.rb +0 -75
- data/spec/prawn/document/security_spec.rb +0 -176
- data/spec/prawn/document_annotations_spec.rb +0 -76
- data/spec/prawn/document_destinations_spec.rb +0 -15
- data/spec/prawn/document_grid_spec.rb +0 -99
- data/spec/prawn/document_reference_spec.rb +0 -27
- data/spec/prawn/document_span_spec.rb +0 -44
- data/spec/prawn/document_spec.rb +0 -805
- data/spec/prawn/font_metric_cache_spec.rb +0 -54
- data/spec/prawn/font_spec.rb +0 -544
- data/spec/prawn/graphics/blend_mode_spec.rb +0 -63
- data/spec/prawn/graphics/transparency_spec.rb +0 -81
- data/spec/prawn/graphics_spec.rb +0 -872
- data/spec/prawn/graphics_stroke_styles_spec.rb +0 -229
- data/spec/prawn/image_handler_spec.rb +0 -53
- data/spec/prawn/images/jpg_spec.rb +0 -20
- data/spec/prawn/images/png_spec.rb +0 -283
- data/spec/prawn/images_spec.rb +0 -229
- data/spec/prawn/measurements_extensions_spec.rb +0 -24
- data/spec/prawn/outline_spec.rb +0 -512
- data/spec/prawn/repeater_spec.rb +0 -166
- data/spec/prawn/soft_mask_spec.rb +0 -74
- data/spec/prawn/stamp_spec.rb +0 -173
- data/spec/prawn/text/box_spec.rb +0 -1110
- data/spec/prawn/text/formatted/arranger_spec.rb +0 -466
- data/spec/prawn/text/formatted/box_spec.rb +0 -849
- data/spec/prawn/text/formatted/fragment_spec.rb +0 -343
- data/spec/prawn/text/formatted/line_wrap_spec.rb +0 -495
- data/spec/prawn/text/formatted/parser_spec.rb +0 -697
- data/spec/prawn/text_draw_text_spec.rb +0 -150
- data/spec/prawn/text_rendering_mode_spec.rb +0 -48
- data/spec/prawn/text_spacing_spec.rb +0 -95
- data/spec/prawn/text_spec.rb +0 -603
- data/spec/prawn/text_with_inline_formatting_spec.rb +0 -35
- data/spec/prawn/transformation_stack_spec.rb +0 -66
- data/spec/prawn/view_spec.rb +0 -63
- data/spec/prawn_manual_spec.rb +0 -35
- data/spec/spec_helper.rb +0 -48
metadata
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
|
+
- Alexander Mankuta
|
7
8
|
- Gregory Brown
|
8
9
|
- Brad Ediger
|
9
10
|
- Daniel Nelson
|
@@ -14,55 +15,67 @@ bindir: bin
|
|
14
15
|
cert_chain:
|
15
16
|
- |
|
16
17
|
-----BEGIN CERTIFICATE-----
|
17
|
-
|
18
|
-
|
19
|
-
|
18
|
+
MIIC+jCCAeKgAwIBAgIBAzANBgkqhkiG9w0BAQsFADAjMSEwHwYDVQQDDBhhbGV4
|
19
|
+
L0RDPXBvaW50bGVzcy9EQz1vbmUwHhcNMjMxMTA5MTA1MzIxWhcNMjQxMTA4MTA1
|
20
|
+
MzIxWjAjMSEwHwYDVQQDDBhhbGV4L0RDPXBvaW50bGVzcy9EQz1vbmUwggEiMA0G
|
20
21
|
CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPOVLPGEK+eaP6zJfifrpWvPTg4qo3
|
21
22
|
XNJJPom80SwqX2hVCVsRDK4RYgKUQqKRQzHhlx14wZHwWLETBVbNDGX3uqyCnTWU
|
22
23
|
JUKh3ydiZShXpNHoV/NW7hhEYvNsDcBAjYTmbvXOhuYCo0Tz/0N2Oiun/0wIICtP
|
23
24
|
vytY9TY0/lklWjAbsqJjNOu3o8IYkJBAN/rU96E/6WhFwjnxLcTnV9RfFRXdjG5j
|
24
25
|
CughoB2xSwKX8gwbQ8fsnaZRmdyDGYNpz6sGF0zycfiLkTttbLA2nYATCALy98CH
|
25
26
|
nsyZNsTjb4WINCuY2yEDjwesw9f/ROkNC68EgQ5M+aMjp+D0WcYGfzojAgMBAAGj
|
26
|
-
|
27
|
-
Ny/
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
Un1TJEahAlgENVml6CyDXSwk0H8N1V3gm1mb9Fe1T2Z/kAzvjo0qTDEtMVLU7Bxh
|
34
|
-
uqMUrdETjTnRYCVq
|
27
|
+
OTA3MAkGA1UdEwQCMAAwCwYDVR0PBAQDAgSwMB0GA1UdDgQWBBRPgIwSVbeonua/
|
28
|
+
Ny/8576oxdUbrjANBgkqhkiG9w0BAQsFAAOCAQEAX28QLxNNz5EgaZZuQQUkbOXB
|
29
|
+
4b5luBO22535+Vgj2jw7yjV8KKoGMWKrnB00ijgntqPEPXCzaPNibOcPZV5WfWVS
|
30
|
+
t0Ls8lWE/8kezPwV4SbRe4Y7C+D4J+oirs0L5PtpREV9CJ7kfdW/AN9MtvjjBFlb
|
31
|
+
jHquD/MiOOMyHtuO0FiTL265m10thcAUsbyi0MehKgGbtJ5fGceHvZDqDouvbMjT
|
32
|
+
hoijFk1oTY939JhjdcHuJzMiS2TrqIw8Dr5DkQu2vAjHpw0aOOWhlRjNJ7RHYJNm
|
33
|
+
QugXmCnHQxSKTmc7imKuotyMdRRKFh8UEFCLRsFtBbNxkXyNuB4xBMuUYodhEw==
|
35
34
|
-----END CERTIFICATE-----
|
36
|
-
date:
|
35
|
+
date: 2024-03-05 00:00:00.000000000 Z
|
37
36
|
dependencies:
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
name: matrix
|
39
|
+
requirement: !ruby/object:Gem::Requirement
|
40
|
+
requirements:
|
41
|
+
- - "~>"
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0.4'
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: !ruby/object:Gem::Requirement
|
47
|
+
requirements:
|
48
|
+
- - "~>"
|
49
|
+
- !ruby/object:Gem::Version
|
50
|
+
version: '0.4'
|
38
51
|
- !ruby/object:Gem::Dependency
|
39
52
|
name: pdf-core
|
40
53
|
requirement: !ruby/object:Gem::Requirement
|
41
54
|
requirements:
|
42
55
|
- - "~>"
|
43
56
|
- !ruby/object:Gem::Version
|
44
|
-
version: 0.
|
57
|
+
version: 0.10.0
|
45
58
|
type: :runtime
|
46
59
|
prerelease: false
|
47
60
|
version_requirements: !ruby/object:Gem::Requirement
|
48
61
|
requirements:
|
49
62
|
- - "~>"
|
50
63
|
- !ruby/object:Gem::Version
|
51
|
-
version: 0.
|
64
|
+
version: 0.10.0
|
52
65
|
- !ruby/object:Gem::Dependency
|
53
66
|
name: ttfunk
|
54
67
|
requirement: !ruby/object:Gem::Requirement
|
55
68
|
requirements:
|
56
69
|
- - "~>"
|
57
70
|
- !ruby/object:Gem::Version
|
58
|
-
version: '1.
|
71
|
+
version: '1.8'
|
59
72
|
type: :runtime
|
60
73
|
prerelease: false
|
61
74
|
version_requirements: !ruby/object:Gem::Requirement
|
62
75
|
requirements:
|
63
76
|
- - "~>"
|
64
77
|
- !ruby/object:Gem::Version
|
65
|
-
version: '1.
|
78
|
+
version: '1.8'
|
66
79
|
- !ruby/object:Gem::Dependency
|
67
80
|
name: pdf-inspector
|
68
81
|
requirement: !ruby/object:Gem::Requirement
|
@@ -109,30 +122,31 @@ dependencies:
|
|
109
122
|
requirements:
|
110
123
|
- - "~>"
|
111
124
|
- !ruby/object:Gem::Version
|
112
|
-
version: 0.
|
125
|
+
version: 0.4.0
|
113
126
|
type: :development
|
114
127
|
prerelease: false
|
115
128
|
version_requirements: !ruby/object:Gem::Requirement
|
116
129
|
requirements:
|
117
130
|
- - "~>"
|
118
131
|
- !ruby/object:Gem::Version
|
119
|
-
version: 0.
|
132
|
+
version: 0.4.0
|
120
133
|
- !ruby/object:Gem::Dependency
|
121
134
|
name: prawn-manual_builder
|
122
135
|
requirement: !ruby/object:Gem::Requirement
|
123
136
|
requirements:
|
124
|
-
- - "
|
137
|
+
- - "~>"
|
125
138
|
- !ruby/object:Gem::Version
|
126
|
-
version: 0.
|
139
|
+
version: 0.4.0
|
127
140
|
type: :development
|
128
141
|
prerelease: false
|
129
142
|
version_requirements: !ruby/object:Gem::Requirement
|
130
143
|
requirements:
|
131
|
-
- - "
|
144
|
+
- - "~>"
|
132
145
|
- !ruby/object:Gem::Version
|
133
|
-
version: 0.
|
134
|
-
description:
|
146
|
+
version: 0.4.0
|
147
|
+
description: Prawn is a fast, tiny, and nimble PDF generator for Ruby
|
135
148
|
email:
|
149
|
+
- alex@pointless.one
|
136
150
|
- gregory.t.brown@gmail.com
|
137
151
|
- brad@bradediger.com
|
138
152
|
- dnelson@bluejade.com
|
@@ -142,13 +156,10 @@ executables: []
|
|
142
156
|
extensions: []
|
143
157
|
extra_rdoc_files: []
|
144
158
|
files:
|
145
|
-
- ".yardopts"
|
146
159
|
- COPYING
|
147
160
|
- GPLv2
|
148
161
|
- GPLv3
|
149
|
-
- Gemfile
|
150
162
|
- LICENSE
|
151
|
-
- Rakefile
|
152
163
|
- data/fonts/Courier-Bold.afm
|
153
164
|
- data/fonts/Courier-BoldOblique.afm
|
154
165
|
- data/fonts/Courier-Oblique.afm
|
@@ -174,9 +185,11 @@ files:
|
|
174
185
|
- lib/prawn/errors.rb
|
175
186
|
- lib/prawn/font.rb
|
176
187
|
- lib/prawn/font_metric_cache.rb
|
188
|
+
- lib/prawn/fonts.rb
|
177
189
|
- lib/prawn/fonts/afm.rb
|
178
190
|
- lib/prawn/fonts/dfont.rb
|
179
191
|
- lib/prawn/fonts/otf.rb
|
192
|
+
- lib/prawn/fonts/to_unicode_cmap.rb
|
180
193
|
- lib/prawn/fonts/ttc.rb
|
181
194
|
- lib/prawn/fonts/ttf.rb
|
182
195
|
- lib/prawn/graphics.rb
|
@@ -215,154 +228,18 @@ files:
|
|
215
228
|
- lib/prawn/utilities.rb
|
216
229
|
- lib/prawn/version.rb
|
217
230
|
- lib/prawn/view.rb
|
218
|
-
|
219
|
-
- manual/basic_concepts/adding_pages.rb
|
220
|
-
- manual/basic_concepts/basic_concepts.rb
|
221
|
-
- manual/basic_concepts/creation.rb
|
222
|
-
- manual/basic_concepts/cursor.rb
|
223
|
-
- manual/basic_concepts/measurement.rb
|
224
|
-
- manual/basic_concepts/origin.rb
|
225
|
-
- manual/basic_concepts/other_cursor_helpers.rb
|
226
|
-
- manual/basic_concepts/view.rb
|
227
|
-
- manual/bounding_box/bounding_box.rb
|
228
|
-
- manual/bounding_box/bounds.rb
|
229
|
-
- manual/bounding_box/canvas.rb
|
230
|
-
- manual/bounding_box/creation.rb
|
231
|
-
- manual/bounding_box/indentation.rb
|
232
|
-
- manual/bounding_box/nesting.rb
|
233
|
-
- manual/bounding_box/russian_boxes.rb
|
234
|
-
- manual/bounding_box/stretchy.rb
|
235
|
-
- manual/contents.rb
|
236
|
-
- manual/cover.rb
|
237
|
-
- manual/document_and_page_options/background.rb
|
238
|
-
- manual/document_and_page_options/document_and_page_options.rb
|
239
|
-
- manual/document_and_page_options/metadata.rb
|
240
|
-
- manual/document_and_page_options/page_margins.rb
|
241
|
-
- manual/document_and_page_options/page_size.rb
|
242
|
-
- manual/document_and_page_options/print_scaling.rb
|
243
|
-
- manual/example_helper.rb
|
244
|
-
- manual/graphics/blend_mode.rb
|
245
|
-
- manual/graphics/circle_and_ellipse.rb
|
246
|
-
- manual/graphics/color.rb
|
247
|
-
- manual/graphics/common_lines.rb
|
248
|
-
- manual/graphics/fill_and_stroke.rb
|
249
|
-
- manual/graphics/fill_rules.rb
|
250
|
-
- manual/graphics/gradients.rb
|
251
|
-
- manual/graphics/graphics.rb
|
252
|
-
- manual/graphics/helper.rb
|
253
|
-
- manual/graphics/line_width.rb
|
254
|
-
- manual/graphics/lines_and_curves.rb
|
255
|
-
- manual/graphics/polygon.rb
|
256
|
-
- manual/graphics/rectangle.rb
|
257
|
-
- manual/graphics/rotate.rb
|
258
|
-
- manual/graphics/scale.rb
|
259
|
-
- manual/graphics/soft_masks.rb
|
260
|
-
- manual/graphics/stroke_cap.rb
|
261
|
-
- manual/graphics/stroke_dash.rb
|
262
|
-
- manual/graphics/stroke_join.rb
|
263
|
-
- manual/graphics/translate.rb
|
264
|
-
- manual/graphics/transparency.rb
|
265
|
-
- manual/how_to_read_this_manual.rb
|
266
|
-
- manual/images/absolute_position.rb
|
267
|
-
- manual/images/fit.rb
|
268
|
-
- manual/images/horizontal.rb
|
269
|
-
- manual/images/images.rb
|
270
|
-
- manual/images/plain_image.rb
|
271
|
-
- manual/images/scale.rb
|
272
|
-
- manual/images/vertical.rb
|
273
|
-
- manual/images/width_and_height.rb
|
274
|
-
- manual/layout/boxes.rb
|
275
|
-
- manual/layout/content.rb
|
276
|
-
- manual/layout/layout.rb
|
277
|
-
- manual/layout/simple_grid.rb
|
278
|
-
- manual/outline/add_subsection_to.rb
|
279
|
-
- manual/outline/insert_section_after.rb
|
280
|
-
- manual/outline/outline.rb
|
281
|
-
- manual/outline/sections_and_pages.rb
|
282
|
-
- manual/repeatable_content/alternate_page_numbering.rb
|
283
|
-
- manual/repeatable_content/page_numbering.rb
|
284
|
-
- manual/repeatable_content/repeatable_content.rb
|
285
|
-
- manual/repeatable_content/repeater.rb
|
286
|
-
- manual/repeatable_content/stamp.rb
|
287
|
-
- manual/security/encryption.rb
|
288
|
-
- manual/security/permissions.rb
|
289
|
-
- manual/security/security.rb
|
290
|
-
- manual/table.rb
|
291
|
-
- manual/text/alignment.rb
|
292
|
-
- manual/text/color.rb
|
293
|
-
- manual/text/column_box.rb
|
294
|
-
- manual/text/fallback_fonts.rb
|
295
|
-
- manual/text/font.rb
|
296
|
-
- manual/text/font_size.rb
|
297
|
-
- manual/text/font_style.rb
|
298
|
-
- manual/text/formatted_callbacks.rb
|
299
|
-
- manual/text/formatted_text.rb
|
300
|
-
- manual/text/free_flowing_text.rb
|
301
|
-
- manual/text/inline.rb
|
302
|
-
- manual/text/kerning_and_character_spacing.rb
|
303
|
-
- manual/text/leading.rb
|
304
|
-
- manual/text/line_wrapping.rb
|
305
|
-
- manual/text/paragraph_indentation.rb
|
306
|
-
- manual/text/positioned_text.rb
|
307
|
-
- manual/text/registering_families.rb
|
308
|
-
- manual/text/rendering_and_color.rb
|
309
|
-
- manual/text/right_to_left_text.rb
|
310
|
-
- manual/text/rotation.rb
|
311
|
-
- manual/text/single_usage.rb
|
312
|
-
- manual/text/text.rb
|
313
|
-
- manual/text/text_box_excess.rb
|
314
|
-
- manual/text/text_box_extensions.rb
|
315
|
-
- manual/text/text_box_overflow.rb
|
316
|
-
- manual/text/utf8.rb
|
317
|
-
- manual/text/win_ansi_charset.rb
|
318
|
-
- prawn.gemspec
|
319
|
-
- spec/data/curves.pdf
|
320
|
-
- spec/extensions/encoding_helpers.rb
|
321
|
-
- spec/prawn/document/bounding_box_spec.rb
|
322
|
-
- spec/prawn/document/column_box_spec.rb
|
323
|
-
- spec/prawn/document/security_spec.rb
|
324
|
-
- spec/prawn/document_annotations_spec.rb
|
325
|
-
- spec/prawn/document_destinations_spec.rb
|
326
|
-
- spec/prawn/document_grid_spec.rb
|
327
|
-
- spec/prawn/document_reference_spec.rb
|
328
|
-
- spec/prawn/document_span_spec.rb
|
329
|
-
- spec/prawn/document_spec.rb
|
330
|
-
- spec/prawn/font_metric_cache_spec.rb
|
331
|
-
- spec/prawn/font_spec.rb
|
332
|
-
- spec/prawn/graphics/blend_mode_spec.rb
|
333
|
-
- spec/prawn/graphics/transparency_spec.rb
|
334
|
-
- spec/prawn/graphics_spec.rb
|
335
|
-
- spec/prawn/graphics_stroke_styles_spec.rb
|
336
|
-
- spec/prawn/image_handler_spec.rb
|
337
|
-
- spec/prawn/images/jpg_spec.rb
|
338
|
-
- spec/prawn/images/png_spec.rb
|
339
|
-
- spec/prawn/images_spec.rb
|
340
|
-
- spec/prawn/measurements_extensions_spec.rb
|
341
|
-
- spec/prawn/outline_spec.rb
|
342
|
-
- spec/prawn/repeater_spec.rb
|
343
|
-
- spec/prawn/soft_mask_spec.rb
|
344
|
-
- spec/prawn/stamp_spec.rb
|
345
|
-
- spec/prawn/text/box_spec.rb
|
346
|
-
- spec/prawn/text/formatted/arranger_spec.rb
|
347
|
-
- spec/prawn/text/formatted/box_spec.rb
|
348
|
-
- spec/prawn/text/formatted/fragment_spec.rb
|
349
|
-
- spec/prawn/text/formatted/line_wrap_spec.rb
|
350
|
-
- spec/prawn/text/formatted/parser_spec.rb
|
351
|
-
- spec/prawn/text_draw_text_spec.rb
|
352
|
-
- spec/prawn/text_rendering_mode_spec.rb
|
353
|
-
- spec/prawn/text_spacing_spec.rb
|
354
|
-
- spec/prawn/text_spec.rb
|
355
|
-
- spec/prawn/text_with_inline_formatting_spec.rb
|
356
|
-
- spec/prawn/transformation_stack_spec.rb
|
357
|
-
- spec/prawn/view_spec.rb
|
358
|
-
- spec/prawn_manual_spec.rb
|
359
|
-
- spec/spec_helper.rb
|
360
|
-
homepage: http://prawnpdf.org
|
231
|
+
homepage: http://prawnpdf.org/
|
361
232
|
licenses:
|
362
|
-
-
|
363
|
-
- GPL-2.0
|
364
|
-
- GPL-3.0
|
365
|
-
metadata:
|
233
|
+
- Nonstandard
|
234
|
+
- GPL-2.0-only
|
235
|
+
- GPL-3.0-only
|
236
|
+
metadata:
|
237
|
+
rubygems_mfa_required: 'true'
|
238
|
+
homepage_uri: http://prawnpdf.org/
|
239
|
+
changelog_uri: https://github.com/prawnpdf/prawn/blob/2.5.0/CHANGELOG.md
|
240
|
+
source_code_uri: https://github.com/prawnpdf/prawn
|
241
|
+
documentation_uri: https://prawnpdf.org/docs/prawn/2.5.0/
|
242
|
+
bug_tracker_uri: https://github.com/prawnpdf/prawn/issues
|
366
243
|
post_install_message:
|
367
244
|
rdoc_options: []
|
368
245
|
require_paths:
|
@@ -371,14 +248,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
371
248
|
requirements:
|
372
249
|
- - ">="
|
373
250
|
- !ruby/object:Gem::Version
|
374
|
-
version: '2.
|
251
|
+
version: '2.7'
|
375
252
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
376
253
|
requirements:
|
377
254
|
- - ">="
|
378
255
|
- !ruby/object:Gem::Version
|
379
256
|
version: 1.3.6
|
380
257
|
requirements: []
|
381
|
-
rubygems_version: 3.
|
258
|
+
rubygems_version: 3.5.3
|
382
259
|
signing_key:
|
383
260
|
specification_version: 4
|
384
261
|
summary: A fast and nimble PDF generator for Ruby
|
metadata.gz.sig
CHANGED
Binary file
|
data/.yardopts
DELETED
data/Gemfile
DELETED
data/Rakefile
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
GEMSPEC = File.expand_path('prawn.gemspec', __dir__)
|
4
|
-
require 'prawn/dev/tasks'
|
5
|
-
|
6
|
-
task default: %i[spec rubocop]
|
7
|
-
|
8
|
-
desc "Generate the 'Prawn by Example' manual"
|
9
|
-
task :manual do
|
10
|
-
puts 'Building manual...'
|
11
|
-
require File.expand_path(File.join(__dir__, %w[manual contents]))
|
12
|
-
prawn_manual_document.render_file('manual.pdf')
|
13
|
-
puts 'The Prawn manual is available at manual.pdf. Happy Prawning!'
|
14
|
-
end
|
15
|
-
|
16
|
-
desc 'Run a console with Prawn loaded'
|
17
|
-
task :console do
|
18
|
-
require 'irb'
|
19
|
-
require 'irb/completion'
|
20
|
-
require_relative 'lib/prawn'
|
21
|
-
Prawn.debug = true
|
22
|
-
|
23
|
-
ARGV.clear
|
24
|
-
IRB.start
|
25
|
-
end
|
Binary file
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# A PDF document is a collection of pages. When we create a new document be it
|
4
|
-
# with <code>Document.new</code> or on a <code>Document.generate</code> block
|
5
|
-
# one initial page is created for us.
|
6
|
-
#
|
7
|
-
# Some methods might create new pages automatically like <code>text</code> which
|
8
|
-
# will create a new page whenever the text string cannot fit on the current
|
9
|
-
# page.
|
10
|
-
#
|
11
|
-
# But what if you want to go to the next page by yourself? That is easy.
|
12
|
-
#
|
13
|
-
# Just use the <code>start_new_page</code> method and a shiny new page will be
|
14
|
-
# created for you just like in the following snippet.
|
15
|
-
|
16
|
-
require_relative '../example_helper'
|
17
|
-
|
18
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
19
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
20
|
-
text "We are still on the initial page for this example. Now I'll ask " \
|
21
|
-
'Prawn to gently start a new page. Please follow me to the next page.'
|
22
|
-
|
23
|
-
start_new_page
|
24
|
-
|
25
|
-
text "See. We've left the previous page behind."
|
26
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Examples for Prawn basic concepts.
|
4
|
-
#
|
5
|
-
|
6
|
-
require_relative '../example_helper'
|
7
|
-
|
8
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
9
|
-
Prawn::ManualBuilder::Example.generate(filename, page_size: 'FOLIO') do
|
10
|
-
package 'basic_concepts' do |p|
|
11
|
-
p.example 'creation', eval_source: false, full_source: true
|
12
|
-
p.example 'origin'
|
13
|
-
p.example 'cursor'
|
14
|
-
p.example 'other_cursor_helpers'
|
15
|
-
p.example 'adding_pages'
|
16
|
-
p.example 'measurement'
|
17
|
-
p.example 'view', eval_source: false, full_source: true
|
18
|
-
|
19
|
-
p.intro do
|
20
|
-
prose <<-TEXT
|
21
|
-
This chapter covers the minimum amount of functionality you'll need to
|
22
|
-
start using Prawn.
|
23
|
-
|
24
|
-
If you are new to Prawn this is the first chapter to read. Once you are
|
25
|
-
comfortable with the concepts shown here you might want to check the
|
26
|
-
Basics section of the Graphics, Bounding Box and Text sections.
|
27
|
-
|
28
|
-
The examples show:
|
29
|
-
TEXT
|
30
|
-
|
31
|
-
list(
|
32
|
-
'How to create new pdf documents in every possible way',
|
33
|
-
'Where the origin for the document coordinates is. What are Bounding '\
|
34
|
-
'Boxes and how they interact with the origin',
|
35
|
-
'How the cursor behaves',
|
36
|
-
'How to start new pages',
|
37
|
-
'What the base unit for measurement and coordinates is and how to use '\
|
38
|
-
'other convenient measures',
|
39
|
-
"How to build custom view objects that use Prawn's DSL"
|
40
|
-
)
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
@@ -1,38 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# There are three ways to create a PDF Document in Prawn: creating a new
|
4
|
-
# <code>Prawn::Document</code> instance, or using the
|
5
|
-
# <code>Prawn::Document.generate</code> method with and without block arguments.
|
6
|
-
#
|
7
|
-
# The following snippet showcase each way by creating a simple document with
|
8
|
-
# some text drawn.
|
9
|
-
#
|
10
|
-
# When we instantiate the <code>Prawn::Document</code> object the actual pdf
|
11
|
-
# document will only be created after we call <code>render_file</code>.
|
12
|
-
#
|
13
|
-
# The generate method will render the actual pdf object after exiting the block.
|
14
|
-
# When we use it without a block argument the provided block is evaluated in the
|
15
|
-
# context of a newly created <code>Prawn::Document</code> instance. When we use
|
16
|
-
# it with a block argument a <code>Prawn::Document</code> instance is created
|
17
|
-
# and passed to the block.
|
18
|
-
#
|
19
|
-
# The generate method without block arguments requires
|
20
|
-
# less typing and defines and renders the pdf document in one shot.
|
21
|
-
# Almost all of the examples are coded this way.
|
22
|
-
|
23
|
-
require_relative '../example_helper'
|
24
|
-
|
25
|
-
# Assignment
|
26
|
-
pdf = Prawn::Document.new
|
27
|
-
pdf.text 'Hello World'
|
28
|
-
pdf.render_file 'assignment.pdf'
|
29
|
-
|
30
|
-
# Implicit Block
|
31
|
-
Prawn::Document.generate('implicit.pdf') do
|
32
|
-
text 'Hello World'
|
33
|
-
end
|
34
|
-
|
35
|
-
# Explicit Block
|
36
|
-
Prawn::Document.generate('explicit.pdf') do |pdf|
|
37
|
-
pdf.text 'Hello World'
|
38
|
-
end
|
@@ -1,32 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# We normally write our documents from top to bottom and it is no different with
|
4
|
-
# Prawn. Even if the origin is on the bottom left corner we still fill the page
|
5
|
-
# from the top to the bottom. In other words the cursor for inserting content
|
6
|
-
# starts on the top of the page.
|
7
|
-
#
|
8
|
-
# Most of the functions that insert content on the page will start at the
|
9
|
-
# current cursor position and proceed to the bottom of the page.
|
10
|
-
#
|
11
|
-
# The following snippet shows how the cursor behaves when we add some text to
|
12
|
-
# the page and demonstrates some of the helpers to manage the cursor position.
|
13
|
-
# The <code>cursor</code> method returns the current cursor position.
|
14
|
-
|
15
|
-
require_relative '../example_helper'
|
16
|
-
|
17
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
18
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
19
|
-
stroke_axis
|
20
|
-
|
21
|
-
text "the cursor is here: #{cursor}"
|
22
|
-
text "now it is here: #{cursor}"
|
23
|
-
|
24
|
-
move_down 200
|
25
|
-
text "on the first move the cursor went down to: #{cursor}"
|
26
|
-
|
27
|
-
move_up 100
|
28
|
-
text "on the second move the cursor went up to: #{cursor}"
|
29
|
-
|
30
|
-
move_cursor_to 50
|
31
|
-
text "on the last move the cursor went directly to: #{cursor}"
|
32
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# The base unit in Prawn is the PDF Point. One PDF Point is equal to 1/72 of
|
4
|
-
# an inch.
|
5
|
-
#
|
6
|
-
# There is no need to waste time converting this measure. Prawn provides
|
7
|
-
# helpers for converting from other measurements
|
8
|
-
# to PDF Points.
|
9
|
-
#
|
10
|
-
# Just <code>require "prawn/measurement_extensions"</code> and it will mix some
|
11
|
-
# helpers onto <code>Numeric</code> for converting common measurement units to
|
12
|
-
# PDF Points.
|
13
|
-
|
14
|
-
require_relative '../example_helper'
|
15
|
-
|
16
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
17
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
18
|
-
require 'prawn/measurement_extensions'
|
19
|
-
|
20
|
-
%i[mm cm dm m in yd ft].each do |measurement|
|
21
|
-
text "1 #{measurement} in PDF Points: #{1.public_send(measurement)} pt"
|
22
|
-
move_down 5.mm
|
23
|
-
end
|
24
|
-
end
|
@@ -1,37 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# This is the most important concept you need to learn about Prawn:
|
4
|
-
#
|
5
|
-
# PDF documents have the origin <code>[0,0]</code> at the bottom-left corner of
|
6
|
-
# the page.
|
7
|
-
#
|
8
|
-
# A bounding box is a structure which provides boundaries for inserting content.
|
9
|
-
# A bounding box also has the property of relocating the origin to its relative
|
10
|
-
# bottom-left corner. However, be aware that the location specified when
|
11
|
-
# creating a bounding box is its top-left corner, not bottom-left (hence the
|
12
|
-
# <code>[100, 300]</code> coordinates below).
|
13
|
-
#
|
14
|
-
# Even if you never create a bounding box explictly, each document already comes
|
15
|
-
# with one called the margin box. This initial bounding box is the one
|
16
|
-
# responsible for the document margins.
|
17
|
-
#
|
18
|
-
# So practically speaking the origin of a page on a default generated document
|
19
|
-
# isn't the absolute bottom left corner but the bottom left corner of the margin
|
20
|
-
# box.
|
21
|
-
#
|
22
|
-
# The following snippet strokes a circle on the margin box origin. Then strokes
|
23
|
-
# the boundaries of a bounding box and a circle on its origin.
|
24
|
-
|
25
|
-
require_relative '../example_helper'
|
26
|
-
|
27
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
28
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
29
|
-
stroke_axis
|
30
|
-
|
31
|
-
stroke_circle [0, 0], 10
|
32
|
-
|
33
|
-
bounding_box([100, 300], width: 300, height: 200) do
|
34
|
-
stroke_bounds
|
35
|
-
stroke_circle [0, 0], 10
|
36
|
-
end
|
37
|
-
end
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
# Another group of helpers for changing the cursor position are the pad methods.
|
4
|
-
# They accept a numeric value and a block. <code>pad</code> will use the numeric
|
5
|
-
# value to move the cursor down both before and after the block content.
|
6
|
-
# <code>pad_top</code> will only move the cursor before the block while
|
7
|
-
# <code>pad_bottom</code> will only move after.
|
8
|
-
#
|
9
|
-
# <code>float</code> is a method for not changing the cursor. Pass it a block
|
10
|
-
# and the cursor will remain on the same place when the block returns.
|
11
|
-
|
12
|
-
require_relative '../example_helper'
|
13
|
-
|
14
|
-
filename = File.basename(__FILE__).gsub('.rb', '.pdf')
|
15
|
-
Prawn::ManualBuilder::Example.generate(filename) do
|
16
|
-
stroke_horizontal_rule
|
17
|
-
pad(20) { text 'Text padded both before and after.' }
|
18
|
-
|
19
|
-
stroke_horizontal_rule
|
20
|
-
pad_top(20) { text 'Text padded on the top.' }
|
21
|
-
|
22
|
-
stroke_horizontal_rule
|
23
|
-
pad_bottom(20) { text 'Text padded on the bottom.' }
|
24
|
-
|
25
|
-
stroke_horizontal_rule
|
26
|
-
move_down 30
|
27
|
-
|
28
|
-
text 'Text written before the float block.'
|
29
|
-
|
30
|
-
float do
|
31
|
-
move_down 30
|
32
|
-
bounding_box([0, cursor], width: 200) do
|
33
|
-
text 'Text written inside the float block.'
|
34
|
-
stroke_bounds
|
35
|
-
end
|
36
|
-
end
|
37
|
-
|
38
|
-
text 'Text written after the float block.'
|
39
|
-
end
|