
Security News
New Website “Is It Really FOSS?” Tracks Transparency in Open Source Distribution Models
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
pdf-reader-extract-images
Advanced tools
ExtractImages
Based upon the Example from Pdf::Reader, battle hardened in our applicant tracking system with tens of thousands of PDFs.
Add this line to your application's Gemfile:
gem 'pdf-reader-extract-images'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install pdf-reader-extract-images
require 'pdf-reader-extract-images'
reader = PDF::Reader.new(pdf)
images = Pdf::Reader::ExtractImages.extract_all(reader)
# pass an image limit to ignore gigantic image-only pdfs
images = Pdf::Reader::ExtractImages.extract_all(reader, limit: 50)
# [
# {
# :filename => "1-1-Im1.jpg",
# :width => 1772,
# :height => 591
# :blob => "....",
# }
# ]
# OR you can just scan a single Pdf::Reader Page
reader.pages.each do |page|
images = Pdf::Reader::ExtractImages.extract_from_pdf_page(page)
end
There are some PDFs which have tons of images. Make sure to limit the timeout of an extraction somehow.
Also some PDFs product hundreds of images. Make sure to limit further processing down the line
Unfortunately, there is no public test suite. We have a private test suite that tests live pdfs which we cannot share. If you'd like to contribute problematic PDFs, feel free to open PR!
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that pdf-reader-extract-images demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
A new site reviews software projects to reveal if they’re truly FOSS, making complex licensing and distribution models easy to understand.
Security News
Astral unveils pyx, a Python-native package registry in beta, designed to speed installs, enhance security, and integrate deeply with uv.
Security News
The Latio podcast explores how static and runtime reachability help teams prioritize exploitable vulnerabilities and streamline AppSec workflows.