Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtgrosser/pdfunite
Merge PDF files with Ruby, no Java required
https://github.com/mtgrosser/pdfunite
joining-pdf-files pdf pdf-files pdfunite ruby
Last synced: 3 months ago
JSON representation
Merge PDF files with Ruby, no Java required
- Host: GitHub
- URL: https://github.com/mtgrosser/pdfunite
- Owner: mtgrosser
- License: mit
- Created: 2014-11-05T15:01:03.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-04-21T21:29:18.000Z (almost 2 years ago)
- Last Synced: 2024-10-31T13:31:14.500Z (3 months ago)
- Topics: joining-pdf-files, pdf, pdf-files, pdfunite, ruby
- Language: Ruby
- Size: 118 KB
- Stars: 38
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![Gem Version](https://badge.fury.io/rb/pdfunite.svg)](http://badge.fury.io/rb/pdfunite)
[![build](https://github.com/mtgrosser/pdfunite/actions/workflows/build.yml/badge.svg)](https://github.com/mtgrosser/pdfunite/actions/workflows/build.yml)
# PdfuniteMerge 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:
```ruby
# Gemfile
gem 'pdfunite'
```## Usage
```ruby
# 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
```ruby
# 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')
```