All Projects → gdelugre → Origami

gdelugre / Origami

Licence: lgpl-3.0
Origami is a pure Ruby library to parse, modify and generate PDF documents.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to Origami

Choetl
ETL Framework for .NET / c# (Parser / Writer for CSV, Flat, Xml, JSON, Key-Value, Parquet, Yaml, Avro formatted files)
Stars: ✭ 372 (+58.97%)
Mutual labels:  parser, writer
Pdfminer.six
Community maintained fork of pdfminer - we fathom PDF
Stars: ✭ 3,250 (+1288.89%)
Mutual labels:  parser, pdf
Traprange
(Java)A Method to Extract Tabular Content from PDF Files
Stars: ✭ 236 (+0.85%)
Mutual labels:  parser, pdf
Php Svg Lib
SVG file parsing / rendering library
Stars: ✭ 1,146 (+389.74%)
Mutual labels:  parser, pdf
Cppast.net
CppAst is a .NET library providing a C/C++ parser for header files powered by Clang/libclang with access to the full AST, comments and macros
Stars: ✭ 228 (-2.56%)
Mutual labels:  parser
Books
Awesome Books
Stars: ✭ 3,242 (+1285.47%)
Mutual labels:  pdf
Rss
Library for serializing the RSS web content syndication format
Stars: ✭ 223 (-4.7%)
Mutual labels:  parser
Ledgersmb
Repository for the LedgerSMB project -- web app for accounting & ERP
Stars: ✭ 222 (-5.13%)
Mutual labels:  pdf
Svg2pdf.js
A javascript-only SVG to PDF conversion utility that runs in the browser. Brought to you by yWorks - the diagramming experts
Stars: ✭ 231 (-1.28%)
Mutual labels:  pdf
Rusty Blockparser
Bitcoin Blockchain Parser written in Rust language
Stars: ✭ 226 (-3.42%)
Mutual labels:  parser
Node Signpdf
Simple signing of PDFs in node.
Stars: ✭ 226 (-3.42%)
Mutual labels:  pdf
Gotenberg
A Docker-powered stateless API for PDF files.
Stars: ✭ 3,272 (+1298.29%)
Mutual labels:  pdf
Pagedjs
Display paginated content in the browser and generate print books using web technology
Stars: ✭ 228 (-2.56%)
Mutual labels:  pdf
Wiktionaryparser
A Python Wiktionary Parser
Stars: ✭ 224 (-4.27%)
Mutual labels:  parser
Android Pdfmyxml
convert android xml layouts into PDF document, works on all versions of Android.
Stars: ✭ 231 (-1.28%)
Mutual labels:  pdf
Pdf Lib
Create and modify PDF documents in any JavaScript environment
Stars: ✭ 3,426 (+1364.1%)
Mutual labels:  pdf
Laravel Book
Up to date Epub, Mobi and PDF versions from the official Laravel Docs
Stars: ✭ 221 (-5.56%)
Mutual labels:  pdf
Pdf Bot
🤖 A Node queue API for generating PDFs using headless Chrome. Comes with a CLI, S3 storage and webhooks for notifying subscribers about generated PDFs
Stars: ✭ 2,551 (+990.17%)
Mutual labels:  pdf
Mayan Edms
Free Open Source Document Management System (mirror, no pull request or issues)
Stars: ✭ 226 (-3.42%)
Mutual labels:  pdf
Best Resume Ever
👔 💼 Build fast 🚀 and easy multiple beautiful resumes and create your best CV ever! Made with Vue and LESS.
Stars: ✭ 15,124 (+6363.25%)
Mutual labels:  pdf

Origami

Gem Version Downloads Build Status License: LGPL v3

Overview

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:

  • Compression filters with predictor functions
  • Encryption using RC4 or AES, including the undocumented Revision 6 derivation algorithm
  • Digital signatures and Usage Rights
  • File attachments
  • AcroForm and XFA forms
  • Object streams

Origami is able to parse PDF, FDF and PPKLite (Adobe certificate store) files.

Requirements

As of version 2, the minimal version required to run Origami is Ruby 2.1.

Some optional features require additional gems:

Quick start

First install Origami using the latest gem available:

$ gem install origami

Then import Origami with:

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 instanciating 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.

Tools

Origami comes with a set of tools to manipulate PDF documents from the command line.

  • pdfcop: Runs some heuristic checks to detect dangerous contents.
  • pdfdecompress: Strips compression filters out of a document.
  • pdfdecrypt: Removes encrypted contents from a document.
  • pdfencrypt: Encrypts a PDF document.
  • pdfexplode: Explodes a document into several documents, each of them having one deleted resource. Useful for reduction of crash cases after a fuzzing session.
  • pdfextract: Extracts binary resources of a document (images, scripts, fonts, etc.).
  • pdfmetadata: Displays the metadata contained in a document.
  • pdf2ruby: Converts a PDF into an Origami script rebuilding an equivalent document (experimental).
  • pdfsh: An IRB shell running inside the Origami namespace.

Note: Since version 2.1, pdfwalker has been moved to a separate repository.

License

Origami is distributed under the LGPL license.

Copyright © 2019 Guillaume Delugré.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].