Project

stamp-it

0.0
No commit activity in last 3 years
No release in over 3 years
Add watermarks to existing PDF files, the easy way.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0
>= 0

Runtime

>= 0
>= 0
 Project Readme

Stamp It

StampIt allows you to add watermarks to existing PDF files. In a very easy way. This gem will be very helpful whenever you need to add a dynamic watermark to any PDF file. Internally, it uses the Prawn gem to generate the watermark template file. And then it uses the pdftk binary to add the watermark template file as a background to an existing PDF file. So, you need to have the pdftk binary installed on your application's server.

Installation

  1. Add the following line to your Rails application's Gemfile:
  gem 'stamp-it', require: 'stamp_it'
  1. Optionally, you can add the following gem to have access to the pdftk binaries.
  gem 'pdftk-binary'

Usage

  1. First you will need to create the watermark template file:
  wm_template_path = StampIt::Watermark.create('/path/to/wm_template.pdf', 'Message to add as a Watermark.')
  1. Add the watermark template as background to an existing PDF file:
  StampIt::Background.add('/path/to/existing.pdf', wm_template_path, '/path/to/watermarked.pdf')
  1. That's it, you will generate a watermarked file.

Contributing

Pull Requests are welcome! Just fork the repo, add your code and open a PR.