Hi i am trying to create a pdf file and save it to my local storage using cordova-file-plugin and pdfmake
When i try this i get an error Roboto-regular.ttf file is not available could some one help me tor fix this issue or suggest tutorial were ionic has in pdf creation, viewing, saveing to local storage
html_pdt() {
var docDefinition = {
content: [
{
table: {
body: [
['Tools', 'Experience'],
[this.exp, this.experience],
[{ text: 'Bold value', bold: true }, this.exp, this.experience]
]
}
},
{ text: 'Date', style: 'subheader' }, this.date,
{ text: 'Signature', style: 'subheader' }, this.signature,
]
};
pdfmake.createPdf(docDefinition).getBuffer(function (buffer) {
var utf8 = new Uint8Array(buffer); // Convert to UTF-8...
var binaryArray = utf8.buffer; // Convert to Binary...
this.File.writeFile(cordova.file.dataDirectory, "example.pdf", binaryArray, true)
.then(function (success) {
console.log("pdf created");
}, function (error) {
console.log("error");
});
});
}
error in my console
> ERROR Error: File ‘Roboto-Regular.ttf’ not found in virtual file system