thinreports 0.10.2 → 0.12.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CONTRIBUTING.md +2 -2
  3. data/.github/dependabot.yml +11 -0
  4. data/.github/workflows/test.yml +50 -0
  5. data/.gitignore +1 -0
  6. data/CHANGELOG.md +43 -0
  7. data/Gemfile +2 -1
  8. data/{MIT-LICENSE → LICENSE.txt} +2 -0
  9. data/README.md +70 -56
  10. data/Rakefile +12 -25
  11. data/gemfiles/prawn-2.2.gemfile +5 -0
  12. data/gemfiles/prawn-2.3.gemfile +5 -0
  13. data/gemfiles/prawn-2.4.gemfile +5 -0
  14. data/lib/thinreports/core/shape/basic/format.rb +5 -0
  15. data/lib/thinreports/core/shape/image_block.rb +1 -1
  16. data/lib/thinreports/core/shape/list.rb +1 -1
  17. data/lib/thinreports/core/shape/page_number.rb +1 -1
  18. data/lib/thinreports/core/shape/stack_view/format.rb +27 -0
  19. data/lib/thinreports/core/shape/stack_view/interface.rb +17 -0
  20. data/lib/thinreports/core/shape/stack_view/internal.rb +22 -0
  21. data/lib/thinreports/core/shape/stack_view/row_format.rb +39 -0
  22. data/lib/thinreports/core/shape/stack_view.rb +17 -0
  23. data/lib/thinreports/core/shape/style/basic.rb +4 -1
  24. data/lib/thinreports/core/shape/text.rb +1 -1
  25. data/lib/thinreports/core/shape/text_block/formatter/number.rb +6 -1
  26. data/lib/thinreports/core/shape/text_block/internal.rb +0 -2
  27. data/lib/thinreports/core/shape/text_block.rb +1 -1
  28. data/lib/thinreports/core/shape.rb +2 -0
  29. data/lib/thinreports/generate.rb +11 -0
  30. data/lib/thinreports/generator/pdf/document/draw_shape.rb +31 -10
  31. data/lib/thinreports/generator/pdf/document/draw_template_items.rb +1 -1
  32. data/lib/thinreports/generator/pdf/document/graphics/image.rb +19 -1
  33. data/lib/thinreports/generator/pdf/document/graphics/text.rb +10 -5
  34. data/lib/thinreports/generator/pdf/document/page.rb +12 -0
  35. data/lib/thinreports/generator/pdf/prawn_ext/width_of.rb +7 -7
  36. data/lib/thinreports/layout/base.rb +1 -1
  37. data/lib/thinreports/layout/legacy_schema.rb +1 -0
  38. data/lib/thinreports/layout/version.rb +1 -1
  39. data/lib/thinreports/report/internal.rb +2 -0
  40. data/lib/thinreports/report.rb +2 -2
  41. data/lib/thinreports/section_report/build.rb +32 -0
  42. data/lib/thinreports/section_report/builder/item_builder.rb +49 -0
  43. data/lib/thinreports/section_report/builder/report_builder.rb +82 -0
  44. data/lib/thinreports/section_report/builder/report_data.rb +13 -0
  45. data/lib/thinreports/section_report/builder/stack_view_builder.rb +53 -0
  46. data/lib/thinreports/section_report/builder/stack_view_data.rb +11 -0
  47. data/lib/thinreports/section_report/generate.rb +26 -0
  48. data/lib/thinreports/section_report/pdf/render.rb +23 -0
  49. data/lib/thinreports/section_report/pdf/renderer/draw_item.rb +68 -0
  50. data/lib/thinreports/section_report/pdf/renderer/group_renderer.rb +57 -0
  51. data/lib/thinreports/section_report/pdf/renderer/section_height.rb +100 -0
  52. data/lib/thinreports/section_report/pdf/renderer/section_renderer.rb +39 -0
  53. data/lib/thinreports/section_report/pdf/renderer/stack_view_renderer.rb +55 -0
  54. data/lib/thinreports/section_report/pdf/renderer/stack_view_row_renderer.rb +38 -0
  55. data/lib/thinreports/section_report/schema/loader.rb +28 -0
  56. data/lib/thinreports/section_report/schema/parser.rb +52 -0
  57. data/lib/thinreports/section_report/schema/report.rb +30 -0
  58. data/lib/thinreports/section_report/schema/section.rb +47 -0
  59. data/lib/thinreports/version.rb +1 -1
  60. data/lib/thinreports.rb +5 -0
  61. data/thinreports.gemspec +11 -10
  62. metadata +48 -150
  63. data/.travis.yml +0 -16
  64. data/examples/character_spacing/character_spacing.rb +0 -8
  65. data/examples/character_spacing/character_spacing.tlf +0 -293
  66. data/examples/dynamic_image/dynamic_image.rb +0 -31
  67. data/examples/dynamic_image/dynamic_image.tlf +0 -661
  68. data/examples/dynamic_image/img200x100.png +0 -0
  69. data/examples/dynamic_image/img50x50.png +0 -0
  70. data/examples/dynamic_style/dynamic_style.rb +0 -150
  71. data/examples/dynamic_style/dynamic_style.tlf +0 -1835
  72. data/examples/dynamic_style/dynamic_style_in_list.tlf +0 -344
  73. data/examples/dynamic_style/image.png +0 -0
  74. data/examples/eudc/eudc.rb +0 -20
  75. data/examples/eudc/eudc.tlf +0 -180
  76. data/examples/eudc/eudc.ttf +0 -0
  77. data/examples/helper.rb +0 -50
  78. data/examples/hidden_shapes/hidden_shapes.rb +0 -9
  79. data/examples/hidden_shapes/hidden_shapes.tlf +0 -449
  80. data/examples/list_events/list_events.rb +0 -32
  81. data/examples/list_events/list_events.tlf +0 -361
  82. data/examples/list_manual_generation/list_manual_generation.rb +0 -22
  83. data/examples/list_manual_generation/list_manual_generation.tlf +0 -132
  84. data/examples/list_page_number/list_page_number.rb +0 -17
  85. data/examples/list_page_number/list_page_number.tlf +0 -254
  86. data/examples/page_number/page_number.rb +0 -33
  87. data/examples/page_number/page_number.tlf +0 -215
  88. data/examples/palleted_png/palleted_png.png +0 -0
  89. data/examples/palleted_png/palleted_png.rb +0 -9
  90. data/examples/palleted_png/palleted_png.tlf +0 -47
  91. data/examples/password_setting/password_setting.rb +0 -10
  92. data/examples/password_setting/password_setting.tlf +0 -45
  93. data/examples/report_callbacks/report_callbacks.rb +0 -14
  94. data/examples/report_callbacks/report_callbacks.tlf +0 -147
  95. data/examples/single_line_tblock/single_line_tblock.rb +0 -13
  96. data/examples/single_line_tblock/single_line_tblock.tlf +0 -170
  97. data/examples/tblock_overflow/tblock_overflow.rb +0 -20
  98. data/examples/tblock_overflow/tblock_overflow.tlf +0 -538
  99. data/examples/tblock_styles/font_size.tlf +0 -383
  100. data/examples/tblock_styles/tblock_styles.rb +0 -43
  101. data/examples/tblock_styles/tblock_styles.tlf +0 -889
  102. data/examples/text_align/text_align.rb +0 -8
  103. data/examples/text_align/text_align.tlf +0 -241
  104. data/examples/typeB_page_size/B4_ISO.tlf +0 -45
  105. data/examples/typeB_page_size/B4_JIS.tlf +0 -45
  106. data/examples/typeB_page_size/typeB_page_size.rb +0 -17
  107. data/examples/word_wrap/word_wrap.rb +0 -26
  108. data/examples/word_wrap/word_wrap.tlf +0 -297
  109. data/test/data/font.ttf +0 -0
  110. data/test/data/image_normal.jpg +0 -0
  111. data/test/data/image_normal.png +0 -0
  112. data/test/data/image_normal_jpg_noext +0 -0
  113. data/test/data/image_normal_png_noext +0 -0
  114. data/test/data/image_pallete_based.png +0 -0
  115. data/test/data/legacy_layout/all-items.tlf +0 -1
  116. data/test/schema_helper.rb +0 -122
  117. data/test/test_helper.rb +0 -48
  118. data/test/tmp/.gitkeep +0 -0
  119. data/test/unit/core/format/test_base.rb +0 -152
  120. data/test/unit/core/shape/base/test_internal.rb +0 -87
  121. data/test/unit/core/shape/basic/test_block_format.rb +0 -23
  122. data/test/unit/core/shape/basic/test_block_interface.rb +0 -29
  123. data/test/unit/core/shape/basic/test_block_internal.rb +0 -55
  124. data/test/unit/core/shape/basic/test_format.rb +0 -37
  125. data/test/unit/core/shape/basic/test_interface.rb +0 -108
  126. data/test/unit/core/shape/basic/test_internal.rb +0 -55
  127. data/test/unit/core/shape/image_block/test_interface.rb +0 -24
  128. data/test/unit/core/shape/image_block/test_internal.rb +0 -31
  129. data/test/unit/core/shape/list/test_format.rb +0 -111
  130. data/test/unit/core/shape/list/test_manager.rb +0 -67
  131. data/test/unit/core/shape/list/test_page.rb +0 -156
  132. data/test/unit/core/shape/list/test_page_state.rb +0 -31
  133. data/test/unit/core/shape/list/test_section_format.rb +0 -36
  134. data/test/unit/core/shape/list/test_section_interface.rb +0 -75
  135. data/test/unit/core/shape/list/test_section_internal.rb +0 -50
  136. data/test/unit/core/shape/manager/test_format.rb +0 -38
  137. data/test/unit/core/shape/manager/test_internal.rb +0 -132
  138. data/test/unit/core/shape/manager/test_target.rb +0 -140
  139. data/test/unit/core/shape/page_number/test_format.rb +0 -55
  140. data/test/unit/core/shape/page_number/test_interface.rb +0 -33
  141. data/test/unit/core/shape/page_number/test_internal.rb +0 -81
  142. data/test/unit/core/shape/styles/test_base.rb +0 -191
  143. data/test/unit/core/shape/styles/test_basic.rb +0 -24
  144. data/test/unit/core/shape/styles/test_graphic.rb +0 -50
  145. data/test/unit/core/shape/styles/test_text.rb +0 -97
  146. data/test/unit/core/shape/text/test_format.rb +0 -44
  147. data/test/unit/core/shape/text/test_internal.rb +0 -20
  148. data/test/unit/core/shape/text_block/formatter/test_basic.rb +0 -24
  149. data/test/unit/core/shape/text_block/formatter/test_datetime.rb +0 -49
  150. data/test/unit/core/shape/text_block/formatter/test_number.rb +0 -76
  151. data/test/unit/core/shape/text_block/formatter/test_padding.rb +0 -77
  152. data/test/unit/core/shape/text_block/test_format.rb +0 -169
  153. data/test/unit/core/shape/text_block/test_formatter.rb +0 -28
  154. data/test/unit/core/shape/text_block/test_interface.rb +0 -63
  155. data/test/unit/core/shape/text_block/test_internal.rb +0 -128
  156. data/test/unit/core/test_shape.rb +0 -52
  157. data/test/unit/core/test_utils.rb +0 -68
  158. data/test/unit/generator/pdf/document/graphics/test_attributes.rb +0 -135
  159. data/test/unit/generator/pdf/document/graphics/test_basic.rb +0 -46
  160. data/test/unit/generator/pdf/document/graphics/test_image.rb +0 -46
  161. data/test/unit/generator/pdf/document/graphics/test_text.rb +0 -171
  162. data/test/unit/generator/pdf/document/test_font.rb +0 -110
  163. data/test/unit/generator/pdf/document/test_graphics.rb +0 -42
  164. data/test/unit/generator/pdf/document/test_page.rb +0 -122
  165. data/test/unit/generator/pdf/document/test_parse_color.rb +0 -30
  166. data/test/unit/generator/pdf/prawn_ext/test_calc_image_dimensions.rb +0 -41
  167. data/test/unit/generator/pdf/prawn_ext/test_width_of.rb +0 -22
  168. data/test/unit/generator/pdf/test_document.rb +0 -22
  169. data/test/unit/generator/test_pdf.rb +0 -26
  170. data/test/unit/layout/test_base.rb +0 -41
  171. data/test/unit/layout/test_format.rb +0 -100
  172. data/test/unit/layout/test_legacy_schema.rb +0 -574
  173. data/test/unit/layout/test_version.rb +0 -26
  174. data/test/unit/report/test_base.rb +0 -248
  175. data/test/unit/report/test_internal.rb +0 -206
  176. data/test/unit/test_config.rb +0 -36
  177. data/test/unit/test_layout.rb +0 -12
  178. data/test/unit/test_report.rb +0 -18
@@ -1,254 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "default",
6
- "type": "list",
7
- "display": true,
8
- "description": "",
9
- "x": 20,
10
- "y": 109,
11
- "width": 555.2,
12
- "height": 390.2,
13
- "header": {
14
- "enabled": true,
15
- "height": 58.1,
16
- "translate": {
17
- "x": 0,
18
- "y": 0
19
- },
20
- "items": [
21
- {
22
- "id": "",
23
- "type": "line",
24
- "display": true,
25
- "description": "",
26
- "style": {
27
- "border-color": "#000000",
28
- "border-width": 1,
29
- "border-style": "solid"
30
- },
31
- "x1": 20,
32
- "y1": 167.1,
33
- "x2": 575.2,
34
- "y2": 167.1
35
- },
36
- {
37
- "id": "",
38
- "type": "text",
39
- "display": true,
40
- "description": "",
41
- "x": 197.6,
42
- "y": 125.6,
43
- "width": 200,
44
- "height": 25.1,
45
- "style": {
46
- "font-family": [
47
- "Helvetica"
48
- ],
49
- "font-size": 18,
50
- "color": "#000000",
51
- "text-align": "center",
52
- "vertical-align": "middle",
53
- "line-height": "",
54
- "line-height-ratio": "",
55
- "letter-spacing": "",
56
- "font-style": []
57
- },
58
- "texts": [
59
- "Header"
60
- ]
61
- }
62
- ]
63
- },
64
- "detail": {
65
- "height": 52.9,
66
- "translate": {
67
- "x": 0,
68
- "y": -19.9
69
- },
70
- "items": [
71
- {
72
- "id": "",
73
- "type": "line",
74
- "display": true,
75
- "description": "",
76
- "style": {
77
- "border-color": "#000000",
78
- "border-width": 1,
79
- "border-style": "solid"
80
- },
81
- "x1": 20,
82
- "y1": 239.9,
83
- "x2": 575.2,
84
- "y2": 239.9
85
- },
86
- {
87
- "id": "",
88
- "type": "text",
89
- "display": true,
90
- "description": "",
91
- "x": 197.6,
92
- "y": 203.6,
93
- "width": 200,
94
- "height": 25.1,
95
- "style": {
96
- "font-family": [
97
- "Helvetica"
98
- ],
99
- "font-size": 18,
100
- "color": "#000000",
101
- "text-align": "center",
102
- "vertical-align": "middle",
103
- "line-height": "",
104
- "line-height-ratio": "",
105
- "letter-spacing": "",
106
- "font-style": []
107
- },
108
- "texts": [
109
- "Detail"
110
- ]
111
- }
112
- ]
113
- },
114
- "page-footer": {
115
- "enabled": false,
116
- "height": 0,
117
- "translate": {
118
- "x": 0,
119
- "y": -45
120
- },
121
- "items": []
122
- },
123
- "footer": {
124
- "enabled": false,
125
- "height": 0,
126
- "translate": {
127
- "x": 0,
128
- "y": -103.5
129
- },
130
- "items": []
131
- },
132
- "content-height": 332.09999999999997,
133
- "auto-page-break": true
134
- },
135
- {
136
- "id": "",
137
- "type": "page-number",
138
- "display": true,
139
- "description": "",
140
- "x": 273.1,
141
- "y": 756.3,
142
- "width": 186,
143
- "height": 17,
144
- "style": {
145
- "font-family": [
146
- "Helvetica"
147
- ],
148
- "font-size": 18,
149
- "color": "#000000",
150
- "text-align": "left",
151
- "letter-spacing": "",
152
- "font-style": [],
153
- "overflow": "truncate"
154
- },
155
- "format": "{page} / {total}",
156
- "target": ""
157
- },
158
- {
159
- "id": "",
160
- "type": "page-number",
161
- "display": true,
162
- "description": "",
163
- "x": 434.1,
164
- "y": 69,
165
- "width": 141.1,
166
- "height": 17,
167
- "style": {
168
- "font-family": [
169
- "Helvetica"
170
- ],
171
- "font-size": 18,
172
- "color": "#000000",
173
- "text-align": "right",
174
- "letter-spacing": "",
175
- "font-style": [],
176
- "overflow": "truncate"
177
- },
178
- "format": "{page} / {total}",
179
- "target": "default"
180
- },
181
- {
182
- "id": "",
183
- "type": "text",
184
- "display": true,
185
- "description": "",
186
- "x": 115,
187
- "y": 755,
188
- "width": 150.1,
189
- "height": 18.5,
190
- "style": {
191
- "font-family": [
192
- "Helvetica"
193
- ],
194
- "font-size": 16,
195
- "color": "#000000",
196
- "text-align": "right",
197
- "vertical-align": "top",
198
- "line-height": "",
199
- "line-height-ratio": "",
200
- "letter-spacing": "",
201
- "font-style": []
202
- },
203
- "texts": [
204
- "Report PageNo:"
205
- ]
206
- },
207
- {
208
- "id": "group_no",
209
- "type": "text-block",
210
- "display": true,
211
- "description": "",
212
- "x": 20,
213
- "y": 69,
214
- "width": 142.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
- "state": {
241
- "layout-guides": []
242
- },
243
- "title": "",
244
- "report": {
245
- "paper-type": "A4",
246
- "orientation": "portrait",
247
- "margin": [
248
- 20,
249
- 20,
250
- 20,
251
- 20
252
- ]
253
- }
254
- }
@@ -1,33 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :page_number, 'Draw page-number automatically each pages' do |t|
4
- # Basic PageNumber
5
- report = Thinreports::Report.new layout: t.layout_filename
6
-
7
- report.start_new_page do |page|
8
- # change visibility
9
- page.item(:pageno).hide
10
- end
11
- report.start_new_page do |page|
12
- # change style
13
- page.item(:pageno).styles(color: 'red',
14
- bold: true,
15
- underline: true,
16
- linethrough: true)
17
- end
18
-
19
- # Do not count as total page count
20
- report.start_new_page count: false
21
-
22
- report.start_new_page count: true
23
-
24
- report.generate filename: t.output_filename
25
-
26
- # PageNumber is started from 5
27
- report = Thinreports::Report.new layout: t.layout_filename
28
- report.start_page_number_from 5
29
-
30
- 10.times { report.start_new_page }
31
-
32
- report.generate filename: t.resource("#{t.name}_from5.pdf")
33
- end
@@ -1,215 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "pageno",
6
- "type": "page-number",
7
- "display": true,
8
- "description": "",
9
- "x": 50,
10
- "y": 205,
11
- "width": 139.1,
12
- "height": 17,
13
- "style": {
14
- "font-family": [
15
- "Helvetica"
16
- ],
17
- "font-size": 18,
18
- "color": "#000000",
19
- "text-align": "center",
20
- "letter-spacing": "",
21
- "font-style": [],
22
- "overflow": "truncate"
23
- },
24
- "format": "{page} / {total}",
25
- "target": ""
26
- },
27
- {
28
- "id": "",
29
- "type": "text",
30
- "display": true,
31
- "description": "",
32
- "x": 20,
33
- "y": 46,
34
- "width": 176.1,
35
- "height": 28,
36
- "style": {
37
- "font-family": [
38
- "Helvetica"
39
- ],
40
- "font-size": 18,
41
- "color": "#000000",
42
- "text-align": "left",
43
- "vertical-align": "top",
44
- "line-height": "",
45
- "line-height-ratio": "",
46
- "letter-spacing": "",
47
- "font-style": []
48
- },
49
- "texts": [
50
- "Basis"
51
- ]
52
- },
53
- {
54
- "id": "",
55
- "type": "text",
56
- "display": true,
57
- "description": "",
58
- "x": 195,
59
- "y": 114,
60
- "width": 199.1,
61
- "height": 17,
62
- "style": {
63
- "font-family": [
64
- "Helvetica"
65
- ],
66
- "font-size": 14,
67
- "color": "#000000",
68
- "text-align": "left",
69
- "vertical-align": "top",
70
- "line-height": "",
71
- "line-height-ratio": "",
72
- "letter-spacing": "",
73
- "font-style": []
74
- },
75
- "texts": [
76
- "(Center Alignment)"
77
- ]
78
- },
79
- {
80
- "id": "",
81
- "type": "text",
82
- "display": true,
83
- "description": "",
84
- "x": 195,
85
- "y": 143,
86
- "width": 199.1,
87
- "height": 17,
88
- "style": {
89
- "font-family": [
90
- "Helvetica"
91
- ],
92
- "font-size": 14,
93
- "color": "#000000",
94
- "text-align": "left",
95
- "vertical-align": "top",
96
- "line-height": "",
97
- "line-height-ratio": "",
98
- "letter-spacing": "",
99
- "font-style": []
100
- },
101
- "texts": [
102
- "(Right Alignment)"
103
- ]
104
- },
105
- {
106
- "id": "",
107
- "type": "text",
108
- "display": true,
109
- "description": "",
110
- "x": 20,
111
- "y": 180,
112
- "width": 176.1,
113
- "height": 28,
114
- "style": {
115
- "font-family": [
116
- "Helvetica"
117
- ],
118
- "font-size": 18,
119
- "color": "#000000",
120
- "text-align": "left",
121
- "vertical-align": "top",
122
- "line-height": "",
123
- "line-height-ratio": "",
124
- "letter-spacing": "",
125
- "font-style": []
126
- },
127
- "texts": [
128
- "With ID"
129
- ]
130
- },
131
- {
132
- "id": "",
133
- "type": "page-number",
134
- "display": true,
135
- "description": "",
136
- "x": 50,
137
- "y": 113,
138
- "width": 130.1,
139
- "height": 17,
140
- "style": {
141
- "font-family": [
142
- "Helvetica"
143
- ],
144
- "font-size": 18,
145
- "color": "#000000",
146
- "text-align": "center",
147
- "letter-spacing": "",
148
- "font-style": [],
149
- "overflow": "truncate"
150
- },
151
- "format": "{page}",
152
- "target": ""
153
- },
154
- {
155
- "id": "",
156
- "type": "page-number",
157
- "display": true,
158
- "description": "",
159
- "x": 50,
160
- "y": 84,
161
- "width": 130.1,
162
- "height": 18.9,
163
- "style": {
164
- "font-family": [
165
- "Helvetica"
166
- ],
167
- "font-size": 18,
168
- "color": "#000000",
169
- "text-align": "left",
170
- "letter-spacing": 10,
171
- "font-style": [],
172
- "overflow": "truncate"
173
- },
174
- "format": "{page}",
175
- "target": ""
176
- },
177
- {
178
- "id": "",
179
- "type": "page-number",
180
- "display": true,
181
- "description": "",
182
- "x": 50,
183
- "y": 140,
184
- "width": 130.1,
185
- "height": 17,
186
- "style": {
187
- "font-family": [
188
- "Helvetica"
189
- ],
190
- "font-size": 18,
191
- "color": "#000000",
192
- "text-align": "right",
193
- "letter-spacing": "",
194
- "font-style": [],
195
- "overflow": "truncate"
196
- },
197
- "format": "{page}",
198
- "target": ""
199
- }
200
- ],
201
- "state": {
202
- "layout-guides": []
203
- },
204
- "title": "",
205
- "report": {
206
- "paper-type": "A4",
207
- "orientation": "portrait",
208
- "margin": [
209
- 20,
210
- 20,
211
- 20,
212
- 20
213
- ]
214
- }
215
- }
Binary file
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :palleted_png, 'Rendering a palleted PNG with transparency' do |t|
4
- report = Thinreports::Report.new layout: t.layout_filename
5
- report.start_new_page do |page|
6
- page.item(:image).src = t.resource('palleted_png.png')
7
- end
8
- report.generate filename: t.output_filename
9
- end
@@ -1,47 +0,0 @@
1
- {
2
- "version": "0.9.0",
3
- "items": [
4
- {
5
- "id": "",
6
- "type": "image",
7
- "display": true,
8
- "description": "",
9
- "x": 20,
10
- "y": 20,
11
- "width": 200,
12
- "height": 200,
13
- "data": {
14
- "mime-type": "image/png",
15
- "base64": "iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAD1BMVEX/AAD/AAD/AAD/AAD////Icf73AAAAA3RSTlO/fz8qtTX3AAAAAWJLR0QEj2jZUQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAMtJREFUeNrtzwERgEAAw7AH/HtGBr2RKGjPM+J8HWDESJyRGiM1RmqM1BipMVJjpMZIjZEaIzVGaozUGKkxUmOkxkiNkRojNUZqjNQYqTFSszMCAAAAAAAAAAAA/3SNMFJjpMZIjZEaIzVGaozUGKkxUmOkxkiNkRojNUZqjNQYqTFSY6TGSI2RGiM1RmqM1Bip2Rm5RxipMVJjpMZIjZEaIzVGaozUGKkxUmOkxkiNkRojNUZqjNQYqTFSY6TGSI2RGiM1RmqM1MyMvMkE6mEsuD8jAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTEwLTA5VDEwOjM1OjI1KzAyOjAwxhRVNQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMC0wOVQxMDozNToyNSswMjowMLdJ7YkAAAAASUVORK5CYII="
16
- }
17
- },
18
- {
19
- "id": "image",
20
- "type": "image-block",
21
- "display": true,
22
- "description": "",
23
- "x": 278.2,
24
- "y": 20,
25
- "width": 266.7,
26
- "height": 223.7,
27
- "style": {
28
- "position-x": "left",
29
- "position-y": "top"
30
- }
31
- }
32
- ],
33
- "state": {
34
- "layout-guides": []
35
- },
36
- "title": "",
37
- "report": {
38
- "paper-type": "A4",
39
- "orientation": "portrait",
40
- "margin": [
41
- 20,
42
- 20,
43
- 20,
44
- 20
45
- ]
46
- }
47
- }
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :password_setting, 'Set password to open' do |t|
4
- report = Thinreports::Report.new layout: t.layout_filename
5
- report.start_new_page
6
- report.generate(filename: t.output_filename, security: {
7
- user_password: 'password',
8
- owner_password: :random
9
- })
10
- end
@@ -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": 197.6,
10
- "y": 137,
11
- "width": 200,
12
- "height": 100,
13
- "style": {
14
- "font-family": [
15
- "Helvetica"
16
- ],
17
- "font-size": 18,
18
- "color": "#000000",
19
- "text-align": "center",
20
- "vertical-align": "top",
21
- "line-height": "",
22
- "line-height-ratio": "",
23
- "letter-spacing": "",
24
- "font-style": []
25
- },
26
- "texts": [
27
- "Password is \"password\""
28
- ]
29
- }
30
- ],
31
- "state": {
32
- "layout-guides": []
33
- },
34
- "title": "",
35
- "report": {
36
- "paper-type": "A4",
37
- "orientation": "portrait",
38
- "margin": [
39
- 20,
40
- 20,
41
- 20,
42
- 20
43
- ]
44
- }
45
- }
@@ -1,14 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- example :report_callbacks, 'Callbacks of Report' do |t|
4
- report = Thinreports::Report.new layout: t.layout_filename
5
-
6
- report.on_page_create do |page|
7
- page.item(:text2).value('Rendered by on_page_create')
8
- end
9
-
10
- report.start_new_page
11
- report.start_new_page
12
-
13
- report.generate filename: t.output_filename
14
- end