Skip to content

Instantly share code, notes, and snippets.

@masonjm
masonjm / zpl armband
Created May 23, 2014 19:52
Example of printing an armband to a ZPL printer.
class Armband
def initialize(encounter, options = {})
@encounter = encounter
end
def to_zpl(format)
# Units are in dots
zpl = "^XA" # ZPL Begin
zpl << "^LH0,0" # Home position X, Y
zpl << "^PON" # Print orientation normal
@chrisjacob
chrisjacob / Gemfile
Last active February 6, 2020 08:26
Simple guide to integrating Pages v1.0.0 with Rails v4.1.1
gem 'rails', '4.1.1'
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'
gem 'jquery-turbolinks'
# Gems for twitter LESS -> CSS and JS support
gem 'execjs'
@fidothe
fidothe / pdfx.rb
Last active October 10, 2023 15:57
Worked example for creating a PDF/X-1a:2003 document with Prawn
require 'prawn'
require 'prawn/measurements'
# I have a small collection of links to the resources I used to figure all
# this out: http://pinboard.in/u:fidothe/t:pdfx
module PDFX
class PageBox
include Prawn::Measurements
attr_reader :bleed_mm