Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prawml

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prawml

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Prawml

TODO: Write a gem description

Installation

Add this line to your application's Gemfile:

gem 'prawml'

And then execute:

$ bundle

Or install it yourself as:

$ gem install prawml

Usage

Describe in an yaml file the fields and its xpos, ypos and style/type options:

# example.yml
text1:
  - [250, 680, {style: bold, align: center, size: 96, font: 'Helvetica'}]
  - [220, 0]
text2: [415, 660, {style: italic, size: 16,align: right, color: '123456'}]
barcode1: [100, 15, {type: 'barcode', symbology: 'code_25_interleaved'}]

PDF generation example:

pdf = Prawml::PDF.new('path_to_yaml/example.yml')
pdf.generate({
    :text1 => 'Prawml',
    :text2 => 'The pdf generator',
    :barcode1 => 'My little barcode string'
}).render_file('example.pdf')

You can also pass an object that responds to methods described in YAML file.

Available options:

  • type: text|image|barcode [text]
  • color: RGB color [00000]
  • fixed: A fixed text. Ignores values and renders the static text informed [false]
Text specific options:
  • font: Any Prawn supported font can be used [Times-Roman]
  • align: left|center|right [left]
  • size: float [12]
  • style: bold|normal|italic|bold_italic [normal]
  • format: Formating hooks (currency|date) [false]
Barcode specific options:
  • symbology: Symbologies available in barby gem seen here [nil]

Contributors

  1. Wanderson Policarpo (http://github.com/wpolicarpo)
  2. Edson Júnior (http://github.com/ebfjunior)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 29 Feb 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc