Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pdf_info

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pdf_info

  • 0.5.3
  • Rubygems
  • Socket score

Version published
Maintainers
2
Created
Source

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"

FAQs

Package last updated on 11 May 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc