
Product
Introducing Socket Firewall Enterprise: Flexible, Configurable Protection for Modern Package Ecosystems
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.
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.
As of version 2, the minimal version required to run Origami is Ruby 2.1.
Some optional features require additional gems:
First install Origami using the latest gem available:
$ gem install origami
Then import Origami with:
require 'origami'
include Origami
To process a PDF document, you can use the PDF.read method:
pdf = 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 = 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 instanciating a new PDF object:
pdf = PDF.new
pdf.append_page
pdf.pages.first.write "Hello", size: 30
pdf.save("example.pdf")
# Another way of doing it
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.
Origami is distributed under the LGPL license.
Copyright © 2017 Guillaume Delugré.
FAQs
Unknown package
We found that origami 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.

Product
Socket Firewall Enterprise is now available with flexible deployment, configurable policies, and expanded language support.

Security News
Open source dashboard CNAPulse tracks CVE Numbering Authorities’ publishing activity, highlighting trends and transparency across the CVE ecosystem.

Product
Detect malware, unsafe data flows, and license issues in GitHub Actions with Socket’s new workflow scanning support.