prawn-fillform 0.0.16 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +5 -3
- data/data/output.pdf +0 -0
- data/data/template.pdf +0 -0
- data/examples/main.rb +6 -5
- data/lib/prawn-fillform/version.rb +1 -1
- data/prawn-fillform.gemspec +2 -1
- metadata +18 -1
data/README.md
CHANGED
@@ -17,9 +17,11 @@ require 'prawn-fillform'
|
|
17
17
|
data = {}
|
18
18
|
data[:page_1] = {}
|
19
19
|
data[:page_1][:firstname] = { :value => "Max" }
|
20
|
-
data[:page_1][:lastname] = { :value => "Mustermann" }
|
21
20
|
data[:page_1][:photo] = { :value => "test.jpg" }
|
22
21
|
|
22
|
+
# Page number optional, substitute lastname var in all pages, thanks to hoverlover
|
23
|
+
data[:lastname] = { :value => "Mustermann" }
|
24
|
+
|
23
25
|
# Create a PDF file with predefined data Fields
|
24
26
|
Prawn::Document.generate "output.pdf", :template => "template.pdf" do |pdf|
|
25
27
|
pdf.fill_form_with(data)
|
@@ -30,7 +32,7 @@ Take a look in `examples` folder
|
|
30
32
|
|
31
33
|
## Thanks to netinlet for fix field placement bug
|
32
34
|
|
33
|
-
I was having issue with the form field placement (see https://github.com/moessimple/prawn-fillform/issues/1)
|
35
|
+
I was having issue with the form field placement (see https://github.com/moessimple/prawn-fillform/issues/1)
|
34
36
|
Scribus and Adobe Acrobat don't open pdf's in the same way so the formatting comes out differently. Much like
|
35
37
|
opening a Word document in OpenOffice can some render with funny formatting.
|
36
38
|
|
@@ -44,7 +46,7 @@ Prawn::Document.use_adobe_xy_offsets! # Your mileage may vary! Defaults to x_off
|
|
44
46
|
|
45
47
|
Prawn::Document.fillform_x_offset
|
46
48
|
|
47
|
-
Prawn::Document.fillform_y_offset
|
49
|
+
Prawn::Document.fillform_y_offset
|
48
50
|
```
|
49
51
|
|
50
52
|
#And on a per-form basis
|
data/data/output.pdf
ADDED
Binary file
|
data/data/template.pdf
CHANGED
Binary file
|
data/examples/main.rb
CHANGED
@@ -1,17 +1,18 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
1
2
|
# -*- encoding : utf-8 -*-
|
2
|
-
require 'rubygems'
|
3
3
|
|
4
|
-
$LOAD_PATH
|
4
|
+
$LOAD_PATH << File.expand_path('../../lib/', __FILE__)
|
5
5
|
|
6
6
|
require 'prawn'
|
7
|
-
require '
|
8
|
-
|
7
|
+
require 'active_support/all'
|
8
|
+
require 'prawn-fillform'
|
9
9
|
|
10
10
|
data = {}
|
11
11
|
data[:page_1] = {}
|
12
12
|
data[:page_1][:firstname] = { :value => "Max" }
|
13
|
-
data[:page_1][:lastname] = { :value => "Mustermann" }
|
14
13
|
data[:page_1][:photo] = { :value => "../data/test.jpg" }
|
14
|
+
# Page number optional, substitute lastname var in all pages
|
15
|
+
data[:lastname] = { :value => "Mustermann" }
|
15
16
|
|
16
17
|
|
17
18
|
Prawn::Document.generate "../data/output.pdf", :template => "../data/template.pdf" do |pdf|
|
data/prawn-fillform.gemspec
CHANGED
@@ -16,8 +16,9 @@ Gem::Specification.new do |s|
|
|
16
16
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
17
17
|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
18
18
|
s.require_paths = ["lib"]
|
19
|
-
|
19
|
+
|
20
20
|
s.add_dependency "prawn"
|
21
|
+
s.add_dependency "active_support/all"
|
21
22
|
|
22
23
|
# specify any dependencies here; for example:
|
23
24
|
# s.add_development_dependency "rspec"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prawn-fillform
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -27,6 +27,22 @@ dependencies:
|
|
27
27
|
- - ! '>='
|
28
28
|
- !ruby/object:Gem::Version
|
29
29
|
version: '0'
|
30
|
+
- !ruby/object:Gem::Dependency
|
31
|
+
name: active_support/all
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
none: false
|
34
|
+
requirements:
|
35
|
+
- - ! '>='
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: '0'
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
30
46
|
description:
|
31
47
|
email:
|
32
48
|
- moessimple@googlemail.com
|
@@ -38,6 +54,7 @@ files:
|
|
38
54
|
- Gemfile
|
39
55
|
- README.md
|
40
56
|
- Rakefile
|
57
|
+
- data/output.pdf
|
41
58
|
- data/template.pdf
|
42
59
|
- data/test.jpg
|
43
60
|
- examples/main.rb
|