Jpdfunite
TODO: Write a gem description
Installation
Add this line to your application's Gemfile:
gem 'jpdfunite'
And then execute:
$ bundle
Or install it yourself as:
$ gem install jpdfunite
This depends on the following:
Poppler-utils for finding length of PDF
(pdfinfo) and merging PDF files (pdfunite) (GPLv3)
Java for running JPDFBookmarks
JPDFBookmarks for adding bookmarks to PDF (GPLv3)
jpdfbookmarks must be in your path, so download it and symlink it to
/usr/local/bin or add it to .profile.
Usage
This provides three objects and two methods, PdfFile, Section and Outline.
Outline represents the complete output file and Section represents a
section. Here is an example that combines three PDF files into one:
require 'jpdfunite'
file_one = Jpdfunite::PdfFile.new("lab7markup.pdf")
file_two = Jpdfunite::PdfFile.new("macorm.pdf")
file_three = Jpdfunite::PdfFile.new("discrete_math_textbook.pdf")
sec_one = Jpdfunite::Section.new("Section One")
sec_two = Jpdfunite::Section.new("Section Two")
document = Jpdfunite::Outline.new("Combined Files")
sec_one.add_mark(file_one)
sec_one.add_mark(file_two)
sec_two.add_mark(file_three)
document.add_mark(sec_one)
document.add_mark(sec_two)
outfile = Jpdfunite::combine(document)
Jpdfunite::outline(outfile, document)
Contributing
- Fork it ( https://github.com/[my-github-username]/jpdfunite/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