Skip to content

Ruby wrapper for the pdfinfo unix tool.

License

Notifications You must be signed in to change notification settings

Granicus/pdf_info

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"

About

Ruby wrapper for the pdfinfo unix tool.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Ruby 100.0%