We have a gears application that allows the user to generate a
"report" while offline.  Currently, this is an html page generated by
javascript on the fly, which the user then prints.  We now have the
requirement that the reports be saved.  Because the data from which
the report is generated may be subsequently edited, we want to save as
close the the printable representation as possible.

Our holy grail solution would consist of:

1) Find/write a javascript PDF generation library

2) Store generated PDF data in gears such that it can be served by
LocalServer.

3) Point user to the apropriate url which gets served by the
LocalServer, and they thus get prompted to save/print/open the PDF as
they wish (while offline).

4) Later synchronize the PDF data (either from LocalServer or
separately stored in database) back to the server.



For step 1), we could potentially fallback to writing a javascript
wrapper around alivepdf (although pointers to a pure-javascript
solution are most welcome).

For step 2) - is it possible to programmatically insert arbitrary data
(i.e. the PDF data) + mimetype into a ResourceStore (or otherwise
serve client-side generated binary data)?

Steps 3 and 4 don't seem to present any particular problem.


So the meat of my question is, how can we accomplish step 2 with gears
while offline?


Cheers,
Len.

Reply via email to