2016-04-08 33 views
1

Ben cordova android cihazında çalışıyorum, 'console.log (' yazım başarısı ')' hattına ulaşabilirim '; ama dosyanın kaydedildiği yerde görünmediğini düşünmüyorum. her yerdeCordova jsPDF - PDF created, pdf dosyasını pdf dosyasında bulamıyorum

kaynak kodu http://www.tricedesigns.com/2014/01/08/generating-pdf-inside-of-phonegap-apps/

Ben 2 farklı androidler çalışan denedim pdf dosyası oluşturmak ve herhangi bir klasöre kaydetmek

//FIRST GENERATE THE PDF DOCUMENT 
console.log("generating pdf..."); 
var doc = new jsPDF(); 

doc.text(20, 20, 'HELLO!'); 

doc.setFont("courier"); 
doc.setFontType("normal"); 
doc.text(20, 30, 'This is a PDF document generated using JSPDF.'); 
doc.text(20, 50, 'YES, Inside of PhoneGap!'); 

var pdfOutput = doc.output(); 
console.log(pdfOutput); 

//NEXT SAVE IT TO THE DEVICE'S LOCAL FILE SYSTEM 
console.log("file system..."); 
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fileSystem) { 

    console.log(fileSystem.name); 
    console.log(fileSystem.root.name); 
    console.log(fileSystem.root.fullPath); 

    fileSystem.root.getFile("test.pdf", {create: true}, function(entry) { 
     var fileEntry = entry; 
     console.log(entry); 

     entry.createWriter(function(writer) { 
     writer.onwrite = function(evt) { 
     console.log("write success"); 
     }; 

     console.log("writing to file"); 
     writer.write(pdfOutput); 
     }, function(error) { 
     console.log(error); 
     }); 

    }, function(error){ 
     console.log(error); 
    }); 
}, 
function(event){ 
console.log(evt.target.error.code); 

Teşekkür !!

+0

Buna bir çözüm buldunuz mu? Aynı konuyla karşılaşıyorum! – Philomath

+0

Hayır: {ben de yardıma ihtiyacım var –

cevap

İlgili konular