Code Monkey home page Code Monkey logo

ember-js-pdf's Introduction

Build Status Ember Observer Score

ember-js-pdf

Generate, render, and save PDF files in the browser with jsPDF. See examples of jsPDF.

Installation

  • ember install ember-js-pdf

Usage

Render a PDF from an Array of steps:

{{js-pdf steps filename="tomster-facts"}}

Where:

export Default Controller.extend({
  steps: [
    {setFontSize: 40},
    {text: [35, 25, 'Tomsters loves jsPDF']}
  ]
});

Steps are arrays of PDF rendering commands with an array of arguments. All PDF rendering commands are listed here, with additional documentation of their arguments here.

Saving PDFs:

{{#js-pdf steps as |pdf|}}
  <button {{action pdf.save}}>Download PDF</button>
{{/js-pdf}}

Rendering from a URL:

{{js-pdf src="https://bitcoin.org/bitcoin.pdf"}}

Misc Options

Property Type Default Available
orientation String p portrait, landscape, p, l
unit String mm pt, mm, cm, in
format String a4 a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, b10, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, c10, dl, letter, government-letter, legal, junior-legal, ledger, tabloid, credit-card
compressPdf Boolean false true, false

Contributing

  • git clone <repository-url> this repository
  • cd ember-js-pdf
  • npm install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit https://ember-cli.com/.

ember-js-pdf's People

Contributors

0000marcell avatar ember-tomster avatar matt-jensen avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.