Are you happy with your logging solution? Would you help us out by taking a 30-second survey? Click here


A collection of PDF::Reader based analysis classes for inspecting PDF output. Mainly used for testing Prawn, but will work with any PDF.

Subscribe to updates I use pdf-inspector

Statistics on pdf-inspector

Number of watchers on Github 0
Number of open issues 0
Main language Ruby
Open pull requests 0+
Closed pull requests 0+
Last commit about 6 years ago
Repo Created about 6 years ago
Repo Last Updated almost 2 years ago
Size 143 KB
Homepage http://prawn.maje...
Organization / Authorstitchfix
Page Updated
Do you use pdf-inspector? Leave a review!
View pdf-inspector activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Trendy new open source projects in your inbox! View examples

Subscribe to our mailing list

Evaluating pdf-inspector for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

PDF::Inspector : A tool for analyzing PDF output

This library provides a number of PDF::Reader0 based tools for use in testing PDF output. Presently, the primary purpose of this tool is to support the tests found in Prawn1, a pure Ruby PDF generation library.

However, it may be useful to others, so we have made it available as a gem in its own right.


The recommended installation method is via Rubygems.

gem install pdf-inspector

Or put this in your Gemfile, if you use Bundler2:

group :test do
  gem 'pdf-inspector', :require => "pdf/inspector"


Check for text in the generated PDF:

rendered_pdf = your_pdf_document.render
text_analysis = PDF::Inspector::Text.analyze(rendered_pdf)
text_analysis.strings.should include("foo")

Note that strings is more like a list of words, and any string with a hyphen will be split up as two different entries.

Check number of pages

rendered_pdf = your_pdf_document.render
page_analysis = PDF::Inspector::Page.analyze(rendered_pdf)
page_analysis.pages.size.should == 2


Matzs terms for Ruby, GPLv2, or GPLv3. See LICENSE for details.

Mailing List

pdf-inspector is maintaiend as a dependency of prawn, the ruby PDF generation library.

Any questions or feedback should be sent to the Prawn google group.


pdf-inspector was originally developed by Gregory Brown as part of the Prawn1 project. In 2010, Gregory officially handed the project off to the Prawn core team. Currently active maintainers include Brad Ediger, Daniel Nelson, James Healy, and Jonathan Greenberg.

You can find the full list of Github users who have at least one patch accepted to pdf-inspector at:


pdf-inspector list of languages used
Other projects in Ruby