You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Below is the code snippet to generate and save the pdf directly into the file system.
Getting the html as shown below.
` var htmlContent = document.getElementById('page-content');
var pdfhtml =''+
' '+ htmlContent.innerHTML + '';
var fileName = file + ".pdf";
var options = {
documentSize: 'A4',
type: 'base64'
};
pdf.fromData(pdfhtml, options)
.then(function (base64) {
var contentType = "application/pdf";
var folderpath = cordova.file.externalRootDirectory + "Download/";
savebase64AsPDF(folderpath, fileName, base64, contentType);
})
.catch(function (e) {
console.log(e)
});`
It's generating a blank PDF when called the first time. Works fine in the subsequent calls.
No errors are shown when the blank file is generated.
The text was updated successfully, but these errors were encountered:
Below is the code snippet to generate and save the pdf directly into the file system.
Getting the html as shown below.
` var htmlContent = document.getElementById('page-content');
var pdfhtml =''+
'
'+ htmlContent.innerHTML + '';
var fileName = file + ".pdf";
var options = {
documentSize: 'A4',
type: 'base64'
};
pdf.fromData(pdfhtml, options)
.then(function (base64) {
var contentType = "application/pdf";
var folderpath = cordova.file.externalRootDirectory + "Download/";
savebase64AsPDF(folderpath, fileName, base64, contentType);
})
.catch(function (e) {
console.log(e)
});`
It's generating a blank PDF when called the first time. Works fine in the subsequent calls.
No errors are shown when the blank file is generated.
The text was updated successfully, but these errors were encountered: