PdfColoredPages
Ruby Gem to check which pages of a pdf contain color and output those.
Installation
Add this line to your application's Gemfile:
gem 'pdf_colored_pages'
And then execute:
$ bundle
Or install it yourself as:
$ gem install pdf_colored_pages
Usage
As Array:
PdfColoredPages.as_array(/path/to/pdf.pdf)
# returns [1,3,4]
As Range String:
PdfColoredPages.as_range_string(/path/to/pdf.pdf)
# returns: 1,3-4
Shell:
$ pdf_colored_pages ./path/to/pdf.pdf
# outputs 1,3-4
Just Check:
PdfColoredPages.colored_pages?(/path/to/pdf.pdf)
# returns: true or false
Test:
$ rake test
Contributing
- Fork it ( https://github.com/RedRoosterMobile/pdf-colored-pages/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request