|
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. |
0 commit comments