thinreports 0.9.1 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.github/workflows/test.yml +39 -0
- data/.gitignore +1 -0
- data/CHANGELOG.md +59 -2
- data/Dockerfile +12 -0
- data/Gemfile +7 -4
- data/README.md +44 -22
- data/Rakefile +14 -31
- data/lib/thinreports.rb +16 -15
- data/lib/thinreports/config.rb +2 -24
- data/lib/thinreports/core/errors.rb +6 -17
- data/lib/thinreports/core/format/base.rb +62 -61
- data/lib/thinreports/core/shape.rb +10 -12
- data/lib/thinreports/core/shape/base.rb +3 -12
- data/lib/thinreports/core/shape/base/interface.rb +34 -32
- data/lib/thinreports/core/shape/base/internal.rb +45 -43
- data/lib/thinreports/core/shape/basic.rb +12 -12
- data/lib/thinreports/core/shape/basic/block_format.rb +8 -6
- data/lib/thinreports/core/shape/basic/block_interface.rb +24 -22
- data/lib/thinreports/core/shape/basic/block_internal.rb +28 -26
- data/lib/thinreports/core/shape/basic/format.rb +11 -9
- data/lib/thinreports/core/shape/basic/interface.rb +79 -77
- data/lib/thinreports/core/shape/basic/internal.rb +17 -14
- data/lib/thinreports/core/shape/image_block.rb +9 -9
- data/lib/thinreports/core/shape/image_block/format.rb +7 -5
- data/lib/thinreports/core/shape/image_block/interface.rb +15 -13
- data/lib/thinreports/core/shape/image_block/internal.rb +10 -8
- data/lib/thinreports/core/shape/list.rb +13 -13
- data/lib/thinreports/core/shape/list/format.rb +83 -77
- data/lib/thinreports/core/shape/list/manager.rb +179 -176
- data/lib/thinreports/core/shape/list/page.rb +91 -93
- data/lib/thinreports/core/shape/list/page_state.rb +42 -40
- data/lib/thinreports/core/shape/list/section_format.rb +28 -26
- data/lib/thinreports/core/shape/list/section_interface.rb +42 -40
- data/lib/thinreports/core/shape/list/section_internal.rb +21 -19
- data/lib/thinreports/core/shape/manager.rb +4 -13
- data/lib/thinreports/core/shape/manager/format.rb +21 -19
- data/lib/thinreports/core/shape/manager/internal.rb +87 -84
- data/lib/thinreports/core/shape/manager/target.rb +93 -95
- data/lib/thinreports/core/shape/page_number.rb +9 -9
- data/lib/thinreports/core/shape/page_number/format.rb +20 -18
- data/lib/thinreports/core/shape/page_number/interface.rb +20 -18
- data/lib/thinreports/core/shape/page_number/internal.rb +46 -44
- data/lib/thinreports/core/shape/style.rb +5 -14
- data/lib/thinreports/core/shape/style/base.rb +121 -120
- data/lib/thinreports/core/shape/style/basic.rb +12 -10
- data/lib/thinreports/core/shape/style/graphic.rb +35 -33
- data/lib/thinreports/core/shape/style/text.rb +113 -107
- data/lib/thinreports/core/shape/text.rb +9 -9
- data/lib/thinreports/core/shape/text/format.rb +10 -9
- data/lib/thinreports/core/shape/text/interface.rb +13 -11
- data/lib/thinreports/core/shape/text/internal.rb +14 -12
- data/lib/thinreports/core/shape/text_block.rb +10 -10
- data/lib/thinreports/core/shape/text_block/format.rb +35 -33
- data/lib/thinreports/core/shape/text_block/formatter.rb +26 -24
- data/lib/thinreports/core/shape/text_block/formatter/basic.rb +25 -25
- data/lib/thinreports/core/shape/text_block/formatter/datetime.rb +15 -12
- data/lib/thinreports/core/shape/text_block/formatter/number.rb +52 -34
- data/lib/thinreports/core/shape/text_block/formatter/padding.rb +17 -14
- data/lib/thinreports/core/shape/text_block/interface.rb +25 -23
- data/lib/thinreports/core/shape/text_block/internal.rb +66 -68
- data/lib/thinreports/core/utils.rb +7 -3
- data/lib/thinreports/generator/pdf.rb +24 -25
- data/lib/thinreports/generator/pdf/document.rb +109 -110
- data/lib/thinreports/generator/pdf/document/draw_shape.rb +57 -51
- data/lib/thinreports/generator/pdf/document/draw_template_items.rb +50 -47
- data/lib/thinreports/generator/pdf/document/font.rb +67 -58
- data/lib/thinreports/generator/pdf/document/graphics.rb +32 -33
- data/lib/thinreports/generator/pdf/document/graphics/attributes.rb +121 -121
- data/lib/thinreports/generator/pdf/document/graphics/basic.rb +112 -114
- data/lib/thinreports/generator/pdf/document/graphics/image.rb +58 -150
- data/lib/thinreports/generator/pdf/document/graphics/text.rb +149 -137
- data/lib/thinreports/generator/pdf/document/page.rb +60 -64
- data/lib/thinreports/generator/pdf/document/parse_color.rb +37 -37
- data/lib/thinreports/generator/pdf/drawer/base.rb +41 -41
- data/lib/thinreports/generator/pdf/drawer/list.rb +56 -54
- data/lib/thinreports/generator/pdf/drawer/list_section.rb +42 -40
- data/lib/thinreports/generator/pdf/drawer/page.rb +101 -96
- data/lib/thinreports/generator/pdf/prawn_ext.rb +4 -30
- data/lib/thinreports/generator/pdf/prawn_ext/calc_image_dimensions.rb +32 -0
- data/lib/thinreports/generator/pdf/prawn_ext/width_of.rb +35 -0
- data/lib/thinreports/layout.rb +5 -7
- data/lib/thinreports/layout/base.rb +5 -9
- data/lib/thinreports/layout/format.rb +17 -13
- data/lib/thinreports/layout/legacy_schema.rb +17 -13
- data/lib/thinreports/layout/version.rb +22 -25
- data/lib/thinreports/report.rb +4 -6
- data/lib/thinreports/report/base.rb +24 -51
- data/lib/thinreports/report/internal.rb +13 -15
- data/lib/thinreports/report/page.rb +5 -11
- data/lib/thinreports/version.rb +2 -2
- data/thinreports.gemspec +10 -19
- metadata +13 -288
- data/.travis.yml +0 -19
- data/examples/character_spacing/character_spacing.rb +0 -8
- data/examples/character_spacing/character_spacing.tlf +0 -293
- data/examples/dynamic_image/dynamic_image.rb +0 -31
- data/examples/dynamic_image/dynamic_image.tlf +0 -661
- data/examples/dynamic_image/img200x100.png +0 -0
- data/examples/dynamic_image/img50x50.png +0 -0
- data/examples/dynamic_style/dynamic_style.rb +0 -150
- data/examples/dynamic_style/dynamic_style.tlf +0 -1835
- data/examples/dynamic_style/dynamic_style_in_list.tlf +0 -344
- data/examples/dynamic_style/image.png +0 -0
- data/examples/eudc/eudc.rb +0 -20
- data/examples/eudc/eudc.tlf +0 -180
- data/examples/eudc/eudc.ttf +0 -0
- data/examples/helper.rb +0 -50
- data/examples/hidden_shapes/hidden_shapes.rb +0 -9
- data/examples/hidden_shapes/hidden_shapes.tlf +0 -449
- data/examples/list_events/list_events.rb +0 -32
- data/examples/list_events/list_events.tlf +0 -361
- data/examples/list_manual_generation/list_manual_generation.rb +0 -22
- data/examples/list_manual_generation/list_manual_generation.tlf +0 -132
- data/examples/list_page_number/list_page_number.rb +0 -17
- data/examples/list_page_number/list_page_number.tlf +0 -254
- data/examples/page_number/page_number.rb +0 -33
- data/examples/page_number/page_number.tlf +0 -215
- data/examples/palleted_png/palleted_png.png +0 -0
- data/examples/palleted_png/palleted_png.rb +0 -11
- data/examples/palleted_png/palleted_png.tlf +0 -47
- data/examples/password_setting/password_setting.rb +0 -10
- data/examples/password_setting/password_setting.tlf +0 -45
- data/examples/report_callbacks/report_callbacks.rb +0 -14
- data/examples/report_callbacks/report_callbacks.tlf +0 -147
- data/examples/single_line_tblock/single_line_tblock.rb +0 -13
- data/examples/single_line_tblock/single_line_tblock.tlf +0 -170
- data/examples/tblock_overflow/tblock_overflow.rb +0 -20
- data/examples/tblock_overflow/tblock_overflow.tlf +0 -538
- data/examples/tblock_styles/font_size.tlf +0 -383
- data/examples/tblock_styles/tblock_styles.rb +0 -43
- data/examples/tblock_styles/tblock_styles.tlf +0 -889
- data/examples/text_align/text_align.rb +0 -8
- data/examples/text_align/text_align.tlf +0 -241
- data/examples/typeB_page_size/B4_ISO.tlf +0 -45
- data/examples/typeB_page_size/B4_JIS.tlf +0 -45
- data/examples/typeB_page_size/typeB_page_size.rb +0 -17
- data/examples/word_wrap/word_wrap.rb +0 -26
- data/examples/word_wrap/word_wrap.tlf +0 -297
- data/lib/thinreports/generator.rb +0 -29
- data/lib/thinreports/generator/base.rb +0 -40
- data/lib/thinreports/generator/configuration.rb +0 -31
- data/lib/thinreports/report/events.rb +0 -32
- data/test/data/font.ttf +0 -0
- data/test/data/image_normal.jpg +0 -0
- data/test/data/image_normal.png +0 -0
- data/test/data/image_normal_jpg_noext +0 -0
- data/test/data/image_normal_png_noext +0 -0
- data/test/data/image_pallete_based.png +0 -0
- data/test/data/legacy_layout/all-items.tlf +0 -1
- data/test/schema_helper.rb +0 -121
- data/test/test_helper.rb +0 -42
- data/test/tmp/.gitkeep +0 -0
- data/test/unit/core/format/test_base.rb +0 -152
- data/test/unit/core/shape/base/test_internal.rb +0 -87
- data/test/unit/core/shape/basic/test_block_format.rb +0 -23
- data/test/unit/core/shape/basic/test_block_interface.rb +0 -29
- data/test/unit/core/shape/basic/test_block_internal.rb +0 -55
- data/test/unit/core/shape/basic/test_format.rb +0 -37
- data/test/unit/core/shape/basic/test_interface.rb +0 -108
- data/test/unit/core/shape/basic/test_internal.rb +0 -55
- data/test/unit/core/shape/image_block/test_interface.rb +0 -24
- data/test/unit/core/shape/image_block/test_internal.rb +0 -31
- data/test/unit/core/shape/list/test_format.rb +0 -111
- data/test/unit/core/shape/list/test_manager.rb +0 -67
- data/test/unit/core/shape/list/test_page.rb +0 -82
- data/test/unit/core/shape/list/test_page_state.rb +0 -31
- data/test/unit/core/shape/list/test_section_format.rb +0 -36
- data/test/unit/core/shape/list/test_section_interface.rb +0 -75
- data/test/unit/core/shape/list/test_section_internal.rb +0 -50
- data/test/unit/core/shape/manager/test_format.rb +0 -38
- data/test/unit/core/shape/manager/test_internal.rb +0 -132
- data/test/unit/core/shape/manager/test_target.rb +0 -140
- data/test/unit/core/shape/page_number/test_format.rb +0 -55
- data/test/unit/core/shape/page_number/test_interface.rb +0 -33
- data/test/unit/core/shape/page_number/test_internal.rb +0 -81
- data/test/unit/core/shape/styles/test_base.rb +0 -191
- data/test/unit/core/shape/styles/test_basic.rb +0 -24
- data/test/unit/core/shape/styles/test_graphic.rb +0 -50
- data/test/unit/core/shape/styles/test_text.rb +0 -97
- data/test/unit/core/shape/text/test_format.rb +0 -44
- data/test/unit/core/shape/text/test_internal.rb +0 -20
- data/test/unit/core/shape/text_block/formatter/test_basic.rb +0 -24
- data/test/unit/core/shape/text_block/formatter/test_datetime.rb +0 -49
- data/test/unit/core/shape/text_block/formatter/test_number.rb +0 -76
- data/test/unit/core/shape/text_block/formatter/test_padding.rb +0 -77
- data/test/unit/core/shape/text_block/test_format.rb +0 -169
- data/test/unit/core/shape/text_block/test_formatter.rb +0 -28
- data/test/unit/core/shape/text_block/test_interface.rb +0 -63
- data/test/unit/core/shape/text_block/test_internal.rb +0 -128
- data/test/unit/core/test_shape.rb +0 -52
- data/test/unit/core/test_utils.rb +0 -68
- data/test/unit/generator/pdf/document/graphics/test_attributes.rb +0 -135
- data/test/unit/generator/pdf/document/graphics/test_basic.rb +0 -45
- data/test/unit/generator/pdf/document/graphics/test_image.rb +0 -150
- data/test/unit/generator/pdf/document/graphics/test_text.rb +0 -171
- data/test/unit/generator/pdf/document/test_font.rb +0 -84
- data/test/unit/generator/pdf/document/test_graphics.rb +0 -42
- data/test/unit/generator/pdf/document/test_page.rb +0 -122
- data/test/unit/generator/pdf/document/test_parse_color.rb +0 -30
- data/test/unit/generator/pdf/test_document.rb +0 -20
- data/test/unit/generator/test_base.rb +0 -40
- data/test/unit/generator/test_configuration.rb +0 -21
- data/test/unit/generator/test_pdf.rb +0 -24
- data/test/unit/layout/test_base.rb +0 -41
- data/test/unit/layout/test_format.rb +0 -100
- data/test/unit/layout/test_legacy_schema.rb +0 -574
- data/test/unit/layout/test_version.rb +0 -95
- data/test/unit/report/test_base.rb +0 -262
- data/test/unit/report/test_internal.rb +0 -206
- data/test/unit/test_config.rb +0 -51
- data/test/unit/test_layout.rb +0 -12
- data/test/unit/test_report.rb +0 -18
@@ -1,241 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "0.9.0",
|
3
|
-
"items": [
|
4
|
-
{
|
5
|
-
"id": "",
|
6
|
-
"type": "text",
|
7
|
-
"display": true,
|
8
|
-
"description": "",
|
9
|
-
"x": 20,
|
10
|
-
"y": 19,
|
11
|
-
"width": 555.2,
|
12
|
-
"height": 84.3,
|
13
|
-
"style": {
|
14
|
-
"font-family": [
|
15
|
-
"Helvetica"
|
16
|
-
],
|
17
|
-
"font-size": 36,
|
18
|
-
"color": "#000000",
|
19
|
-
"text-align": "right",
|
20
|
-
"vertical-align": "top",
|
21
|
-
"line-height": "",
|
22
|
-
"line-height-ratio": "",
|
23
|
-
"letter-spacing": "",
|
24
|
-
"font-style": []
|
25
|
-
},
|
26
|
-
"texts": [
|
27
|
-
"Align Right",
|
28
|
-
"Helvetica"
|
29
|
-
]
|
30
|
-
},
|
31
|
-
{
|
32
|
-
"id": "",
|
33
|
-
"type": "line",
|
34
|
-
"display": true,
|
35
|
-
"description": "",
|
36
|
-
"style": {
|
37
|
-
"border-color": "#000000",
|
38
|
-
"border-width": 1,
|
39
|
-
"border-style": "solid"
|
40
|
-
},
|
41
|
-
"x1": 297.6,
|
42
|
-
"y1": 20,
|
43
|
-
"x2": 297.6,
|
44
|
-
"y2": 821.8
|
45
|
-
},
|
46
|
-
{
|
47
|
-
"id": "",
|
48
|
-
"type": "text",
|
49
|
-
"display": true,
|
50
|
-
"description": "",
|
51
|
-
"x": 20,
|
52
|
-
"y": 105,
|
53
|
-
"width": 555.2,
|
54
|
-
"height": 72,
|
55
|
-
"style": {
|
56
|
-
"font-family": [
|
57
|
-
"IPAMincho"
|
58
|
-
],
|
59
|
-
"font-size": 36,
|
60
|
-
"color": "#000000",
|
61
|
-
"text-align": "right",
|
62
|
-
"vertical-align": "top",
|
63
|
-
"line-height": "",
|
64
|
-
"line-height-ratio": "",
|
65
|
-
"letter-spacing": "",
|
66
|
-
"font-style": []
|
67
|
-
},
|
68
|
-
"texts": [
|
69
|
-
"右寄せ",
|
70
|
-
"IPA明朝"
|
71
|
-
]
|
72
|
-
},
|
73
|
-
{
|
74
|
-
"id": "",
|
75
|
-
"type": "line",
|
76
|
-
"display": true,
|
77
|
-
"description": "",
|
78
|
-
"style": {
|
79
|
-
"border-color": "#000000",
|
80
|
-
"border-width": 1,
|
81
|
-
"border-style": "solid"
|
82
|
-
},
|
83
|
-
"x1": 297.6,
|
84
|
-
"y1": 20,
|
85
|
-
"x2": 297.6,
|
86
|
-
"y2": 821.8
|
87
|
-
},
|
88
|
-
{
|
89
|
-
"id": "",
|
90
|
-
"type": "line",
|
91
|
-
"display": true,
|
92
|
-
"description": "",
|
93
|
-
"style": {
|
94
|
-
"border-color": "#000000",
|
95
|
-
"border-width": 1,
|
96
|
-
"border-style": "solid"
|
97
|
-
},
|
98
|
-
"x1": 575.2,
|
99
|
-
"y1": 20,
|
100
|
-
"x2": 575.2,
|
101
|
-
"y2": 821.8
|
102
|
-
},
|
103
|
-
{
|
104
|
-
"id": "",
|
105
|
-
"type": "text",
|
106
|
-
"display": true,
|
107
|
-
"description": "",
|
108
|
-
"x": 20,
|
109
|
-
"y": 241,
|
110
|
-
"width": 555.2,
|
111
|
-
"height": 84.3,
|
112
|
-
"style": {
|
113
|
-
"font-family": [
|
114
|
-
"Helvetica"
|
115
|
-
],
|
116
|
-
"font-size": 36,
|
117
|
-
"color": "#000000",
|
118
|
-
"text-align": "center",
|
119
|
-
"vertical-align": "top",
|
120
|
-
"line-height": "",
|
121
|
-
"line-height-ratio": "",
|
122
|
-
"letter-spacing": "",
|
123
|
-
"font-style": []
|
124
|
-
},
|
125
|
-
"texts": [
|
126
|
-
"Align Center",
|
127
|
-
"Helvetica"
|
128
|
-
]
|
129
|
-
},
|
130
|
-
{
|
131
|
-
"id": "",
|
132
|
-
"type": "text",
|
133
|
-
"display": true,
|
134
|
-
"description": "",
|
135
|
-
"x": 20,
|
136
|
-
"y": 330,
|
137
|
-
"width": 555.2,
|
138
|
-
"height": 72,
|
139
|
-
"style": {
|
140
|
-
"font-family": [
|
141
|
-
"IPAMincho"
|
142
|
-
],
|
143
|
-
"font-size": 36,
|
144
|
-
"color": "#000000",
|
145
|
-
"text-align": "center",
|
146
|
-
"vertical-align": "top",
|
147
|
-
"line-height": "",
|
148
|
-
"line-height-ratio": "",
|
149
|
-
"letter-spacing": "",
|
150
|
-
"font-style": []
|
151
|
-
},
|
152
|
-
"texts": [
|
153
|
-
"中央寄せ",
|
154
|
-
"IPA明朝"
|
155
|
-
]
|
156
|
-
},
|
157
|
-
{
|
158
|
-
"id": "",
|
159
|
-
"type": "text",
|
160
|
-
"display": true,
|
161
|
-
"description": "",
|
162
|
-
"x": 20,
|
163
|
-
"y": 490,
|
164
|
-
"width": 555.2,
|
165
|
-
"height": 84.3,
|
166
|
-
"style": {
|
167
|
-
"font-family": [
|
168
|
-
"Helvetica"
|
169
|
-
],
|
170
|
-
"font-size": 36,
|
171
|
-
"color": "#000000",
|
172
|
-
"text-align": "left",
|
173
|
-
"vertical-align": "top",
|
174
|
-
"line-height": "",
|
175
|
-
"line-height-ratio": "",
|
176
|
-
"letter-spacing": "",
|
177
|
-
"font-style": []
|
178
|
-
},
|
179
|
-
"texts": [
|
180
|
-
"Align Left",
|
181
|
-
"Helvetica"
|
182
|
-
]
|
183
|
-
},
|
184
|
-
{
|
185
|
-
"id": "",
|
186
|
-
"type": "text",
|
187
|
-
"display": true,
|
188
|
-
"description": "",
|
189
|
-
"x": 20,
|
190
|
-
"y": 580,
|
191
|
-
"width": 555.2,
|
192
|
-
"height": 72,
|
193
|
-
"style": {
|
194
|
-
"font-family": [
|
195
|
-
"IPAMincho"
|
196
|
-
],
|
197
|
-
"font-size": 36,
|
198
|
-
"color": "#000000",
|
199
|
-
"text-align": "left",
|
200
|
-
"vertical-align": "top",
|
201
|
-
"line-height": "",
|
202
|
-
"line-height-ratio": "",
|
203
|
-
"letter-spacing": "",
|
204
|
-
"font-style": []
|
205
|
-
},
|
206
|
-
"texts": [
|
207
|
-
"左寄せ",
|
208
|
-
"IPA明朝"
|
209
|
-
]
|
210
|
-
},
|
211
|
-
{
|
212
|
-
"id": "",
|
213
|
-
"type": "line",
|
214
|
-
"display": true,
|
215
|
-
"description": "",
|
216
|
-
"style": {
|
217
|
-
"border-color": "#000000",
|
218
|
-
"border-width": 1,
|
219
|
-
"border-style": "solid"
|
220
|
-
},
|
221
|
-
"x1": 20,
|
222
|
-
"y1": 20,
|
223
|
-
"x2": 20,
|
224
|
-
"y2": 821.8
|
225
|
-
}
|
226
|
-
],
|
227
|
-
"state": {
|
228
|
-
"layout-guides": []
|
229
|
-
},
|
230
|
-
"title": "Case: Text Align",
|
231
|
-
"report": {
|
232
|
-
"paper-type": "A4",
|
233
|
-
"orientation": "portrait",
|
234
|
-
"margin": [
|
235
|
-
20,
|
236
|
-
20,
|
237
|
-
20,
|
238
|
-
20
|
239
|
-
]
|
240
|
-
}
|
241
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "0.9.0",
|
3
|
-
"items": [
|
4
|
-
{
|
5
|
-
"id": "",
|
6
|
-
"type": "text",
|
7
|
-
"display": true,
|
8
|
-
"description": "",
|
9
|
-
"x": 255,
|
10
|
-
"y": 20,
|
11
|
-
"width": 200,
|
12
|
-
"height": 100,
|
13
|
-
"style": {
|
14
|
-
"font-family": [
|
15
|
-
"Helvetica"
|
16
|
-
],
|
17
|
-
"font-size": 26,
|
18
|
-
"color": "#000000",
|
19
|
-
"text-align": "center",
|
20
|
-
"vertical-align": "middle",
|
21
|
-
"line-height": "",
|
22
|
-
"line-height-ratio": "",
|
23
|
-
"letter-spacing": "",
|
24
|
-
"font-style": []
|
25
|
-
},
|
26
|
-
"texts": [
|
27
|
-
"B4 ISO"
|
28
|
-
]
|
29
|
-
}
|
30
|
-
],
|
31
|
-
"state": {
|
32
|
-
"layout-guides": []
|
33
|
-
},
|
34
|
-
"title": "B4 ISO",
|
35
|
-
"report": {
|
36
|
-
"paper-type": "B4_ISO",
|
37
|
-
"orientation": "portrait",
|
38
|
-
"margin": [
|
39
|
-
20,
|
40
|
-
20,
|
41
|
-
20,
|
42
|
-
20
|
43
|
-
]
|
44
|
-
}
|
45
|
-
}
|
@@ -1,45 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "0.9.0",
|
3
|
-
"items": [
|
4
|
-
{
|
5
|
-
"id": "",
|
6
|
-
"type": "text",
|
7
|
-
"display": true,
|
8
|
-
"description": "",
|
9
|
-
"x": 260,
|
10
|
-
"y": 20,
|
11
|
-
"width": 200,
|
12
|
-
"height": 100,
|
13
|
-
"style": {
|
14
|
-
"font-family": [
|
15
|
-
"Helvetica"
|
16
|
-
],
|
17
|
-
"font-size": 28,
|
18
|
-
"color": "#000000",
|
19
|
-
"text-align": "center",
|
20
|
-
"vertical-align": "middle",
|
21
|
-
"line-height": "",
|
22
|
-
"line-height-ratio": "",
|
23
|
-
"letter-spacing": "",
|
24
|
-
"font-style": []
|
25
|
-
},
|
26
|
-
"texts": [
|
27
|
-
"B4 JIS"
|
28
|
-
]
|
29
|
-
}
|
30
|
-
],
|
31
|
-
"state": {
|
32
|
-
"layout-guides": []
|
33
|
-
},
|
34
|
-
"title": "B4 JIS",
|
35
|
-
"report": {
|
36
|
-
"paper-type": "B4",
|
37
|
-
"orientation": "portrait",
|
38
|
-
"margin": [
|
39
|
-
20,
|
40
|
-
20,
|
41
|
-
20,
|
42
|
-
20
|
43
|
-
]
|
44
|
-
}
|
45
|
-
}
|
@@ -1,17 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
require 'pdf/inspector'
|
4
|
-
|
5
|
-
example :typeB_page_size, 'Generate type B(JIS/ISO) size pages' do |t|
|
6
|
-
report = Thinreports::Report.new layout: t.resource('B4_ISO.tlf')
|
7
|
-
report.start_new_page
|
8
|
-
|
9
|
-
inspector = PDF::Inspector::Page.analyze(report.generate)
|
10
|
-
raise 'Invalid B4 ISO size' unless inspector.pages.first[:size] == [708.66, 1000.63]
|
11
|
-
|
12
|
-
report = Thinreports::Report.new layout: t.resource('B4_JIS.tlf')
|
13
|
-
report.start_new_page
|
14
|
-
|
15
|
-
inspector = PDF::Inspector::Page.analyze(report.generate)
|
16
|
-
raise 'Invalid B4 JIS size' unless inspector.pages.first[:size] == [728.5, 1031.8]
|
17
|
-
end
|
@@ -1,26 +0,0 @@
|
|
1
|
-
# coding: utf-8
|
2
|
-
|
3
|
-
example :word_wrap, 'Word-wrap property of TextBlock' do |t|
|
4
|
-
Thinreports::Report.generate filename: t.output_filename do
|
5
|
-
use_layout t.layout_filename
|
6
|
-
start_new_page
|
7
|
-
|
8
|
-
page.item(:locale).value('ja')
|
9
|
-
|
10
|
-
text = 'Thinreports は Ruby 向けのオープンソース帳票・PDF ツールです。'
|
11
|
-
page.values single_none: text,
|
12
|
-
single_break_word: text,
|
13
|
-
multiple_none: text,
|
14
|
-
multiple_break_word: text
|
15
|
-
|
16
|
-
start_new_page
|
17
|
-
|
18
|
-
page.item(:locale).value('en')
|
19
|
-
|
20
|
-
text = 'Thinreports is the OSS reporting tool for Ruby-lang.'
|
21
|
-
page.values single_none: text,
|
22
|
-
single_break_word: text,
|
23
|
-
multiple_none: text,
|
24
|
-
multiple_break_word: text
|
25
|
-
end
|
26
|
-
end
|
@@ -1,297 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"version": "0.9.0",
|
3
|
-
"items": [
|
4
|
-
{
|
5
|
-
"id": "single_none",
|
6
|
-
"type": "text-block",
|
7
|
-
"display": true,
|
8
|
-
"description": "",
|
9
|
-
"x": 33.1,
|
10
|
-
"y": 101,
|
11
|
-
"width": 210.1,
|
12
|
-
"height": 17,
|
13
|
-
"style": {
|
14
|
-
"font-family": [
|
15
|
-
"Helvetica"
|
16
|
-
],
|
17
|
-
"font-size": 18,
|
18
|
-
"color": "#000000",
|
19
|
-
"text-align": "left",
|
20
|
-
"vertical-align": "top",
|
21
|
-
"line-height": "",
|
22
|
-
"line-height-ratio": "",
|
23
|
-
"letter-spacing": "",
|
24
|
-
"font-style": [],
|
25
|
-
"overflow": "expand",
|
26
|
-
"word-wrap": "break-word"
|
27
|
-
},
|
28
|
-
"reference-id": "",
|
29
|
-
"value": "",
|
30
|
-
"multiple-line": false,
|
31
|
-
"format": {
|
32
|
-
"base": "",
|
33
|
-
"type": ""
|
34
|
-
}
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"id": "multiple_none",
|
38
|
-
"type": "text-block",
|
39
|
-
"display": true,
|
40
|
-
"description": "",
|
41
|
-
"x": 290.2,
|
42
|
-
"y": 101.9,
|
43
|
-
"width": 259.1,
|
44
|
-
"height": 105.1,
|
45
|
-
"style": {
|
46
|
-
"font-family": [
|
47
|
-
"Helvetica"
|
48
|
-
],
|
49
|
-
"font-size": 18,
|
50
|
-
"color": "#000000",
|
51
|
-
"text-align": "left",
|
52
|
-
"vertical-align": "top",
|
53
|
-
"line-height": "",
|
54
|
-
"line-height-ratio": "",
|
55
|
-
"letter-spacing": "",
|
56
|
-
"font-style": [],
|
57
|
-
"overflow": "truncate",
|
58
|
-
"word-wrap": "none"
|
59
|
-
},
|
60
|
-
"reference-id": "",
|
61
|
-
"value": "",
|
62
|
-
"multiple-line": true,
|
63
|
-
"format": {
|
64
|
-
"base": "",
|
65
|
-
"type": ""
|
66
|
-
}
|
67
|
-
},
|
68
|
-
{
|
69
|
-
"id": "",
|
70
|
-
"type": "rect",
|
71
|
-
"display": true,
|
72
|
-
"description": "",
|
73
|
-
"x": 290.2,
|
74
|
-
"y": 101.9,
|
75
|
-
"width": 259.1,
|
76
|
-
"height": 105.1,
|
77
|
-
"style": {
|
78
|
-
"border-color": "#000000",
|
79
|
-
"border-width": 1,
|
80
|
-
"border-style": "solid",
|
81
|
-
"fill-color": "none"
|
82
|
-
},
|
83
|
-
"border-radius": 0
|
84
|
-
},
|
85
|
-
{
|
86
|
-
"id": "multiple_break_word",
|
87
|
-
"type": "text-block",
|
88
|
-
"display": true,
|
89
|
-
"description": "",
|
90
|
-
"x": 290.2,
|
91
|
-
"y": 232.9,
|
92
|
-
"width": 259.1,
|
93
|
-
"height": 105.1,
|
94
|
-
"style": {
|
95
|
-
"font-family": [
|
96
|
-
"Helvetica"
|
97
|
-
],
|
98
|
-
"font-size": 18,
|
99
|
-
"color": "#000000",
|
100
|
-
"text-align": "left",
|
101
|
-
"vertical-align": "top",
|
102
|
-
"line-height": "",
|
103
|
-
"line-height-ratio": "",
|
104
|
-
"letter-spacing": "",
|
105
|
-
"font-style": [],
|
106
|
-
"overflow": "truncate",
|
107
|
-
"word-wrap": "break-word"
|
108
|
-
},
|
109
|
-
"reference-id": "",
|
110
|
-
"value": "",
|
111
|
-
"multiple-line": true,
|
112
|
-
"format": {
|
113
|
-
"base": "",
|
114
|
-
"type": ""
|
115
|
-
}
|
116
|
-
},
|
117
|
-
{
|
118
|
-
"id": "",
|
119
|
-
"type": "rect",
|
120
|
-
"display": true,
|
121
|
-
"description": "",
|
122
|
-
"x": 290.2,
|
123
|
-
"y": 232.9,
|
124
|
-
"width": 259.1,
|
125
|
-
"height": 105.1,
|
126
|
-
"style": {
|
127
|
-
"border-color": "#000000",
|
128
|
-
"border-width": 1,
|
129
|
-
"border-style": "solid",
|
130
|
-
"fill-color": "none"
|
131
|
-
},
|
132
|
-
"border-radius": 0
|
133
|
-
},
|
134
|
-
{
|
135
|
-
"id": "",
|
136
|
-
"type": "line",
|
137
|
-
"display": true,
|
138
|
-
"description": "",
|
139
|
-
"style": {
|
140
|
-
"border-color": "#000000",
|
141
|
-
"border-width": 1,
|
142
|
-
"border-style": "solid"
|
143
|
-
},
|
144
|
-
"x1": 252,
|
145
|
-
"y1": 100,
|
146
|
-
"x2": 252,
|
147
|
-
"y2": 379.1
|
148
|
-
},
|
149
|
-
{
|
150
|
-
"id": "single_break_word",
|
151
|
-
"type": "text-block",
|
152
|
-
"display": true,
|
153
|
-
"description": "",
|
154
|
-
"x": 35,
|
155
|
-
"y": 235,
|
156
|
-
"width": 210.1,
|
157
|
-
"height": 17,
|
158
|
-
"style": {
|
159
|
-
"font-family": [
|
160
|
-
"Helvetica"
|
161
|
-
],
|
162
|
-
"font-size": 18,
|
163
|
-
"color": "#000000",
|
164
|
-
"text-align": "left",
|
165
|
-
"vertical-align": "top",
|
166
|
-
"line-height": "",
|
167
|
-
"line-height-ratio": "",
|
168
|
-
"letter-spacing": "",
|
169
|
-
"font-style": [],
|
170
|
-
"overflow": "expand",
|
171
|
-
"word-wrap": "break-word"
|
172
|
-
},
|
173
|
-
"reference-id": "",
|
174
|
-
"value": "",
|
175
|
-
"multiple-line": false,
|
176
|
-
"format": {
|
177
|
-
"base": "",
|
178
|
-
"type": ""
|
179
|
-
}
|
180
|
-
},
|
181
|
-
{
|
182
|
-
"id": "",
|
183
|
-
"type": "text",
|
184
|
-
"display": true,
|
185
|
-
"description": "",
|
186
|
-
"x": 32.1,
|
187
|
-
"y": 33,
|
188
|
-
"width": 58,
|
189
|
-
"height": 20.5,
|
190
|
-
"style": {
|
191
|
-
"font-family": [
|
192
|
-
"Helvetica"
|
193
|
-
],
|
194
|
-
"font-size": 18,
|
195
|
-
"color": "#000000",
|
196
|
-
"text-align": "left",
|
197
|
-
"vertical-align": "top",
|
198
|
-
"line-height": "",
|
199
|
-
"line-height-ratio": "",
|
200
|
-
"letter-spacing": "",
|
201
|
-
"font-style": []
|
202
|
-
},
|
203
|
-
"texts": [
|
204
|
-
"Locale:"
|
205
|
-
]
|
206
|
-
},
|
207
|
-
{
|
208
|
-
"id": "locale",
|
209
|
-
"type": "text-block",
|
210
|
-
"display": true,
|
211
|
-
"description": "",
|
212
|
-
"x": 100,
|
213
|
-
"y": 36,
|
214
|
-
"width": 145.1,
|
215
|
-
"height": 17,
|
216
|
-
"style": {
|
217
|
-
"font-family": [
|
218
|
-
"Helvetica"
|
219
|
-
],
|
220
|
-
"font-size": 18,
|
221
|
-
"color": "#000000",
|
222
|
-
"text-align": "left",
|
223
|
-
"vertical-align": "top",
|
224
|
-
"line-height": "",
|
225
|
-
"line-height-ratio": "",
|
226
|
-
"letter-spacing": "",
|
227
|
-
"font-style": [],
|
228
|
-
"overflow": "truncate",
|
229
|
-
"word-wrap": "break-word"
|
230
|
-
},
|
231
|
-
"reference-id": "",
|
232
|
-
"value": "",
|
233
|
-
"multiple-line": false,
|
234
|
-
"format": {
|
235
|
-
"base": "",
|
236
|
-
"type": ""
|
237
|
-
}
|
238
|
-
},
|
239
|
-
{
|
240
|
-
"id": "",
|
241
|
-
"type": "rect",
|
242
|
-
"display": true,
|
243
|
-
"description": "",
|
244
|
-
"x": 33.1,
|
245
|
-
"y": 101,
|
246
|
-
"width": 210.1,
|
247
|
-
"height": 17,
|
248
|
-
"style": {
|
249
|
-
"border-color": "#000000",
|
250
|
-
"border-width": 1,
|
251
|
-
"border-style": "solid",
|
252
|
-
"fill-color": "none"
|
253
|
-
},
|
254
|
-
"border-radius": 0
|
255
|
-
},
|
256
|
-
{
|
257
|
-
"id": "",
|
258
|
-
"type": "rect",
|
259
|
-
"display": true,
|
260
|
-
"description": "",
|
261
|
-
"x": 34.1,
|
262
|
-
"y": 235,
|
263
|
-
"width": 210.1,
|
264
|
-
"height": 17,
|
265
|
-
"style": {
|
266
|
-
"border-color": "#000000",
|
267
|
-
"border-width": 1,
|
268
|
-
"border-style": "solid",
|
269
|
-
"fill-color": "none"
|
270
|
-
},
|
271
|
-
"border-radius": 0
|
272
|
-
}
|
273
|
-
],
|
274
|
-
"state": {
|
275
|
-
"layout-guides": [
|
276
|
-
{
|
277
|
-
"type": "x",
|
278
|
-
"position": 59.5
|
279
|
-
},
|
280
|
-
{
|
281
|
-
"type": "y",
|
282
|
-
"position": 61
|
283
|
-
}
|
284
|
-
]
|
285
|
-
},
|
286
|
-
"title": "",
|
287
|
-
"report": {
|
288
|
-
"paper-type": "A4",
|
289
|
-
"orientation": "portrait",
|
290
|
-
"margin": [
|
291
|
-
20,
|
292
|
-
20,
|
293
|
-
20,
|
294
|
-
20
|
295
|
-
]
|
296
|
-
}
|
297
|
-
}
|