Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Create PDF, note, .txt, or something for print information.

Hello! This code is from here http://cordova.apache.org/docs/en/3.0...prefunction gotFS(fileSystem) {
fileSystem.root.getFile("readme.txt", {
create: true,
exclusive: false
}, gotFileEntry, fail);
}

Code: Select all

                 function gotFileEntry(fileEntry) { 
                     fileEntry.createWriter(gotFileWriter, fail); 
                 } 

                 function gotFileWriter(writer) { 
                     writer.onwriteend = function(evt) { 
                         console.log("contents of file now 'some sample text'"); 
                         writer.truncate(11); 
                         writer.onwriteend = function(evt) { 
                             console.log("contents of file now 'some sample'"); 
                             writer.seek(4); 
                             writer.write(" different text"); 
                             writer.onwriteend = function(evt) { 
                                 console.log("contents of file now 'some different text'"); 
                             } 
                         }; 
                     }; 
                     writer.write("some sample text"); 
                 } 

                 function fail(error) { 
                     console.log(error.code); 
                 } 

                     window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);/preIt works if you install app on device (we tested it). It shouldn't work in browser because it's PhoneGap feature.
Jordi Niubo
Posts: 0
Joined: Tue Nov 26, 2013 12:08 pm

Create PDF, note, .txt, or something for print information.

wow, awesome Maryna

This work so nice ^^

I will play with the code and make csv or something like :)

Thanks a lot for your time Maryna and Katya

Amith Reddy
Posts: 0
Joined: Wed Aug 06, 2014 5:48 am

Create PDF, note, .txt, or something for print information.

how to upload image in appery and store it into database

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Create PDF, note, .txt, or something for print information.

So like is there any way that a user can generate an excel file based on what they have stored in the database? They wouldn't necessarily have to see it but as long as it can be automatically emailed to them, that would be pretty cool.

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Create PDF, note, .txt, or something for print information.

Hello Ellen,

This is possible. Please create the file and send it using for example Sendgrid
https://sendgrid.com/docs/API_Referen...

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Create PDF, note, .txt, or something for print information.

That page has an error. Also, how can I get it so that from the database, it creates an excel file with only certain entries?

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Create PDF, note, .txt, or something for print information.

Hello!

You would need to select specific object from service response before you create file.

Ellen Schlechter
Posts: 0
Joined: Sun Aug 31, 2014 3:28 am

Create PDF, note, .txt, or something for print information.

How would I even create a file?

Illya Stepanov
Posts: 0
Joined: Mon Mar 18, 2013 8:48 am

Create PDF, note, .txt, or something for print information.

Hi Ellen,

This could be done with Cordova File API as Maryna said above. - http://goo.gl/fvY4wc

Return to “Issues”