No release in over 3 years
Low commit activity in last 3 years
Wraps the pdfinfo command line tool to provide a hash of metadata
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0
~> 2.12.0
 Project Readme

pdf_info

Very simple wrapper to the pdfinfo unix tool, to provide the metadata information as a hash.

Build Status Code Climate

Usage

require 'pdf/info'
info = PDF::Info.new('/Users/tom/tmp/magazine.pdf')
pp info.metadata

Gives you the following output:

{
    :version => 1.3,
    :pages => [
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17],
        [819.213, 1077.17]
    ],
    :page_count => 12,
    :encrypted => false
}

Each of the pages has an individual size in PDF points - that's just how PDFs are. If you want more of the metadata that pdfinfo outputs, send us a patch.

If you need to manually set the path to the pdfinfo binary:

PDF::Info.command_path = "/usr/local/bin/pdfinfo"