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

prawn-shadings

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prawn-shadings

  • 0.1.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Prawn Shadings

Build Status

This is a Prawn extension that implements advanced PDF shadings.

Specifically, it a bit refactors already implemented linear and radial gradients and adds a few more advanced ones.

Currently implemented shadings:

  • Axial Shadings (or linear gradients) (PDF Type 2 Shading)
  • Radial Shading (PDF Type 3 Shading)
  • Free-Form Gouraud-Shaded Triangle Meshes (PDF Type 4 Shading)
  • Lattice-Form Gouraud-Shaded Triangle Meshes (PDF Type 5 Shading)
  • Coons Patch Meshes (PDF Type 6 Shading)
  • Tensor-Product Patch Meshes (PDF Type 7 Shading)

API is simple but you need to know what data to supply. Please get familiar with Section 4.6.3 of PDF Reference.

A Word of Warning

Please note that this gem gives you ability use all these shadings in your generated PDF but gives no guarantee that PDF will be rendered correctly.

Just a few examples:

  • OS X Preview has problems with flags other than 0 in Type 4, 6 and 7 type shadings.
  • OS X Previews renders Type 7 shadings exactly the same as Type 6 shadings ignoring all 4 extra control points.
  • PDF.js can not render pretty much any of these.

Installation

gem install prawn-shadings

Usage

require 'prawn/shadings'

Testing

To run the tests:

$ rake

Contributing

  1. Fork it.
  2. Create a branch (git checkout -b my_shading)
  3. Commit your changes (git commit -am "Added Shading")
  4. Push to the branch (git push origin my_shading)
  5. Open a Pull Request

FAQs

Package last updated on 18 Feb 2014

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