{"id":13588950,"url":"https://github.com/prawnpdf/pdf-inspector","last_synced_at":"2025-05-16T15:09:50.335Z","repository":{"id":425263,"uuid":"45314","full_name":"prawnpdf/pdf-inspector","owner":"prawnpdf","description":"A collection of PDF::Reader based analysis classes for inspecting PDF output.   Mainly used for testing Prawn, but will work with any PDF.","archived":false,"fork":false,"pushed_at":"2022-02-09T17:38:14.000Z","size":98,"stargazers_count":157,"open_issues_count":8,"forks_count":33,"subscribers_count":31,"default_branch":"master","last_synced_at":"2025-05-14T15:05:18.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://prawnpdf.org","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prawnpdf.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-08-23T17:38:44.000Z","updated_at":"2025-04-11T22:24:04.000Z","dependencies_parsed_at":"2022-07-05T13:31:11.807Z","dependency_job_id":null,"html_url":"https://github.com/prawnpdf/pdf-inspector","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prawnpdf%2Fpdf-inspector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prawnpdf%2Fpdf-inspector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prawnpdf%2Fpdf-inspector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prawnpdf%2Fpdf-inspector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prawnpdf","download_url":"https://codeload.github.com/prawnpdf/pdf-inspector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254553959,"owners_count":22090417,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T16:00:15.360Z","updated_at":"2025-05-16T15:09:45.327Z","avatar_url":"https://github.com/prawnpdf.png","language":"Ruby","funding_links":[],"categories":["RUBY","Ruby"],"sub_categories":[],"readme":"# PDF::Inspector: A tool for analyzing PDF output\n\n![Maintained: yes](https://img.shields.io/badge/maintained-yes-brightgreen.svg)\n![Build status](https://github.com/prawnpdf/pdf-inspector/workflows/ci/badge.svg)\n\nThis library provides a number of [PDF::Reader][0] based tools for use in\ntesting PDF output.  Presently, the primary purpose of this tool is to support\nthe tests found in [Prawn][1], a pure Ruby PDF generation library.\n\nHowever, it may be useful to others, so we have made it available as a gem in\nits own right.\n\n## Installation\n\nThe recommended installation method is via Rubygems.\n\n```console\ngem install pdf-inspector\n```\n\nOr put this in your Gemfile, if you use [Bundler][2]:\n\n```ruby\ngroup :test do\n  gem 'pdf-inspector', require: \"pdf/inspector\"\nend\n```\n\n## Usage\n\nCheck for text in the generated PDF:\n\n```ruby\nrendered_pdf = your_pdf_document.render\ntext_analysis = PDF::Inspector::Text.analyze(rendered_pdf)\ntext_analysis.strings # =\u003e [\"foo\"]\n```\n\nNote that `strings` returns an array containing one string for each text drawing\noperation in the PDF. As a result, sentences and paragraphs will often be\nreturned in fragments. To test for the presence of a complete sentence or a\nlonger string, join the array together with an operation like `full_text =\ntext_analysis.strings.join(\" \")`.\n\nCheck number of pages\n\n```ruby\nrendered_pdf = your_pdf_document.render\npage_analysis = PDF::Inspector::Page.analyze(rendered_pdf)\npage_analysis.pages.size # =\u003e 2\n```\n\n## Licensing\n\nMatz’s terms for Ruby, GPLv2, or GPLv3. See LICENSE for details.\n\n## Mailing List\n\npdf-inspector is maintained as a dependency of Prawn, the ruby PDF generation\nlibrary.\n\nAny questions or feedback should be sent to the [Prawn google group][3].\n\n## Authorship\n\npdf-inspector was originally developed by Gregory Brown as part of the Prawn[1]\nproject. In 2010, Gregory officially handed the project off to the Prawn core\nteam. Currently active maintainers include Brad Ediger, Daniel Nelson, James\nHealy, and Jonathan Greenberg.\n\nYou can find the full list of Github users who have at least one patch accepted\nto pdf-inspector on [GitHub Contributors page][4].\n\n\n\n[0]: https://github.com/yob/pdf-reader\n[1]: https://github.com/prawnpdf/prawn\n[2]: https://bundler.io/\n[3]: https://groups.google.com/group/prawn-ruby\n[4]: https://github.com/prawnpdf/pdf-inspector/contributors\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprawnpdf%2Fpdf-inspector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprawnpdf%2Fpdf-inspector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprawnpdf%2Fpdf-inspector/lists"}