Git Product home page Git Product logo

bencoding.pdf's Introduction

benCoding.PDF.Converters

The benCoding.PDF Converters proxy provides conversion helper functions when working with PDFs. At the moment the feature list is pretty small, but will be growing as needed or contributions are provided.

Before you start

* This is a module designed to work with Titanium SDK 3.0.0GA * Before using this module you first need to install the package. If you need instructions on how to install a 3rd party module please read this installation guide.

Download the release

There is two ways you can download this module.

Android:

The go to the dist folder. This will have a release compiled for anyone download it from github.

iOS:

The go to the dist folder. This will have a release compiled for anyone download it from github.

Building from source?

If you are building from source you will need to do the following:

  • Modify the titanium.xcconfig file with the path to your Titanium installation

Setup

  • Download the latest release from the releases folder ( or you can build it yourself )
  • Install the bencoding.sms module. If you need help here is a "How To" guide.
  • You can now use the module via the commonJS require method, example shown below.

var pdf = require('bencoding.pdf');

Creating the Converters Object

Requiring the module into your project


//Require the securely module into your project
var pdf = require('bencoding.pdf');
//Create a new properties object
var converters = pdf.createConverters();

Methods

convertImageToPDF( TiBlob image, int resolution ) Adds the specified callback as an event listener for the named event.

Parameters image : TiBlob Image to be converted into PDF resolution : int Optional resolution value. Only applies to iOS

Returns TiBlob

Example


	Ti.Media.takeScreenshot(function(event){
		// set blob on image view
		var image = event.media;
		var pdfBlob = converters.convertImageToPDF(image,100);
		var pdfFile = Ti.Filesystem.getFile(Ti.Filesystem.applicationDataDirectory, 'text.pdf');
		pdfFile.write(pdfBlob);	
	});

Dependent Projects

The benCoding.PDF module uses the below projects. I highly encourage you to check them out using the information below.

iText ( used on Android only)

Please visit iText Website to learn more

Please note iText is licensed under the GNU Affero General Public License version 3 and depending on the nature of your app you might need a license. Please visit license for details.

Licensing & Support

This project is licensed under the OSI approved Apache Public License (version 2). For details please see the license associated with each project.

Developed by Ben Bahrenburg available on twitter @benCoding

Learn More

Examples

Please check the module's example folder for details.

These samples are also available on github at the following:

Android Examples

iOS Examples

Twitter

Please consider following the @benCoding Twitter for updates and more about Titanium.

Blog

For module updates, Titanium tutorials and more please check out my blog at benCoding.Com.

bencoding.pdf's People

Contributors

benbahrenburg avatar

Watchers

 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.