Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kiskolabs/pdf-burst

Bursts a PDF into single page files.
https://github.com/kiskolabs/pdf-burst

Last synced: about 5 hours ago
JSON representation

Bursts a PDF into single page files.

Awesome Lists containing this project

README

        

# PDF::Burst

## What?

PDF::Burst is a gem that lets you split a PDF document with several pages into single page files.

## Why?

We needed this functionality for the development of [Lehtilompakko](http://lehtilompakko.fi/), and did not want any Java app to do the job.

## How?

Simple! Once you install the 'pdf-burst' gem, all you need is:

require 'pdf-burst'
PDF::Burst.new("/path/to/my/document.pdf").run!

By default, the PDF files will be output to your current working directory. But that's not what you want, is it?

PDF::Burst.new("document.pdf", :output => "/tmp").run!

Better, huh?

Another default is the page name. They'll all be nicely named like "page_1.pdf", "page_2.pdf". We let you change that too:

PDF::Burst.new("document.pdf", :filename => "doc.%04d").run!

Would output them like this: "doc.0001.pdf", "doc.0002.pdf", etc.

If you want thumbnails to be generated for each page, just use the thumbnail option with the thumbnail size.

PDF::Burst.new("document.pdf", :thumbnail => "128x128").run!

This requires ImageMagick to be installed, as it uses the 'convert' command.

## Special thanks

Thanks to [Hopeinen Norsu](http://hopeinennorsu.fi/) for letting us release this as open-source.

## License

Check the LICENSE file. It's the MIT license.