pdf_form_filler 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +18 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +36 -0
- data/README.md +38 -0
- data/Rakefile +5 -0
- data/bin/pdf_form_filler +16 -0
- data/bin/pdf_form_filler_highlight +11 -0
- data/fonts/LiberationSans-Regular.ttf +0 -0
- data/lib/pdf_form_filler/form.rb +214 -0
- data/lib/pdf_form_filler/version.rb +3 -0
- data/lib/pdf_form_filler.rb +72 -0
- data/pdf_form_filler.gemspec +21 -0
- data/spec/fixtures/ms_application_form.pdf +0 -0
- data/spec/fixtures/ms_application_form.yml +131 -0
- data/spec/fixtures/ms_application_form_data.yml +72 -0
- metadata +111 -0
data/.gitignore
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,36 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
pdf_form_filler (0.0.1)
|
5
|
+
prawn (~> 0.12.0)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
Ascii85 (1.0.1)
|
11
|
+
diff-lcs (1.1.3)
|
12
|
+
pdf-reader (1.1.1)
|
13
|
+
Ascii85 (~> 1.0.0)
|
14
|
+
ruby-rc4
|
15
|
+
prawn (0.12.0)
|
16
|
+
pdf-reader (>= 0.9.0)
|
17
|
+
ttfunk (~> 1.0.2)
|
18
|
+
rake (0.9.2.2)
|
19
|
+
rspec (2.11.0)
|
20
|
+
rspec-core (~> 2.11.0)
|
21
|
+
rspec-expectations (~> 2.11.0)
|
22
|
+
rspec-mocks (~> 2.11.0)
|
23
|
+
rspec-core (2.11.1)
|
24
|
+
rspec-expectations (2.11.2)
|
25
|
+
diff-lcs (~> 1.1.3)
|
26
|
+
rspec-mocks (2.11.2)
|
27
|
+
ruby-rc4 (0.1.5)
|
28
|
+
ttfunk (1.0.3)
|
29
|
+
|
30
|
+
PLATFORMS
|
31
|
+
ruby
|
32
|
+
|
33
|
+
DEPENDENCIES
|
34
|
+
pdf_form_filler!
|
35
|
+
rake (~> 0.9.2)
|
36
|
+
rspec (~> 2.11.0)
|
data/README.md
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
PDF Form Filler
|
2
|
+
===============
|
3
|
+
|
4
|
+
PDF Form Filler is a very simple library for drawing text on top of a PDF. It doesn't use any
|
5
|
+
native PDF form functionality; you just specify the co-ordinates where you want to draw
|
6
|
+
text.
|
7
|
+
|
8
|
+
License
|
9
|
+
-------
|
10
|
+
|
11
|
+
PDF Form Filler is licensed under the [GNU General Public License, Version 3](http://www.gnu.org/licenses/gpl-3.0.html).
|
12
|
+
|
13
|
+
Copyright © 2012 Chris Mear <chris@feedmechocolate.com>.
|
14
|
+
|
15
|
+
This program is free software: you can redistribute it and/or modify
|
16
|
+
it under the terms of the GNU General Public License as published by
|
17
|
+
the Free Software Foundation, either version 3 of the License, or
|
18
|
+
(at your option) any later version.
|
19
|
+
|
20
|
+
This program is distributed in the hope that it will be useful,
|
21
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
22
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
23
|
+
GNU General Public License for more details.
|
24
|
+
|
25
|
+
You should have received a copy of the GNU General Public License
|
26
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
27
|
+
|
28
|
+
PDF Form Filler incorporates work covered by the following copyright and permission notice:
|
29
|
+
|
30
|
+
The Liberation Fonts
|
31
|
+
|
32
|
+
Digitized data copyright (c) 2010 Google Corporation
|
33
|
+
with Reserved Font Arimo, Tinos and Cousine.
|
34
|
+
Copyright (c) 2012 Red Hat, Inc.
|
35
|
+
with Reserved Font Name Liberation.
|
36
|
+
|
37
|
+
This Font Software is licensed under the SIL Open Font License,
|
38
|
+
Version 1.1.
|
data/Rakefile
ADDED
data/bin/pdf_form_filler
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pdf_form_filler'
|
4
|
+
|
5
|
+
require 'yaml'
|
6
|
+
|
7
|
+
template = ARGV[0]
|
8
|
+
definition = ARGV[1]
|
9
|
+
data_file = ARGV[2]
|
10
|
+
output = ARGV[3]
|
11
|
+
|
12
|
+
data = YAML.load_file(data_file)
|
13
|
+
|
14
|
+
document = PdfFormFiller::Form.new(:template => template, :definition => definition)
|
15
|
+
document.fill_form(data)
|
16
|
+
document.render_file(output)
|
@@ -0,0 +1,11 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'pdf_form_filler'
|
4
|
+
|
5
|
+
template = ARGV[0]
|
6
|
+
definition = ARGV[1]
|
7
|
+
output = ARGV[2]
|
8
|
+
|
9
|
+
document = PdfFormFiller::Form.new(:template => template, :definition => definition)
|
10
|
+
document.highlight_fields
|
11
|
+
document.render_file(output)
|
Binary file
|
@@ -0,0 +1,214 @@
|
|
1
|
+
require 'prawn'
|
2
|
+
require 'yaml'
|
3
|
+
|
4
|
+
class PdfFormFiller::Form
|
5
|
+
def initialize(options={})
|
6
|
+
@template = options[:template]
|
7
|
+
|
8
|
+
@definition_file = options[:definition]
|
9
|
+
@definition = YAML.load_file(@definition_file)
|
10
|
+
|
11
|
+
@pdf = Prawn::Document.new(:template => @template)
|
12
|
+
|
13
|
+
@pdf.font(File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'fonts', 'LiberationSans-Regular.ttf')))
|
14
|
+
|
15
|
+
# x_offset, y_offset is the position of the Prawn origin, as expressed
|
16
|
+
# in the co-ordinate system used for the rest of the measurements.
|
17
|
+
#
|
18
|
+
# In Prawn, x runs left to right, and y runs bottom to top. If either
|
19
|
+
# of the axes in your co-ordinate system run opposite to this, set
|
20
|
+
# invert_x and/or invert_y to true.
|
21
|
+
|
22
|
+
if @definition['defaults']
|
23
|
+
@font_size = @definition['defaults']['font_size'] || 12
|
24
|
+
@horizontal_padding = @definition['defaults']['horizontal_padding'] || 5
|
25
|
+
@vertical_padding = @definition['defaults']['vertical_padding'] || 1
|
26
|
+
@text_align = (@definition['defaults']['text_align'] || :left).to_sym
|
27
|
+
@vertical_align = (@definition['defaults']['vertical_align'] || :center).to_sym
|
28
|
+
else
|
29
|
+
@font_size = 12
|
30
|
+
@horizontal_padding = 5
|
31
|
+
@vertical_padding = 1
|
32
|
+
@text_align = :left
|
33
|
+
@vertical_align = :center
|
34
|
+
end
|
35
|
+
|
36
|
+
end
|
37
|
+
|
38
|
+
def fill_form(data)
|
39
|
+
1.upto(@pdf.page_count) do |page_number|
|
40
|
+
@pdf.go_to_page(page_number)
|
41
|
+
|
42
|
+
if @definition[page_number] && @definition[page_number].respond_to?(:each)
|
43
|
+
@definition[page_number].each do |name, box_definition|
|
44
|
+
if box_definition.is_a?(Hash)
|
45
|
+
box_coords = box_definition['box']
|
46
|
+
font_size = box_definition['font_size'] || @font_size
|
47
|
+
check_box = box_definition['check_box']
|
48
|
+
|
49
|
+
if check_box
|
50
|
+
text_align = :center
|
51
|
+
vertical_align = :center
|
52
|
+
font_size = box_coords[3] + 0.5
|
53
|
+
horizontal_padding = 0
|
54
|
+
vertical_padding = 0
|
55
|
+
end
|
56
|
+
|
57
|
+
if box_definition['text_align']
|
58
|
+
text_align = box_definition['text_align'].to_sym
|
59
|
+
end
|
60
|
+
text_align ||= @text_align
|
61
|
+
|
62
|
+
if box_definition['vertical_align']
|
63
|
+
vertical_align = box_definition['vertical_align'].to_sym
|
64
|
+
end
|
65
|
+
vertical_align ||= @vertical_align
|
66
|
+
|
67
|
+
if box_definition['font_size']
|
68
|
+
font_size = box_definition['font_size']
|
69
|
+
end
|
70
|
+
font_size ||= @font_size
|
71
|
+
|
72
|
+
if box_definition['horizontal_padding']
|
73
|
+
horizontal_padding = box_definition['horizontal_padding']
|
74
|
+
end
|
75
|
+
horizontal_padding ||= @horizontal_padding
|
76
|
+
|
77
|
+
if box_definition['vertical_padding']
|
78
|
+
vertical_padding = box_definition['vertical_padding']
|
79
|
+
end
|
80
|
+
vertical_padding ||= @vertical_padding
|
81
|
+
else
|
82
|
+
box_coords = box_definition
|
83
|
+
font_size = @font_size
|
84
|
+
text_align = @text_align
|
85
|
+
vertical_align = @vertical_align
|
86
|
+
horizontal_padding = @horizontal_padding
|
87
|
+
vertical_padding = @vertical_padding
|
88
|
+
end
|
89
|
+
local_box_coords = convert_to_local(box_coords)
|
90
|
+
|
91
|
+
if check_box
|
92
|
+
value = (data[name.to_s] || data[name.to_sym]) ? 'x' : ''
|
93
|
+
else
|
94
|
+
value = (data[name.to_s] || data[name.to_sym] || '').to_s
|
95
|
+
end
|
96
|
+
|
97
|
+
@pdf.font_size(font_size)
|
98
|
+
@pdf.fill_color = "000000"
|
99
|
+
@pdf.text_box(value,
|
100
|
+
:at => [local_box_coords[0] + (horizontal_padding / 2.0), local_box_coords[1] - (vertical_padding / 2.0)],
|
101
|
+
:width => local_box_coords[2] - horizontal_padding,
|
102
|
+
:height => local_box_coords[3] - vertical_padding,
|
103
|
+
:align => text_align,
|
104
|
+
:valign => vertical_align
|
105
|
+
)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
112
|
+
def highlight_fields
|
113
|
+
1.upto(@pdf.page_count) do |page_number|
|
114
|
+
@pdf.go_to_page(page_number)
|
115
|
+
|
116
|
+
if @definition[page_number] && @definition[page_number].respond_to?(:each)
|
117
|
+
@definition[page_number].each do |name, box_definition|
|
118
|
+
if box_definition.is_a?(Hash)
|
119
|
+
box_coords = box_definition['box']
|
120
|
+
font_size = box_definition['font_size'] || @font_size
|
121
|
+
check_box = box_definition['check_box']
|
122
|
+
|
123
|
+
if check_box
|
124
|
+
text_align = :center
|
125
|
+
vertical_align = :center
|
126
|
+
font_size = box_coords[3] + 0.5
|
127
|
+
horizontal_padding = 0
|
128
|
+
vertical_padding = 0
|
129
|
+
end
|
130
|
+
|
131
|
+
if box_definition['text_align']
|
132
|
+
text_align = box_definition['text_align'].to_sym
|
133
|
+
end
|
134
|
+
text_align ||= @text_align
|
135
|
+
|
136
|
+
if box_definition['vertical_align']
|
137
|
+
vertical_align = box_definition['vertical_align'].to_sym
|
138
|
+
end
|
139
|
+
vertical_align ||= @vertical_align
|
140
|
+
|
141
|
+
if box_definition['font_size']
|
142
|
+
font_size = box_definition['font_size']
|
143
|
+
end
|
144
|
+
font_size ||= @font_size
|
145
|
+
|
146
|
+
if box_definition['horizontal_padding']
|
147
|
+
horizontal_padding = box_definition['horizontal_padding']
|
148
|
+
end
|
149
|
+
horizontal_padding ||= @horizontal_padding
|
150
|
+
|
151
|
+
if box_definition['vertical_padding']
|
152
|
+
vertical_padding = box_definition['vertical_padding']
|
153
|
+
end
|
154
|
+
vertical_padding ||= @vertical_padding
|
155
|
+
else
|
156
|
+
box_coords = box_definition
|
157
|
+
font_size = @font_size
|
158
|
+
text_align = @text_align
|
159
|
+
vertical_align = @vertical_align
|
160
|
+
horizontal_padding = @horizontal_padding
|
161
|
+
vertical_padding = @vertical_padding
|
162
|
+
end
|
163
|
+
local_box_coords = convert_to_local(box_coords)
|
164
|
+
|
165
|
+
@pdf.fill_color = "ff0000"
|
166
|
+
@pdf.transparent(0.5) do
|
167
|
+
@pdf.fill_rectangle([local_box_coords[0], local_box_coords[1]], local_box_coords[2], local_box_coords[3])
|
168
|
+
end
|
169
|
+
|
170
|
+
@pdf.font_size(font_size)
|
171
|
+
@pdf.fill_color = "000000"
|
172
|
+
@pdf.text_box(name,
|
173
|
+
:at => [local_box_coords[0] + (horizontal_padding / 2.0), local_box_coords[1] - (vertical_padding / 2.0)],
|
174
|
+
:width => local_box_coords[2] - horizontal_padding,
|
175
|
+
:height => local_box_coords[3] - vertical_padding,
|
176
|
+
:align => text_align,
|
177
|
+
:valign => vertical_align,
|
178
|
+
:overflow => :shrink_to_fit
|
179
|
+
)
|
180
|
+
end
|
181
|
+
end
|
182
|
+
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
def render_file(output)
|
187
|
+
@pdf.render_file(output)
|
188
|
+
end
|
189
|
+
|
190
|
+
def render
|
191
|
+
@pdf.render
|
192
|
+
end
|
193
|
+
|
194
|
+
protected
|
195
|
+
|
196
|
+
def convert_to_local(box_coords)
|
197
|
+
x_offset = @definition['defaults']['x_offset'] || 0
|
198
|
+
y_offset = @definition['defaults']['y_offset'] || 0
|
199
|
+
|
200
|
+
x = if @definition['defaults']['invert_x']
|
201
|
+
x_offset - box_coords[0]
|
202
|
+
else
|
203
|
+
box_coords[0] - x_offset
|
204
|
+
end
|
205
|
+
|
206
|
+
y = if @definition['defaults']['invert_y']
|
207
|
+
y_offset - box_coords[1]
|
208
|
+
else
|
209
|
+
box_coords[1] - y_offset
|
210
|
+
end
|
211
|
+
|
212
|
+
[x, y, box_coords[2], box_coords[3]]
|
213
|
+
end
|
214
|
+
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'pdf_form_filler/version'
|
2
|
+
require 'pdf_form_filler/form'
|
3
|
+
|
4
|
+
module PdfFormFiller
|
5
|
+
def stroke_axis(pdf, options={})
|
6
|
+
options = { :height => (pdf.cursor - 20).to_i,
|
7
|
+
:width => pdf.bounds.width.to_i
|
8
|
+
}.merge(options)
|
9
|
+
|
10
|
+
pdf.dash(1, :space => 4)
|
11
|
+
pdf.stroke_horizontal_line(-21, options[:width], :at => 0)
|
12
|
+
pdf.stroke_vertical_line(-21, options[:height], :at => 0)
|
13
|
+
pdf.undash
|
14
|
+
|
15
|
+
pdf.fill_circle [0, 0], 1
|
16
|
+
|
17
|
+
(100..options[:width]).step(100) do |point|
|
18
|
+
pdf.fill_circle [point, 0], 1
|
19
|
+
pdf.draw_text point, :at => [point-5, -10], :size => 7
|
20
|
+
end
|
21
|
+
|
22
|
+
(100..options[:height]).step(100) do |point|
|
23
|
+
pdf.fill_circle [0, point], 1
|
24
|
+
pdf.draw_text point, :at => [-17, point-2], :size => 7
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
# axes = false
|
30
|
+
|
31
|
+
|
32
|
+
# input_file = "ms_application_form.pdf"
|
33
|
+
|
34
|
+
# pdf = Prawn::Document.new(:template => input_file)
|
35
|
+
|
36
|
+
# pdf.go_to_page(1)
|
37
|
+
# stroke_axis(pdf) if axes
|
38
|
+
|
39
|
+
# pdf.text_box("OCO Digital IPS", :at => [45, 603])
|
40
|
+
|
41
|
+
# pdf.go_to_page(2)
|
42
|
+
# stroke_axis(pdf) if axes
|
43
|
+
|
44
|
+
# pdf.go_to_page(3)
|
45
|
+
# stroke_axis(pdf) if axes
|
46
|
+
|
47
|
+
# pdf.text_box("x", :at => [136.5, 613])
|
48
|
+
# pdf.text_box("x", :at => [403.5, 613])
|
49
|
+
|
50
|
+
# pdf.font_size(9)
|
51
|
+
# pdf.text_box("Christopher Mear", :at => [230, 365])
|
52
|
+
# pdf.text_box("Director", :at => [230, 343])
|
53
|
+
|
54
|
+
# pdf.go_to_page(4)
|
55
|
+
# stroke_axis(pdf) if axes
|
56
|
+
|
57
|
+
# pdf.go_to_page(5)
|
58
|
+
# stroke_axis(pdf) if axes
|
59
|
+
|
60
|
+
# pdf.go_to_page(6)
|
61
|
+
# stroke_axis(pdf) if axes
|
62
|
+
|
63
|
+
# pdf.go_to_page(7)
|
64
|
+
# stroke_axis(pdf) if axes
|
65
|
+
|
66
|
+
# pdf.go_to_page(8)
|
67
|
+
# stroke_axis(pdf) if axes
|
68
|
+
|
69
|
+
# pdf.go_to_page(9)
|
70
|
+
# stroke_axis(pdf) if axes
|
71
|
+
|
72
|
+
# pdf.render_file "output.pdf"
|
@@ -0,0 +1,21 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
require File.expand_path('../lib/pdf_form_filler/version', __FILE__)
|
3
|
+
|
4
|
+
Gem::Specification.new do |gem|
|
5
|
+
gem.authors = ["Chris Mear"]
|
6
|
+
gem.email = 'chris@feedmechocolate.com'
|
7
|
+
gem.description = "pdf_form_filler is a very simple tool for filling in PDF forms"
|
8
|
+
gem.summary = "pdf_form_filler fills in a PDF form using fields defined by co-ordinates in a YAML file."
|
9
|
+
gem.homepage = 'https://github.com/chrismear/pdf_form_filler'
|
10
|
+
|
11
|
+
gem.files = `git ls-files`.split($\)
|
12
|
+
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
13
|
+
gem.name = 'pdf_form_filler'
|
14
|
+
gem.require_paths = ["lib"]
|
15
|
+
gem.version = PdfFormFiller::VERSION
|
16
|
+
|
17
|
+
gem.add_dependency 'prawn', '~>0.12.0'
|
18
|
+
|
19
|
+
gem.add_development_dependency 'rake', '~>0.9.2'
|
20
|
+
gem.add_development_dependency 'rspec', '~>2.11.0'
|
21
|
+
end
|
Binary file
|
@@ -0,0 +1,131 @@
|
|
1
|
+
---
|
2
|
+
defaults:
|
3
|
+
x_offset: 35
|
4
|
+
y_offset: 806
|
5
|
+
invert_y: true
|
6
|
+
font_size: 9
|
7
|
+
1:
|
8
|
+
organisation_name:
|
9
|
+
box: [76, 189, 377, 36]
|
10
|
+
font_size: 10
|
11
|
+
3:
|
12
|
+
register_new:
|
13
|
+
box: [170.75, 195.15, 7, 7]
|
14
|
+
check_box: true
|
15
|
+
register_new_completed:
|
16
|
+
box: [438.8, 194.9, 7, 7]
|
17
|
+
check_box: true
|
18
|
+
contact_name: [263.5, 432.9, 260.9, 21.6]
|
19
|
+
contact_position: [263.5, 455.6, 260.9, 21.6]
|
20
|
+
contact_address:
|
21
|
+
box: [263.5, 481.5, 260.9, 38.8]
|
22
|
+
vertical_align: top
|
23
|
+
contact_phone: [263.5, 520.4, 260.9, 21.6]
|
24
|
+
contact_email: [263.5, 541.3, 260.9, 21.6]
|
25
|
+
timing_factors:
|
26
|
+
box: [170.9, 611.3, 353.3, 69.5]
|
27
|
+
vertical_align: top
|
28
|
+
rules_attached:
|
29
|
+
box: [423.7, 728.2, 7, 7]
|
30
|
+
check_box: true
|
31
|
+
|
32
|
+
4:
|
33
|
+
name_rule_number:
|
34
|
+
box: [432, 151, 92, 14]
|
35
|
+
text_align: center
|
36
|
+
objects_rule_number:
|
37
|
+
box: [432, 165.8, 92, 14]
|
38
|
+
text_align: center
|
39
|
+
registered_office_rule_number:
|
40
|
+
box: [432, 180.5, 92, 37]
|
41
|
+
text_align: center
|
42
|
+
member_admission_rule_number:
|
43
|
+
box: [432, 219, 92, 37]
|
44
|
+
text_align: center
|
45
|
+
meetings_rule_number:
|
46
|
+
box: [432, 257.6, 92, 25.1]
|
47
|
+
text_align: center
|
48
|
+
board_rule_number:
|
49
|
+
box: [432, 284.1, 92, 48.8]
|
50
|
+
text_align: center
|
51
|
+
maximum_shareholding_rule_number:
|
52
|
+
box: [432, 334.4, 92, 37.1]
|
53
|
+
text_align: center
|
54
|
+
loans_rule_number:
|
55
|
+
box: [432, 373.4, 92, 48.5]
|
56
|
+
text_align: center
|
57
|
+
share_transactions:
|
58
|
+
box: [432, 423.6, 92, 72.8]
|
59
|
+
text_align: center
|
60
|
+
audit_rule_number:
|
61
|
+
box: [432, 498.1, 92, 37]
|
62
|
+
text_align: center
|
63
|
+
withdrawals_rule_number:
|
64
|
+
box: [432, 537.2, 92, 60]
|
65
|
+
text_align: center
|
66
|
+
profits_rule_number:
|
67
|
+
box: [432, 599, 92, 13.3]
|
68
|
+
text_align: center
|
69
|
+
seal_rule_number:
|
70
|
+
box: [432, 613.4, 92, 25.3]
|
71
|
+
text_align: center
|
72
|
+
investing_rule_number:
|
73
|
+
box: [432, 640, 92, 25.3]
|
74
|
+
text_align: center
|
75
|
+
5:
|
76
|
+
year_end_day_1: [206.4, 151.3, 17.5, 19.3]
|
77
|
+
year_end_day_2: [224.5, 151.3, 17.5, 19.3]
|
78
|
+
year_end_month_1: [260.4, 151.3, 17.5, 19.3]
|
79
|
+
year_end_month_2: [278.5, 151.3, 17.5, 19.3]
|
80
|
+
year_end_year_1: [314.5, 151.3, 17.5, 19.3]
|
81
|
+
year_end_year_2: [332.5, 151.3, 17.5, 19.3]
|
82
|
+
year_end_year_3: [350.4, 151.3, 17.5, 19.3]
|
83
|
+
year_end_year_4: [368.5, 151.3, 17.5, 19.3]
|
84
|
+
membership_required_yes:
|
85
|
+
box: [171.65, 235.09, 7.15, 7.15]
|
86
|
+
check_box: true
|
87
|
+
membership_required_no:
|
88
|
+
box: [171.65, 248.26, 7.15, 7.15]
|
89
|
+
check_box: true
|
90
|
+
bona_fide_cooperative:
|
91
|
+
box: [171.65, 282.99, 7.15, 7.15]
|
92
|
+
check_box: true
|
93
|
+
benefit_of_community:
|
94
|
+
box: [171.65, 296.18, 7.15, 7.15]
|
95
|
+
check_box: true
|
96
|
+
ips_type_explanation:
|
97
|
+
box: [171.16, 321.24, 353.56, 96.44]
|
98
|
+
vertical_align: top
|
99
|
+
7:
|
100
|
+
close_links:
|
101
|
+
box: [170.6, 168.02, 353.56, 112.24]
|
102
|
+
vertical_align: top
|
103
|
+
close_links_extra_pages:
|
104
|
+
box: [170.6, 309.87, 83.01, 19.35]
|
105
|
+
model_rules_yes:
|
106
|
+
box: [171.5, 367.83, 7.15, 7.15]
|
107
|
+
check_box: true
|
108
|
+
model_name: [270.59, 468.22, 253.72, 28.34]
|
109
|
+
sponsoring_body_name: [270.3, 500.39, 253.72, 21.37]
|
110
|
+
no_changes:
|
111
|
+
box: [171.67, 670.18, 7.15, 7.15]
|
112
|
+
check_box: true
|
113
|
+
8:
|
114
|
+
member_1_name: [291.01, 204.39, 233.32, 13.9]
|
115
|
+
member_1_address:
|
116
|
+
box: [291.01, 219.23, 233.32, 41.67]
|
117
|
+
member_1_phone: [291.01, 261.46, 233.32, 13.9]
|
118
|
+
member_2_name: [291.01, 319.53, 233.32, 13.9]
|
119
|
+
member_2_address:
|
120
|
+
box: [291.01, 334.37, 233.32, 41.67]
|
121
|
+
member_2_phone: [291.01, 376.6, 233.32, 13.9]
|
122
|
+
member_3_name: [291.01, 434.67, 233.32, 13.9]
|
123
|
+
member_3_address:
|
124
|
+
box: [291.01, 449.51, 233.32, 41.67]
|
125
|
+
member_3_phone: [291.01, 491.74, 233.32, 13.9]
|
126
|
+
secretary_name: [291.01, 577.44, 233.32, 13.9]
|
127
|
+
secretary_address:
|
128
|
+
box: [291.01, 592.28, 233.32, 41.67]
|
129
|
+
secretary_phone: [291.01, 634.51, 233.32, 13.9]
|
130
|
+
|
131
|
+
|
@@ -0,0 +1,72 @@
|
|
1
|
+
---
|
2
|
+
organisation_name: The Digital IPS
|
3
|
+
register_new: true
|
4
|
+
name_rule_number: 1
|
5
|
+
register_new_completed: true
|
6
|
+
contact_name: Christopher Mear
|
7
|
+
contact_position: Director
|
8
|
+
contact_address: |
|
9
|
+
1 High Street
|
10
|
+
London
|
11
|
+
N1 1AA
|
12
|
+
contact_phone: 020 1234 5678
|
13
|
+
contact_email: chris@example.com
|
14
|
+
timing_factors:
|
15
|
+
rules_attached: true
|
16
|
+
name_rule_number: 1
|
17
|
+
objects_rule_number: 5
|
18
|
+
registered_office_rule_number: 2
|
19
|
+
member_admission_rule_number: 14–29
|
20
|
+
meetings_rule_number: 44–90
|
21
|
+
board_rule_number: 91–111
|
22
|
+
maximum_shareholding_rule_number: 35
|
23
|
+
loans_rule_number: 10
|
24
|
+
share_transactions: 32, 36–41
|
25
|
+
audit_rule_number: 147–151
|
26
|
+
withdrawals_rule_number: 27–31
|
27
|
+
profits_rule_number: 129
|
28
|
+
seal_rule_number: 137
|
29
|
+
investing_rule_number: 13
|
30
|
+
year_end_day_1: 3
|
31
|
+
year_end_day_2: 1
|
32
|
+
year_end_month_1: 0
|
33
|
+
year_end_month_2: 8
|
34
|
+
year_end_year_1: 2
|
35
|
+
year_end_year_2: 0
|
36
|
+
year_end_year_3: 1
|
37
|
+
year_end_year_4: 3
|
38
|
+
membership_required_yes: true
|
39
|
+
membership_required_no: false
|
40
|
+
bona_fide_cooperative: true
|
41
|
+
benefit_of_community: false
|
42
|
+
ips_type_explanation: (IPS type explanation)
|
43
|
+
close_links: (Close links)
|
44
|
+
close_links_extra_pages: 0
|
45
|
+
model_rules_yes: true
|
46
|
+
model_name: Co-operatives UK Multi-stakeholder Co-operative Model Rules
|
47
|
+
sponsoring_body_name: Co-operatives UK
|
48
|
+
no_changes: true
|
49
|
+
member_1_name: Christopher Mear
|
50
|
+
member_1_address: |
|
51
|
+
1 High Street
|
52
|
+
London
|
53
|
+
N1 1AA
|
54
|
+
member_1_phone: 020 1234 5678
|
55
|
+
member_2_name: Jenny Carpenter
|
56
|
+
member_2_address: |
|
57
|
+
56 Main Road
|
58
|
+
London
|
59
|
+
E1 1AA
|
60
|
+
member_2_phone: 020 8765 4321
|
61
|
+
member_3_name: Bob Baker
|
62
|
+
member_3_address: |
|
63
|
+
23 Boulevard Avenue
|
64
|
+
Manchester
|
65
|
+
M60 1AA
|
66
|
+
member_3_phone: 0161 123 4567
|
67
|
+
secretary_name: Sally Smith
|
68
|
+
secretary_address: |
|
69
|
+
78 Forest Close
|
70
|
+
London
|
71
|
+
S1 1AA
|
72
|
+
secretary_phone: 020 1324 3546
|
metadata
ADDED
@@ -0,0 +1,111 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: pdf_form_filler
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
prerelease:
|
6
|
+
platform: ruby
|
7
|
+
authors:
|
8
|
+
- Chris Mear
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2012-09-16 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: prawn
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 0.12.0
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 0.12.0
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: rake
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ~>
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.9.2
|
38
|
+
type: :development
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.9.2
|
46
|
+
- !ruby/object:Gem::Dependency
|
47
|
+
name: rspec
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 2.11.0
|
54
|
+
type: :development
|
55
|
+
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 2.11.0
|
62
|
+
description: pdf_form_filler is a very simple tool for filling in PDF forms
|
63
|
+
email: chris@feedmechocolate.com
|
64
|
+
executables: []
|
65
|
+
extensions: []
|
66
|
+
extra_rdoc_files: []
|
67
|
+
files:
|
68
|
+
- .gitignore
|
69
|
+
- Gemfile
|
70
|
+
- Gemfile.lock
|
71
|
+
- README.md
|
72
|
+
- Rakefile
|
73
|
+
- bin/pdf_form_filler
|
74
|
+
- bin/pdf_form_filler_highlight
|
75
|
+
- fonts/LiberationSans-Regular.ttf
|
76
|
+
- lib/pdf_form_filler.rb
|
77
|
+
- lib/pdf_form_filler/form.rb
|
78
|
+
- lib/pdf_form_filler/version.rb
|
79
|
+
- pdf_form_filler.gemspec
|
80
|
+
- spec/fixtures/ms_application_form.pdf
|
81
|
+
- spec/fixtures/ms_application_form.yml
|
82
|
+
- spec/fixtures/ms_application_form_data.yml
|
83
|
+
homepage: https://github.com/chrismear/pdf_form_filler
|
84
|
+
licenses: []
|
85
|
+
post_install_message:
|
86
|
+
rdoc_options: []
|
87
|
+
require_paths:
|
88
|
+
- lib
|
89
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
90
|
+
none: false
|
91
|
+
requirements:
|
92
|
+
- - ! '>='
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
97
|
+
requirements:
|
98
|
+
- - ! '>='
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '0'
|
101
|
+
requirements: []
|
102
|
+
rubyforge_project:
|
103
|
+
rubygems_version: 1.8.24
|
104
|
+
signing_key:
|
105
|
+
specification_version: 3
|
106
|
+
summary: pdf_form_filler fills in a PDF form using fields defined by co-ordinates
|
107
|
+
in a YAML file.
|
108
|
+
test_files:
|
109
|
+
- spec/fixtures/ms_application_form.pdf
|
110
|
+
- spec/fixtures/ms_application_form.yml
|
111
|
+
- spec/fixtures/ms_application_form_data.yml
|