Giter Club home page Giter Club logo

meteor-pdfkit's Introduction

PDFKit

Create PDF with PDFKit node package on your Meteor application, server side only.

Quick Start

  1. npm install -g meteorite (if not already installed)
  2. mrt add pdfkit
  3. Exemple:
var doc = new PDFDocument({size: 'A4', margin: 50});
var imageBase64 = Meteor.users.findOne(this.userId).profile.picture;
var imageBuffer2 = new Buffer(imageBase64.replace('data:image/png;base64,','') || '', 'base64');
doc.image(imageBuffer2, 10, 10, {height: 75});
doc.fontSize(12);
doc.text('PDFKit is simple', 10, 30, {align: 'center', width: 200});
// Save it on myApp/public/pdf folder (or any place) with the Fibered sync methode:
doc.writeSync(process.env.PWD + '/public/pdf/PDFKitExample.pdf);

Documentation

You can find informations about PDFKit node package here:

This package add two Fibered methodes (non blocking thread, but synchronous):

  • writeSync(filename): saving the PDF in filename (can be a full path)
  • outputSync(): returning the PDF as binary String

Contributing

Contributors are very welcome. There are many things you can help with, including adding testing feature, creating examples for the examples folder... Some guidelines below:

  • Questions: It's okay to ask a question on Github Issues if you're having trouble since the volume is manageable. Just prefix your Github Issue with 'Question: ' so we can differentiate easily. Also, please make sure you've read through PDFKit documentation and tried a few things before asking. This way you can be very specific in your question. Also, please provide a cloneable Github repository if the issue is complex. For more complex questions sometimes it's hard to get all of the context required to solve a problem by just looking at text.

  • New Features & Bugs: You need to ask new features and bugs corrections to PDFKit creator on his GIT: https://github.com/devongovett/pdfkit/

  • Answer Questions!: If you can help another user please do!

TODO

  1. Add testing
  2. Check if PDFKit is blocking node or is fibered

License

MIT

meteor-pdfkit's People

Contributors

pascoual avatar bogdan-bodnaruk 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.