How to dynamically generate a pdf from Google's appengine? - google-app-engine

I'd like to create an application that would run on Google's appengine.
However, this application needs to be able to generate PDFs dynamically.
How could I do this?

You can use the reportlab library to generate a PDF from Python. You can just include the ReportLab files in with your application's code, or you can include a zip archive of the ReportLab code, and insert it into your application's sys.path.

To overcome the number-of-files limit in google appengine, you could package your reportlib in a zip file and use it. Be sure you check out this issue i bumped into..
http://code.google.com/p/googleappengine/issues/detail?id=1085
Also, you can use pisa, htmllib and pyPdf to generate the pdf using html templates.
All the best.
varun

I would recommend PyFPDF, which is a pure-Python port of the lightweight yet highly powerful PHP FPDF library. It is hardly a few dozen kilobytes.
See http://code.google.com/p/pyfpdf/

Google has a new "Conversion API" that may solve all your problems. Here's a description from the site:
The App Engine Conversion API converts documents between common filetypes using Google's infrastructure for efficiency and scale. The API enables conversions between HTML, PDF, text, and image formats, synchronously or asynchronously, with an option to perform optical character recognition (OCR).

Related

How to publish AIML embedded with javascript?

I've written an AIML file for a chat bot and I'd like to build an interactive web application which allows me to chat with the bot in the web browser.
Is it possible to achieve this with HTML & Javascript?
There is no short answer on how to write a web application which allows a user to interact with your AIML. Writing such an application from scratch will be much more work then compiling the AIML was.
The easiest option would be to use a pre-built service like PandoraBots which allows you to upload AIML files and interact with them in the web browser. It's free to use the explorer part of website. They also have paid developer options which generates an API to bridge your AIML script and any applications you might want to build. It can be easily connected to work with common chat apps like Google talk ect.
If you decide to build everything from scratch you might want to check out the AIML Interpreter library for nodejs.
UPDATE: Here is a node.js based interpreter that you might find useful https://github.com/mrchimp/surly2
I was looking at AIML too and had similar questions. I just found RiveScript RiveScript and it looks like it fits your need to run javascript based on a match. It is not AIML, but very close. There is also at least one tool to convert from AIML to RiveScript, so I would say this fits your needs within those constraints.

Direct file upload from iManage (or other DMS)

Is it possible to upload files to a web browser application (such as Dropbox) directly from a document management system (DMS) such as iManage (aka Worksite, Filesite, HP Autonomy)?
If not, what are the best ways of getting around this and enabling simple upload of files from the DMS to web applications?
If you are trying to share documents via a dropbox like solution, you might want t consider LinkSite. It is more manageable, which is quite a positive aspect since you will probably working in a legal environment.
More info can be found here: http://www.irisecm.com/hp-linksite-the-secure-and-enterprise-alternative-to-dropbox/
Best regards,
Daniel
By the way, LinkSite is rebranded and now called iManage Share.
If you are looking for a seamlessly integrated third party application you might want to consider Litéra Sync.

How do I get around that Google App Engine does not support writing files?

I have a GAE/Python application that is an admin program that allows people all over the world to translate template files for a large GAE application into their local language (we cannot use auto translation because many idioms and the like are involved). The template files have been tokenized and text snippets in the various languages are stored in a GAE datastore (there are thousands of template files involved).
I therefore need to be able to write files to a folder.
I have the following code:
with open("my_new_file.html", "wb") as fh:
fh.write(output)
I have read that GAE blocks the writing of files. If that is true, is there some way to get around it?
If I cannot write the file direct, does anyone have a suggestion for how I accomplish the same thing (e.g. do something with a web-service that does some kind of round trip to download and then upload the file)?
I am a newbie to GAE/Python, so please be specific.
Thanks for any suggestions.
you could use google app engine blobstore or BlobProperty in datastore to store blobs/files
for using blobstore (up to 2GB)
https://developers.google.com/appengine/docs/python/blobstore/
for using datastore blobs (only up to 1MB)
https://developers.google.com/appengine/docs/python/datastore/typesandpropertyclasses#Blob
Filesystem is read only in many cloud system and GAE is too. In a virtual world, where the OS and machine are virtual, the filesystem is least reliable place to store anything
I would suggest using any of BLOB, Google Cloud Storage, Google Drive or even go a setp further and store in any external provider like Amazon S3 etc.
Use the files API:
https://developers.google.com/appengine/docs/python/googlestorage/overview
Adding some extra code you can use it like the normal Python file API:
with files.open(writable_file_name, 'a') as f:
f.write('Hello World!')
While this particular link describes it in relation with Google Cloud Storage (GCS) you can easily replace the GCS-specific pieces and use blobstore as a storage backend.
The code can be found here:
http://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/api/files/

How can I store more than 5MB data on a Phonegap HTML5 offline application?

I am working on an HTML5 application. This app must store data (lots of JSON & Base64 pictures) until the user synchronises it with our server. I must keep data stored on the device for a month after a sync.
I will use Phonegap for building the app. I know there is a limit of 5MB, so I'll certainly have to store my data in a different way. What are the best solutions? What would you recommend me?
Edit:
I forgot to say, but I will have physically all the devices used by my company for installing the application, so maybe there is a way to overpass the restriction by tricking the Android pad?
That stands for localStorage and the built in SQLite database. I would suggest you taking a look at the File API, which would allow you to store files in the device.
There's a neat SQLite plugin here I'm using in an iOS/Android Phonegap application. I've tested it and found it's methods to work well on both platforms.
As for syncing JSON data and Base64 images, I'm doing this same thing with a SQLite DB managed through this plugin. I only have a couple hundred smaller images I'm working with but I've found the SQLite DB to be pretty reliable for this purpose.
Thanks to the authors of that plugin.

Common file system API for files in the cloud?

Our app is a sort-of self-service website builder for a particular industry. We need to be able to store the HTML and image files for each customer's site so that users can easily access and edit them. I'd really like to be able to store the files on S3, but potentially other places like Box.net, Google Docs, Dropbox, and Rackspace Cloud Files.
It would be easiest if there there some common file system API that I could use over these repositories, but unfortunately everything is proprietary. So I've got to implement something. FTP or SFTP is the obvious choice, but it's a lot of work. WebDAV will also be a pain.
Our server-side code is Java.
Please someone give me a magic solution which is fast, easy, standards-based, and will solve all my problems perfectly without any effort on my part. Please?
Not sure if this is exactly what you're looking for but we built http://mover.io to address this kind of thing. We currently support 13 different end points and we have a GUI interface and an API for interfacing with all these cloud storage providers.

Resources