prep 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/.document +5 -0
- data/.rspec +1 -0
- data/Gemfile +15 -0
- data/Gemfile.lock +30 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +24 -0
- data/Rakefile +51 -0
- data/VERSION +1 -0
- data/bin/prep-helper +48 -0
- data/bin/prep-test +51 -0
- data/examples/generate_group_sample.rb +4 -0
- data/examples/generate_sample.rb +4 -0
- data/examples/generate_sample2.rb +19 -0
- data/examples/generate_sample3.rb +20 -0
- data/examples/generate_sample4.rb +31 -0
- data/examples/generate_sample5.rb +74 -0
- data/examples/generate_sample6.rb +40 -0
- data/examples/generate_sample_dataset.rb +9 -0
- data/examples/group_sample.yml +121 -0
- data/examples/sample.yml +90 -0
- data/examples/sample2.yml +164 -0
- data/examples/sample3.yml +206 -0
- data/examples/sample5.yml +116 -0
- data/examples/sample6.yml +127 -0
- data/lib/core/color.rb +47 -0
- data/lib/core/drawable.rb +163 -0
- data/lib/core/group.rb +193 -0
- data/lib/core/label.rb +125 -0
- data/lib/core/line.rb +95 -0
- data/lib/core/loop.rb +584 -0
- data/lib/core/page.rb +87 -0
- data/lib/core/page_ext.rb +14 -0
- data/lib/core/point.rb +26 -0
- data/lib/core/prep.rb +351 -0
- data/lib/core/rectangle.rb +137 -0
- data/lib/core/region.rb +54 -0
- data/lib/mm2pixcel.rb +5 -0
- data/lib/prep.rb +175 -0
- data/prep.gemspec +108 -0
- data/spec/component_spec.rb +5 -0
- data/spec/prep_spec.rb +7 -0
- data/spec/spec_helper.rb +12 -0
- metadata +197 -0
@@ -0,0 +1,121 @@
|
|
1
|
+
page:
|
2
|
+
size: a4
|
3
|
+
orientation: portrait
|
4
|
+
margin:
|
5
|
+
top: 40
|
6
|
+
left: 20
|
7
|
+
bottom: 10
|
8
|
+
right: 20
|
9
|
+
header_height: 50
|
10
|
+
footer_height: 40
|
11
|
+
header:
|
12
|
+
type: group
|
13
|
+
header_misc:
|
14
|
+
type: label
|
15
|
+
label: "吉川市 (平成22年12月分) 2011年1月25日"
|
16
|
+
align: right
|
17
|
+
region:
|
18
|
+
x: 300
|
19
|
+
y: 0
|
20
|
+
width: 200
|
21
|
+
height: 40
|
22
|
+
header_title:
|
23
|
+
type: label
|
24
|
+
label: "個別健診 請求金額内訳書"
|
25
|
+
align: left
|
26
|
+
region:
|
27
|
+
x: 0
|
28
|
+
y: 20
|
29
|
+
width: 200
|
30
|
+
height: 20
|
31
|
+
table_header_column01_rect:
|
32
|
+
type: rectangle
|
33
|
+
region:
|
34
|
+
x: 100
|
35
|
+
y: 40
|
36
|
+
width: 100
|
37
|
+
height: 20
|
38
|
+
line_width: 1
|
39
|
+
table_header_column02_rect:
|
40
|
+
type: rectangle
|
41
|
+
region:
|
42
|
+
x: 200
|
43
|
+
y: 40
|
44
|
+
width: 100
|
45
|
+
height: 20
|
46
|
+
line_width: 1
|
47
|
+
table_header_column03_rect:
|
48
|
+
type: rectangle
|
49
|
+
region:
|
50
|
+
x: 300
|
51
|
+
y: 40
|
52
|
+
width: 100
|
53
|
+
height: 20
|
54
|
+
line_width: 1
|
55
|
+
table_header_column01_label:
|
56
|
+
type: label
|
57
|
+
label: "単価"
|
58
|
+
region:
|
59
|
+
x: 100
|
60
|
+
y: 40
|
61
|
+
width: 100
|
62
|
+
height: 20
|
63
|
+
line_width: 1
|
64
|
+
table_header_column02_label:
|
65
|
+
type: label
|
66
|
+
label: "人数"
|
67
|
+
region:
|
68
|
+
x: 200
|
69
|
+
y: 40
|
70
|
+
width: 100
|
71
|
+
height: 20
|
72
|
+
line_width: 1
|
73
|
+
table_header_column03_label:
|
74
|
+
type: label
|
75
|
+
label: "合計"
|
76
|
+
region:
|
77
|
+
x: 300
|
78
|
+
y: 40
|
79
|
+
width: 100
|
80
|
+
height: 20
|
81
|
+
line_width: 1
|
82
|
+
content:
|
83
|
+
type: group
|
84
|
+
title:
|
85
|
+
type: label
|
86
|
+
label: タイトル
|
87
|
+
region:
|
88
|
+
x: 0
|
89
|
+
y: 0
|
90
|
+
width: 100
|
91
|
+
height: 20
|
92
|
+
|
93
|
+
table01_group:
|
94
|
+
type: group
|
95
|
+
table01_header_rect:
|
96
|
+
type: rectangle
|
97
|
+
region:
|
98
|
+
x: 10
|
99
|
+
y: 0
|
100
|
+
width: 400
|
101
|
+
height: 20
|
102
|
+
fill_color:
|
103
|
+
red: 0.7
|
104
|
+
green: 0.7
|
105
|
+
blue: 0.7
|
106
|
+
table01_header_label:
|
107
|
+
type: label
|
108
|
+
region:
|
109
|
+
x: 10
|
110
|
+
y: 3
|
111
|
+
width: 400
|
112
|
+
height: 16
|
113
|
+
label: "生活習慣予防検査"
|
114
|
+
table01_content:
|
115
|
+
type: reference
|
116
|
+
group: table01_content
|
117
|
+
loop: vertical
|
118
|
+
gap: 0
|
119
|
+
table01_content_group:
|
120
|
+
footer:
|
121
|
+
type: group
|
data/examples/sample.yml
ADDED
@@ -0,0 +1,90 @@
|
|
1
|
+
page:
|
2
|
+
size: a4
|
3
|
+
orientation: portrait
|
4
|
+
margin:
|
5
|
+
top: 10
|
6
|
+
left: 10
|
7
|
+
bottom: 10
|
8
|
+
right: 10
|
9
|
+
header_height: 0
|
10
|
+
footer_height: 0
|
11
|
+
content:
|
12
|
+
type: group
|
13
|
+
title:
|
14
|
+
type: label
|
15
|
+
label: "タイトル文字列"
|
16
|
+
region:
|
17
|
+
x: 10
|
18
|
+
y: 10
|
19
|
+
width: 100
|
20
|
+
height: 20
|
21
|
+
color:
|
22
|
+
red: 0
|
23
|
+
green: 0
|
24
|
+
blue: 0
|
25
|
+
line01:
|
26
|
+
type: line
|
27
|
+
start:
|
28
|
+
x: 10
|
29
|
+
y: 10
|
30
|
+
end:
|
31
|
+
x: 100
|
32
|
+
y: 10
|
33
|
+
line02:
|
34
|
+
type: line
|
35
|
+
start:
|
36
|
+
x: 10
|
37
|
+
y: 10
|
38
|
+
end:
|
39
|
+
x: 110
|
40
|
+
y: 110
|
41
|
+
color:
|
42
|
+
red: 1
|
43
|
+
green: 0
|
44
|
+
blue: 0
|
45
|
+
rectangle01:
|
46
|
+
type: rectangle
|
47
|
+
region:
|
48
|
+
x: 120
|
49
|
+
y: 0
|
50
|
+
width: 10
|
51
|
+
height: 5
|
52
|
+
line_color:
|
53
|
+
red: 0
|
54
|
+
green: 0.3
|
55
|
+
blue: 0
|
56
|
+
line_width: 3
|
57
|
+
fill_color:
|
58
|
+
red: 0
|
59
|
+
green: 1
|
60
|
+
blue: 1
|
61
|
+
rectangle02:
|
62
|
+
type: rectangle
|
63
|
+
region:
|
64
|
+
x: 10
|
65
|
+
y: 10
|
66
|
+
width: 100
|
67
|
+
height: 100
|
68
|
+
line_width: 1
|
69
|
+
line_color:
|
70
|
+
red: 1
|
71
|
+
green: 0
|
72
|
+
blue: 0
|
73
|
+
fill_color:
|
74
|
+
red: 1
|
75
|
+
green: 1
|
76
|
+
blue: 1
|
77
|
+
rect1:
|
78
|
+
type: rectangle
|
79
|
+
region:
|
80
|
+
x: 0
|
81
|
+
y: 0
|
82
|
+
width: 10
|
83
|
+
height: 10
|
84
|
+
rect2:
|
85
|
+
type: rectangle
|
86
|
+
region:
|
87
|
+
x: 10
|
88
|
+
y: 10
|
89
|
+
width: 10
|
90
|
+
height: 10
|
@@ -0,0 +1,164 @@
|
|
1
|
+
page:
|
2
|
+
size: a4
|
3
|
+
orientation: portrait
|
4
|
+
margin:
|
5
|
+
top: 10
|
6
|
+
left: 10
|
7
|
+
bottom: 10
|
8
|
+
right: 10
|
9
|
+
header_height: 0
|
10
|
+
footer_height: 0
|
11
|
+
content:
|
12
|
+
type: group
|
13
|
+
table:
|
14
|
+
type: loop
|
15
|
+
x: 0
|
16
|
+
y: 0
|
17
|
+
direction: vertical
|
18
|
+
gap: 0
|
19
|
+
header: table_header
|
20
|
+
iterator: table_content
|
21
|
+
footer: table_footer
|
22
|
+
|
23
|
+
# table の定義
|
24
|
+
table_header:
|
25
|
+
type: group
|
26
|
+
column01_rect:
|
27
|
+
type: rectangle
|
28
|
+
region:
|
29
|
+
x: 0
|
30
|
+
y: 0
|
31
|
+
width: 30
|
32
|
+
height: 10
|
33
|
+
column01_label:
|
34
|
+
type: label
|
35
|
+
label: A
|
36
|
+
region:
|
37
|
+
x: 0
|
38
|
+
y: 0
|
39
|
+
width: 30
|
40
|
+
height: 10
|
41
|
+
column02_rect:
|
42
|
+
type: rectangle
|
43
|
+
region:
|
44
|
+
x: 30
|
45
|
+
y: 0
|
46
|
+
width: 30
|
47
|
+
height: 10
|
48
|
+
column02_label:
|
49
|
+
type: label
|
50
|
+
label: B
|
51
|
+
region:
|
52
|
+
x: 30
|
53
|
+
y: 0
|
54
|
+
width: 30
|
55
|
+
height: 10
|
56
|
+
column03_rect:
|
57
|
+
type: rectangle
|
58
|
+
region:
|
59
|
+
x: 60
|
60
|
+
y: 0
|
61
|
+
width: 30
|
62
|
+
height: 10
|
63
|
+
column03_label:
|
64
|
+
type: label
|
65
|
+
label: C
|
66
|
+
region:
|
67
|
+
x: 60
|
68
|
+
y: 0
|
69
|
+
width: 30
|
70
|
+
height: 10
|
71
|
+
table_content:
|
72
|
+
type: group
|
73
|
+
column01_rect:
|
74
|
+
type: rectangle
|
75
|
+
region:
|
76
|
+
x: 0
|
77
|
+
y: 0
|
78
|
+
width: 30
|
79
|
+
height: 10
|
80
|
+
column01_label:
|
81
|
+
type: label
|
82
|
+
label: A
|
83
|
+
region:
|
84
|
+
x: 0
|
85
|
+
y: 0
|
86
|
+
width: 30
|
87
|
+
height: 10
|
88
|
+
column02_rect:
|
89
|
+
type: rectangle
|
90
|
+
region:
|
91
|
+
x: 30
|
92
|
+
y: 0
|
93
|
+
width: 30
|
94
|
+
height: 10
|
95
|
+
column02_label:
|
96
|
+
type: label
|
97
|
+
label: B
|
98
|
+
region:
|
99
|
+
x: 30
|
100
|
+
y: 0
|
101
|
+
width: 30
|
102
|
+
height: 10
|
103
|
+
column03_rect:
|
104
|
+
type: rectangle
|
105
|
+
region:
|
106
|
+
x: 60
|
107
|
+
y: 0
|
108
|
+
width: 30
|
109
|
+
height: 10
|
110
|
+
column03_label:
|
111
|
+
type: label
|
112
|
+
label: C
|
113
|
+
region:
|
114
|
+
x: 60
|
115
|
+
y: 0
|
116
|
+
width: 30
|
117
|
+
height: 10
|
118
|
+
table_footer:
|
119
|
+
type: group
|
120
|
+
column01_rect:
|
121
|
+
type: rectangle
|
122
|
+
region:
|
123
|
+
x: 0
|
124
|
+
y: 0
|
125
|
+
width: 30
|
126
|
+
height: 10
|
127
|
+
column01_label:
|
128
|
+
type: label
|
129
|
+
label: a
|
130
|
+
region:
|
131
|
+
x: 0
|
132
|
+
y: 0
|
133
|
+
width: 30
|
134
|
+
height: 10
|
135
|
+
column02_rect:
|
136
|
+
type: rectangle
|
137
|
+
region:
|
138
|
+
x: 30
|
139
|
+
y: 0
|
140
|
+
width: 30
|
141
|
+
height: 10
|
142
|
+
column02_label:
|
143
|
+
type: label
|
144
|
+
label: b
|
145
|
+
region:
|
146
|
+
x: 30
|
147
|
+
y: 0
|
148
|
+
width: 30
|
149
|
+
height: 10
|
150
|
+
column03_rect:
|
151
|
+
type: rectangle
|
152
|
+
region:
|
153
|
+
x: 60
|
154
|
+
y: 0
|
155
|
+
width: 30
|
156
|
+
height: 10
|
157
|
+
column03_label:
|
158
|
+
type: label
|
159
|
+
label: c
|
160
|
+
region:
|
161
|
+
x: 60
|
162
|
+
y: 0
|
163
|
+
width: 30
|
164
|
+
height: 10
|
@@ -0,0 +1,206 @@
|
|
1
|
+
page:
|
2
|
+
size: a4
|
3
|
+
orientation: landscape
|
4
|
+
margin:
|
5
|
+
top: 10
|
6
|
+
left: 10
|
7
|
+
bottom: 10
|
8
|
+
right: 10
|
9
|
+
header_height: 40
|
10
|
+
footer_height: 5
|
11
|
+
header:
|
12
|
+
type: group
|
13
|
+
title:
|
14
|
+
type: label
|
15
|
+
label: 文書タイトル
|
16
|
+
align: right
|
17
|
+
region:
|
18
|
+
x: 0
|
19
|
+
y: 0
|
20
|
+
width: 100
|
21
|
+
height: 10
|
22
|
+
color:
|
23
|
+
red: 0
|
24
|
+
green: 1
|
25
|
+
blue: 0
|
26
|
+
title_rect:
|
27
|
+
type: rectangle
|
28
|
+
region:
|
29
|
+
x: 0
|
30
|
+
y: 0
|
31
|
+
width: 100
|
32
|
+
height: 10
|
33
|
+
fill_color:
|
34
|
+
red: 0
|
35
|
+
green: 0
|
36
|
+
blue: 0
|
37
|
+
page_labe:
|
38
|
+
type: label
|
39
|
+
label: "[[[total_page_count]]] ページ中の [[[current_page_number]]] ページ目です。"
|
40
|
+
align: right
|
41
|
+
region:
|
42
|
+
x: 100
|
43
|
+
y: 0
|
44
|
+
width: 100
|
45
|
+
height: 10
|
46
|
+
color:
|
47
|
+
red: 0.3
|
48
|
+
green: 0.3
|
49
|
+
blue: 0.3
|
50
|
+
footer:
|
51
|
+
type: group
|
52
|
+
page_label:
|
53
|
+
type: label
|
54
|
+
label: "[[[current_page_number]]] / [[[total_page_count]]]"
|
55
|
+
align: left
|
56
|
+
region:
|
57
|
+
x: 0
|
58
|
+
y: 0
|
59
|
+
width: 200
|
60
|
+
height: 5
|
61
|
+
|
62
|
+
content:
|
63
|
+
type: group
|
64
|
+
table:
|
65
|
+
type: loop
|
66
|
+
page_break: true
|
67
|
+
x: 0
|
68
|
+
y: 0
|
69
|
+
direction: horizontal
|
70
|
+
gap: 5
|
71
|
+
header: table_header
|
72
|
+
iterator: table_content
|
73
|
+
|
74
|
+
# table の定義
|
75
|
+
table_header:
|
76
|
+
type: group
|
77
|
+
column01_rect:
|
78
|
+
type: rectangle
|
79
|
+
region:
|
80
|
+
x: 0
|
81
|
+
y: 0
|
82
|
+
width: 30
|
83
|
+
height: 10
|
84
|
+
column01_label:
|
85
|
+
type: label
|
86
|
+
label: 日付
|
87
|
+
align: justify
|
88
|
+
region:
|
89
|
+
x: 0
|
90
|
+
y: 0
|
91
|
+
width: 30
|
92
|
+
height: 10
|
93
|
+
column02_rect:
|
94
|
+
type: rectangle
|
95
|
+
region:
|
96
|
+
x: 0
|
97
|
+
y: 10
|
98
|
+
width: 30
|
99
|
+
height: 10
|
100
|
+
column02_label:
|
101
|
+
type: label
|
102
|
+
label: 区分A
|
103
|
+
align: justify
|
104
|
+
region:
|
105
|
+
x: 0
|
106
|
+
y: 10
|
107
|
+
width: 30
|
108
|
+
height: 10
|
109
|
+
column03_rect:
|
110
|
+
type: rectangle
|
111
|
+
region:
|
112
|
+
x: 0
|
113
|
+
y: 20
|
114
|
+
width: 30
|
115
|
+
height: 10
|
116
|
+
column03_label:
|
117
|
+
type: label
|
118
|
+
label: 区分B
|
119
|
+
align: justify
|
120
|
+
region:
|
121
|
+
x: 0
|
122
|
+
y: 20
|
123
|
+
width: 30
|
124
|
+
height: 10
|
125
|
+
column04_rect:
|
126
|
+
type: rectangle
|
127
|
+
region:
|
128
|
+
x: 0
|
129
|
+
y: 30
|
130
|
+
width: 30
|
131
|
+
height: 10
|
132
|
+
column04_label:
|
133
|
+
type: label
|
134
|
+
label: 区分C
|
135
|
+
align: justify
|
136
|
+
region:
|
137
|
+
x: 0
|
138
|
+
y: 30
|
139
|
+
width: 30
|
140
|
+
height: 10
|
141
|
+
table_content:
|
142
|
+
type: group
|
143
|
+
column01_rect:
|
144
|
+
type: rectangle
|
145
|
+
region:
|
146
|
+
x: 0
|
147
|
+
y: 0
|
148
|
+
width: 30
|
149
|
+
height: 10
|
150
|
+
column01_label:
|
151
|
+
type: label
|
152
|
+
label: 日付
|
153
|
+
align: center
|
154
|
+
region:
|
155
|
+
x: 0
|
156
|
+
y: 0
|
157
|
+
width: 30
|
158
|
+
height: 10
|
159
|
+
column02_rect:
|
160
|
+
type: rectangle
|
161
|
+
region:
|
162
|
+
x: 0
|
163
|
+
y: 10
|
164
|
+
width: 30
|
165
|
+
height: 10
|
166
|
+
column02_label:
|
167
|
+
type: label
|
168
|
+
label: 区分A
|
169
|
+
align: left
|
170
|
+
region:
|
171
|
+
x: 0
|
172
|
+
y: 10
|
173
|
+
width: 30
|
174
|
+
height: 10
|
175
|
+
column03_rect:
|
176
|
+
type: rectangle
|
177
|
+
region:
|
178
|
+
x: 0
|
179
|
+
y: 20
|
180
|
+
width: 30
|
181
|
+
height: 10
|
182
|
+
column03_label:
|
183
|
+
type: label
|
184
|
+
label: 区分B
|
185
|
+
align: center
|
186
|
+
region:
|
187
|
+
x: 0
|
188
|
+
y: 20
|
189
|
+
width: 30
|
190
|
+
height: 10
|
191
|
+
column04_rect:
|
192
|
+
type: rectangle
|
193
|
+
region:
|
194
|
+
x: 0
|
195
|
+
y: 30
|
196
|
+
width: 30
|
197
|
+
height: 10
|
198
|
+
column04_label:
|
199
|
+
type: label
|
200
|
+
label: 区分C
|
201
|
+
align: right
|
202
|
+
region:
|
203
|
+
x: 0
|
204
|
+
y: 30
|
205
|
+
width: 30
|
206
|
+
height: 10
|