Project

pdf-burst

0.0
No commit activity in last 3 years
No release in over 3 years
Creates a PDF for each page from a PDF with multiple pages. Uses Ghostscript for the actual bursting. You'll need the following commands available on your system: gs (Ghostscript), pdfinfo (Poppler), grep and convert (ImageMagick) if you want thumbnails.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 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, 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 for letting us release this as open-source.

License

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