Skip to content

Commit d524041

Browse files
committed
Updated to the 4.2.0 version of iText. Deleted some old code.
1 parent 5085d6d commit d524041

File tree

8 files changed

+376
-319
lines changed

8 files changed

+376
-319
lines changed

History.txt

+26-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
1-
== 0.3.0 2009-02-08
2-
3-
* Refactored the code.
4-
* Added JRuby support
5-
* Fixed some documentation
6-
7-
== 0.2.0 2007-11-08
8-
9-
* Use bytearray for output
10-
* Added support for images
11-
12-
== 0.1.0 2007-07-13
13-
14-
* 1 major enhancement:
15-
* Initial release
1+
== 0.3.3 2010-09-24
2+
* iText downgraded to 4.2.0 due to license incompatibility
3+
4+
== 0.3.2 2010-09-24
5+
* Added support for drawing circles, rectangles and ellipses
6+
7+
== 0.3.1 2010-09-15
8+
* checkbox support added
9+
* iText updated to 5.0.4
10+
* documentation updated and typos fixed
11+
12+
== 0.3.0 2009-02-08
13+
14+
* Refactored the code.
15+
* Added JRuby support
16+
* Fixed some documentation
17+
18+
== 0.2.0 2007-11-08
19+
20+
* Use bytearray for output
21+
* Added support for images
22+
23+
== 0.1.0 2007-07-13
24+
25+
* 1 major enhancement:
26+
* Initial release

Manifest.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
History.txt
22
Manifest.txt
3-
README.txt
3+
README.rdoc
44
Rakefile
5-
ext/iText-2.1.4.jar
5+
ext/iText-4.2.0.jar
66
lib/pdf/stamper.rb
7-
lib/pdf/stamper/jruby.rb
87
lib/pdf/stamper/rjb.rb
98
spec/logo.gif
109
spec/pdf_stamper_spec.rb
11-
spec/test_template.pdf
10+
spec/test_template.pdf

README.txt renamed to README.md

+71-52
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,71 @@
1-
= pdf/stamper - PDF Templates, Wow!
2-
http://github.com/jaywhy/pdf-stamper/
3-
by Jason Yates
4-
5-
== DESCRIPTION:
6-
7-
Super cool PDF templates using iText's PdfStamper.
8-
9-
== CAVEAT:
10-
11-
Anything super cool must have a caveat. You have to use JRuby or RJB. Plus you
12-
can only use Adobe LiveCycle Designer to create the templates.
13-
14-
== EXAMPLE:
15-
pdf = PDF::Stamper.new("my_template.pdf")
16-
pdf.text :first_name, "Jason"
17-
pdf.text :last_name, "Yates"
18-
pdf.image :photo, "photo.jpg"
19-
pdf.save_as "my_output.pdf"
20-
21-
== INSTALL:
22-
23-
$ sudo gem install pdf-stamper
24-
25-
== CODE:
26-
27-
$ git clone http://github.com/jaywhy/pdf-stamper/
28-
29-
== LICENSE:
30-
31-
(The MIT License)
32-
33-
Copyright (c) 2007-2009 Jason Yates
34-
35-
Permission is hereby granted, free of charge, to any person obtaining
36-
a copy of this software and associated documentation files (the
37-
'Software'), to deal in the Software without restriction, including
38-
without limitation the rights to use, copy, modify, merge, publish,
39-
distribute, sublicense, and/or sell copies of the Software, and to
40-
permit persons to whom the Software is furnished to do so, subject to
41-
the following conditions:
42-
43-
The above copyright notice and this permission notice shall be
44-
included in all copies or substantial portions of the Software.
45-
46-
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
47-
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
48-
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
49-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
50-
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
51-
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
52-
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1+
# pdf/stamper - PDF Templates
2+
http://github.com/jaywhy/pdf-stamper/
3+
by Jason Yates
4+
5+
## Description
6+
7+
Fill out PDF forms (templates) using iText's PdfStamper.
8+
9+
## Example
10+
pdf = PDF::Stamper.new("my_template.pdf")
11+
12+
pdf.text :first_name, "Jason"
13+
pdf.text :last_name, "Yates"
14+
15+
pdf.image :photo, "photo.jpg"
16+
pdf.checkbox :hungry
17+
pdf.ellipse(140, 380, 50, 13)
18+
pdf.rectangle(140, 380, 50, 13)
19+
pdf.circle(140, 380)
20+
21+
pdf.save_as "my_output.pdf"
22+
23+
Here is how you use it in Rails.
24+
25+
# In your controller.
26+
def send
27+
pdf = PDF::Stamper.new("sample.pdf")
28+
pdf.text :first_name, "Jason"
29+
pdf.text :last_name, "Yates"
30+
send_data(pdf.to_s, :filename => "output.pdf", :type => "application/pdf",:disposition => "inline")
31+
end
32+
33+
## Installation
34+
35+
gem install pdf-stamper
36+
37+
## Code
38+
39+
40+
git clone http://github.com/jaywhy/pdf-stamper/
41+
42+
## Contributors
43+
44+
Paul Schreiber
45+
Joe Steele
46+
Ronny Hanssen
47+
48+
## License
49+
50+
(The MIT License)
51+
52+
Copyright (c) 2007-2012 Jason Yates
53+
54+
Permission is hereby granted, free of charge, to any person obtaining
55+
a copy of this software and associated documentation files (the
56+
'Software'), to deal in the Software without restriction, including
57+
without limitation the rights to use, copy, modify, merge, publish,
58+
distribute, sublicense, and/or sell copies of the Software, and to
59+
permit persons to whom the Software is furnished to do so, subject to
60+
the following conditions:
61+
62+
The above copyright notice and this permission notice shall be
63+
included in all copies or substantial portions of the Software.
64+
65+
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
66+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
67+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
68+
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
69+
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
70+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
71+
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Rakefile

+33-33
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,33 @@
1-
$:.unshift File.join(File.dirname(__FILE__), "lib")
2-
require 'pdf/stamper'
3-
require 'spec/rake/spectask'
4-
5-
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
6-
7-
$hoe = Hoe.new('pdf-stamper', PDF::Stamper::VERSION) do |p|
8-
p.name = 'pdf-stamper'
9-
p.author = 'Jason Yates'
10-
p.email = 'jaywhy@gmail.com'
11-
p.summary = "Super cool PDF templates using iText's PdfStamper."
12-
p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n")
13-
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
14-
p.extra_dev_deps = [
15-
['newgem', ">= #{::Newgem::VERSION}"]
16-
]
17-
18-
# p.spec_extras['platform'] = 'jruby' # JRuby gem created, e.g. pdf-stamper-X.Y.Z-jruby.gem
19-
20-
p.clean_globs |= %w[**/.DS_Store tmp *.log]
21-
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
22-
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
23-
p.rsync_args = '-av --delete --ignore-errors'
24-
end
25-
26-
require 'newgem/tasks' # load /tasks/*.rake
27-
Dir['tasks/**/*.rake'].each { |t| load t }
28-
29-
Spec::Rake::SpecTask.new do |t|
30-
t.spec_files = FileList['spec/*_spec.rb']
31-
t.warning = true
32-
t.rcov = false
33-
end
1+
$:.unshift File.join(File.dirname(__FILE__), "lib")
2+
require 'pdf/stamper'
3+
require 'spec/rake/spectask'
4+
5+
%w[rubygems rake rake/clean fileutils newgem rubigen].each { |f| require f }
6+
7+
$hoe = Hoe.new('pdf-stamper', PDF::Stamper::VERSION) do |p|
8+
p.name = 'pdf-stamper'
9+
p.author = 'Jason Yates'
10+
p.email = 'jaywhy@gmail.com'
11+
p.summary = "PDF templates using iText's PdfStamper."
12+
p.description = p.paragraphs_of('README.md', 2..5).join("\n\n")
13+
p.changes = p.paragraphs_of("History.txt", 0..1).join("\n\n")
14+
p.extra_dev_deps = [
15+
['newgem', ">= #{::Newgem::VERSION}"]
16+
]
17+
18+
# p.spec_extras['platform'] = 'jruby' # JRuby gem created, e.g. pdf-stamper-X.Y.Z-jruby.gem
19+
20+
p.clean_globs |= %w[**/.DS_Store tmp *.log]
21+
path = (p.rubyforge_name == p.name) ? p.rubyforge_name : "\#{p.rubyforge_name}/\#{p.name}"
22+
p.remote_rdoc_dir = File.join(path.gsub(/^#{p.rubyforge_name}\/?/,''), 'rdoc')
23+
p.rsync_args = '-av --delete --ignore-errors'
24+
end
25+
26+
require 'newgem/tasks' # load /tasks/*.rake
27+
Dir['tasks/**/*.rake'].each { |t| load t }
28+
29+
Spec::Rake::SpecTask.new do |t|
30+
t.spec_files = FileList['spec/*_spec.rb']
31+
t.warning = true
32+
t.rcov = false
33+
end

0 commit comments

Comments
 (0)