Skip to content

Commit

Permalink
Project Readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Mindelusions committed Aug 17, 2011
1 parent 33dc2ec commit 0999b89
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 10 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
tmp
/build/*
48 changes: 38 additions & 10 deletions README
Original file line number Diff line number Diff line change
@@ -1,18 +1,46 @@
Welcome to your Appcelerator Titanium Mobile Project
# TiJSPDF

This is a blank project. Start by editing your application's app.js to
make your first mobile project using Titanium.
TiJSPDF is a [JSPDF](http://snapshotmedia.co.uk/blog/jspdf) plugin for Titanium Mobile applications that
allows you to generate your PDFs using the JSPDF library and manipulate them within your Titanium Mobile
application.

This plugin is maintained separately from Titanium and is not currently supported by Appcelerator through
any premium or community support offereings.

**_Please double check all of your code before deploying an app with this plugin. It took all of 10 minutes
to port and I cannot speak to the practices of the original author. If you see something wrong and you think
that you know a better way, then fork it and git 'er done._**

----------------------------------
Stuff our legal folk make us say:
## Documentation

Appcelerator, Appcelerator Titanium and associated marks and logos are
trademarks of Appcelerator, Inc.
Visit the [JSPDF blog post](http://snapshotmedia.co.uk/blog/jspdf) for PDF creation guidance.

Titanium is Copyright (c) 2009-2010 by Appcelerator, Inc. All Rights Reserved.
## In The Box

Titanium is licensed under the Apache Public License (Version 2). Please
see the LICENSE file for the full license.
This project contains an example application using a demo from the JSPDF demo page. If you'd rather just
get going on making your own app, you can download just the modified js files from the 'Downloads' section.
Just drop the uncompressed files into your 'Resources' folder and start building.

## Usage

Ripped straight from the included example app.

~~~
// Include the JSPDF libraries
Ti.include('jspdf.js');

var doc = new jsPDF();
doc.text(20, 20, 'Hello world!');
doc.text(20, 30, 'This is client-side Javascript, pumping out a PDF.');
doc.addPage();
doc.text(20, 20, 'Do you like that?');

var file = Ti.Filesystem.getFile(Ti.Filesystem.tempDirectory, 'test.pdf');
file.write(doc.output());
var pdfview = Ti.UI.createWebView({width:'100%',height:'100%',data:file});
var win = Ti.UI.createWindow();
win.add(pdfview);
win.open({modal:true});
~~~

And thats about it.

0 comments on commit 0999b89

Please sign in to comment.