Project

pdfunite

0.02
Low commit activity in last 3 years
No release in over a year
A Ruby wrapper for the pdfunite command line tool
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Gem Version build

Pdfunite

Merge PDF files with Ruby.

Pdfunite is a Ruby wrapper for the pdfunite command line tool. No Java required.

Installation

Pdfunite requires the pdfunite command line tool, which uses the poppler library.

Linux

Install the poppler-utils package using your package manager.

OS X

Install poppler using Homebrew.

In your app

Add this line to your application's Gemfile:

# Gemfile
gem 'pdfunite'

Usage

# Join existing PDF files
pdf_data = Pdfunite.join('file1.pdf', 'file2.pdf', 'file3.pdf')
File.open('joined.pdf', 'wb') { |f| f << pdf_data }

# Join PDF binary data provided by a collection of objects
pdf_data = Pdfunite.join(objects) { |obj| obj.to_pdf }

Optional configuration

# Set pdfunite binary (defaults to the binary on PATH)
Pdfunite.binary = '/opt/local/bin/pdfunite'

# Set custom logger (defaults to STDOUT)
Pdfunite.logger = Logger.new('pdfunite.log')