and other to download the generated pdf..
function downloadpdf()
{
try {
// var doc = new jsPDF();
var htmlcontent="<!doctype><html><head><title>jsPDF</title></head>"+$('#mybody').html()+"</html>";
var pdf = new jsPDF('p','in','letter')
,source = htmlcontent;
specialElementHandlers = {
// el ement with id of "bypass" - jQuery style selector
'#bypassme': function(element, renderer){
// true = "handled elsewhere, bypass text extraction"
return true
}
}
// doc.text(20, 20, 'This PDF has a title, subject, author, keywords and a crea');
// alert(doc.output());
pdf.fromHTML(
source // HTML string or DOM elem ref.
, 0.5 // x coord
, 0.5 // y coord
, {
'width':7.5 // max width of content on PDF
,'elementHandlers': specialElementHandlers
}
)
alert(window.location.href);
pdf.addPage();
// var out= pdf.output('datauri');
// navigator.saveAs(htmlcontent, 'mmmmmmm.pdf');
pdf.save('adeel.pdf');
// alert("out "+out);
// var out = jsPDF.output();
// var url = 'data:application/pdf;base64,' + btoa(out);
// document.location.href = url;
// pdf.save('adeel.pdf');
} catch (e) {
return e.message;
}
return "";
}
it works fine in the browser of my system but not in the virtual tablet device in which application is install it gives the following error in the green .
04-20 12:26:22.515: I/SqliteDatabaseCpp(759): sqlite returned: error code = 14, msg = cannot open file at line 27701 of [8609a15dfa], db=/data/data/com.example.energy_e360/databases/webview.db
04-20 12:26:22.465: I/SqliteDatabaseCpp(759): sqlite returned: error code = 14, msg = os_unix.c: open() at line 27701 - "" errno=2 path=/CachedGeoposition.db, db=/data/data/com.example.energy_e360/databases/webview.db
any help will be appreciated.