Note that html2ps is a Perl script, so you??™ll need Perl installed to run it. (Linux and OS X
typically include Perl by default, but you can get a free Perl distribution at http://
activeperl.com.)
You can download html2ps from here:
http://user.it.uu.se/~jan/html2ps.html
CHAPTER 8 n CREATING SALES PERFORMANCE REPORTS WITH SUGARCRM 157
You can get Ghostscript from the following site:
http://pages.cs.wisc.edu/~ghost/
Finally, since html2ps needs HTML to work with, you??™ll use Erubis to create your
HTML document using Rails-like RHTML templates. You can install Erubis using the following
command:
gem install erubis
nTip Erubis is an eRuby implementation. eRuby is a generic term for Ruby embedded in HTML, just as you
would use in a Rails application. However, Erubis is faster than the ERB library used by Rails and has more
features. You can learn more about Erubis in my Apress book, Practical Ruby Gems, as well as from the
Erubis web site (http://www.kuwata-lab.com/erubis/).
The script to create the PDF report is shown in Listing 8-2.
Pages:
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229