gbdev-pdf_filler 0.3.0 → 0.3.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/README.rdoc +15 -1
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -88,7 +88,21 @@ Another alternative is to install pdf_filler as a Rails plugin:
|
|
88
88
|
|
89
89
|
book.save_to('/page/to/book.pdf')
|
90
90
|
|
91
|
-
|
91
|
+
5. Rather then setting all the fields manually a PDF can be mapped to an ActiveRecord model.
|
92
|
+
The model must use the acts_as_pdf_db_mapper module. (<b><i>See rdocs on acts_as_pdf_db_mapper for more options</i></b>)
|
93
|
+
|
94
|
+
class User < ActiveRecord::Base
|
95
|
+
...
|
96
|
+
acts_as_pdf_db_mapper
|
97
|
+
...
|
98
|
+
end
|
99
|
+
|
100
|
+
user = User.first
|
101
|
+
page = GBDev::PDF::Page.new('/path/to/template1.pdf')
|
102
|
+
page.map_to_object(user)
|
103
|
+
page.save_to('/path/to/save.pdf)
|
104
|
+
|
105
|
+
|
92
106
|
Note: You can use the shorter kernel methods PDFPage instead of GBDev::PDF::Page.new. The same goes for PDFBook instead of GBDev::PDF::Book.new.
|
93
107
|
|
94
108
|
Example:
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gbdev-pdf_filler
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Wes Hays
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-08-
|
13
|
+
date: 2009-08-04 00:00:00 -07:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|