clamsy

Ruby wrapper for generating a single pdf for multiple contexts from an odt template.

clamsy = clumsy + shellish
          |        |
          |        |-- under the hood, we are making system calls like ooffice,
          |            ps2pdf & pdf2ps, etc.
          |
          .-- setup isn't straight forward, need to install a couple of packages
              (how bad it is depends on ur platform) & even manual setting up of
              cups printer is needed

Using It (sorry, still WIP for more decent examples)

#1. Generating single context pdf:

Clamsy.process(
  {:someone => 'Peter', :mood => 'Happy'},
  path_to_template_odt,
  path_to_final_pdf
)

#2. Generating multi-contexts pdf:

Clamsy.process(
  [
    {:someone => 'Peter', :mood => 'Happy'},
    {:someone => 'Jane', :mood => 'Sad'}
  ],
  path_to_template_odt,
  path_to_final_pdf
)

Pre-requisites

#1. Archlinux

* Installing packages:
  $ sudo pacman -S ghostscript cups cups-pdf go-openoffice

* Setting up the cups-pdf virtual printer by following instructions @
  http://wiki.archlinux.org/index.php/CUPS#Configuring_CUPS-PDF_virtual_printer

* Making sure cups is running:
  $ sudo /etc/rc.d/cups start

#2. Ubuntu (to-be-updated)

#3. Mac (to-be-updated)

TODO

  • add support for configuration, eg. Clamsy.configure {|config| … }

  • automate cups-pdf printer setup

  • avoid making system call to ‘ooffice’

Note on Patches/Pull Requests

  • Fork the project.

  • Make your feature addition or bug fix.

  • Add tests for it. This is important so I don’t break it in a future version unintentionally.

  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)

  • Send me a pull request. Bonus points for topic branches.

Contacts

Written 2010 by:

#1. NgTzeYang, contact ngty77gmail.com or github.com/ngty

Released under the MIT license