Я не могу загрузить даже открытый файл, созданный в виде файла PDF, используя библиотеку pdfmake.js.Я даю свой code.also, когда я отправляю данные в таблицу, это дает мне значение undefined.Кроме того, когда я пытаюсь открыть созданный файл, он выдает ошибку вроде этой: TypeError: Невозможно создать свойство 'autoPrint' для строки 'test.pdf'
pdfCreatetor()
{
var dd = {
content: [
{
{
text: 'pdfmake', style: 'header'
},
'pdf make does not generate pdf from the HTML. Rather, it generates them directly from javascript.',
'It is very fast, but very limited, especially compared to PHP alternatives.',
'To get a pdf that looks like the page, you could use html2canvas, which generates an image that can be inserted into the pdf. I think this is a hack and not ideal',
],
styles:
{
header:
{
fontSize: 18,
bold: true,
margin: [0, 10, 0, 10],
alignment: 'center'
},
tableHeader:
{
fillColor: '#4CAF50',
color: 'white'
}
}
};
console.log("pdf make",pdfMake.createPdf(documentDefinition));
pdfMake.createPdf(documentDefinition).open('test.pdf');
}