使用以下代码我可以创建PDF文件。
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, fsSuccess, fail);
function fsSuccess(fs){
//alert(fs.root.toURL()+"KmdMoney/i-CountReport.pdf");
pdfPath=fs.root.toURL()+"KmdMoney/i-CountReport.pdf";
window.resolveLocalFileSystemURL(fs.root.toURL(), function(fileSystem){
fileSystem.getDirectory("KmdMoney", {create: true, exclusive: false},function(directorypp){
directorypp.getFile("i-CountReport.pdf", {create:true}, function(entry) {
var fileEntry = entry;
//console.log(entry);
venufile=entry;
entry.createWriter(function(writer) {
writer.onwrite = function(evt) {
console.log("write success");
};
writer.write( pdfOutput );
console.log("writing to file");
}, function(error) {
console.log(error);
});
}, onError);
}, onError);
} , onError);
I attached the created PDF file using email plugin, when I open PDF getting the following error.