I recently started using a fantastic pdf printing library called pdfmake in my angularjs SPA to generate PDF files. Everything was going smoothly until I tried to include images in the PDF. Strangely, when I added images, nothing happened - no errors, no empty PDF, just total silence. There weren't even any 404 errors indicating missing files.
Below is the code snippet that's causing me trouble:
var dd = {
content: [
{
image: 'picture13438908025659.jpg'
},
{
text: 'Patient\'s Detail', fontSize: 18, bold: true
},
{
columns: [
{
text: 'Patient\'s ID: ' + $scope.prescription.Patient[0].id, bold: false
},
{
text: 'Name: ' + $scope.prescription.Patient[0].name, bold: false
},
{
text: 'Age: ' + $scope.prescription.Patient[0].age, bold: false
},
{
text: 'Contact: ' + $scope.prescription.Patient[0].contact, bold: false
}
]
},
{
text: 'Address: ' + $scope.prescription.Patient[0].address, bold: false
}
]
}