
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
Mindee's fork of the popular Origami library.
Origami is a framework written in pure Ruby to manipulate PDF files.
It offers the possibility to parse the PDF contents, modify and save the PDF structure, as well as creating new documents.
Origami supports some advanced features of the PDF specification:
Origami is able to parse PDF, FDF and PPKLite (Adobe certificate store) files.
The following Ruby versions are tested and supported: 3.0, 3.1, 3.2, 3.3, 3.4
(It could maybe, possibly, in some cases run on Ruby 2.7, but no guarantees. Update your stack.)
Some optional features require additional gems:
First install Origamindee (this fork) using the latest gem available:
$ gem install origamindee
You'll need to import it under the original name:
require 'origami'
To process a PDF document, you can use the PDF.read method:
pdf = Origami::PDF.read "something.pdf"
puts "This document has #{pdf.pages.size} page(s)"
The default behavior is to parse the entire contents of the document at once.
This can be changed by passing the lazy flag to parse objects on demand.
pdf = Origami::PDF.read "something.pdf", lazy: true
pdf.each_page do |page|
page.each_font do |name, font|
# ... only parse the necessary bits
end
end
You can also create documents directly by instantiating a new PDF object:
pdf = Origami::PDF.new
pdf.append_page
pdf.pages.first.write "Hello", size: 30
pdf.save("example.pdf")
# Another way of doing it
Origami::PDF.write("example.pdf") do |pdf|
pdf.append_page do |page|
page.write "Hello", size: 30
end
end
Take a look at the examples and bin directories for some examples of advanced usage.
Origami comes with a set of tools to manipulate PDF documents from the command line.
Note: Since version 2.1, pdfwalker has been moved to a separate repository.
We were using the excellent Origami library for our Ruby OCR client library.
Unfortunately, it seems the Origami project is now inactive, and as we needed to add Ruby 3.0 support, the decision was made to fork Origami.
We also noticed that the colorize library is licensed under GPL, meaning that Origami cannot be licensed under the LGPL.
It was therefore replaced by Rainbow which has similar functionality, and is licensed under MIT.
Furthermore, we are now in a better position to fix any problems related to PDF parsing that are encountered by our users.
As such it is our intention to support functionalities within the scope of our Ruby client library.
We do not claim to be an official successor to Origami.
Origami is distributed under the LGPL license.
Copyright © 2019 Guillaume Delugré
Copyright © 2022 Mindee, SA
FAQs
Unknown package
We found that origamindee demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers 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
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.