0.0
The project is in a healthy, maintained state
Add gridlines to PDF documents
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.0.0
~> 2.5.0
 Project Readme

gridify_pdf

This is a tool that I wrote to lay a grid over PDF files.

I was working on an app that adds text boxes to PDFs using Prawn and CombinePDF. I got frustrated with the guess-and-check method to find the right coordinates.

Given a PDF that looks like this:

A PDF without a grid overlay

It will make this:

A PDF with a grid overlay

Installation

This can be installed with RubyGems:

gem install gridify_pdf

CLI

This is primarily intended to be used as a CLI tool

This will read the file at document.pdf and output a version with a grid overlay at gridified_document.pdf.

gridify_pdf document.pdf gridified_document.pdf

You can also have the PDF written to a temporary file and opened in your default PDF viewer:

gridify_pdf document.pdf --open

Usage in code

If, for some reason, you want to use this tool in your own code, that is also possible:

require 'gridify_pdf'

input = File.read('input.pdf')
result = GridifyPdf::Gridifier.new(input).gridify
File.write('output.pdf', result)