Вы можете использовать pdfmake . Это отличная библиотека, вы можете открывать, загружать и распечатывать PDF.проверить это pdfmake
Шаги
Сначала вы определяете содержимое PDF в определенном формате JSON:
var docDefinition = {
content: [
{ text: 'This is a header', style: 'header' },
'No styling here, this is a standard paragraph',
{ text: 'Another text', style: 'anotherStyle' },
{ text: 'Multiple styles applied', style: [ 'header', 'anotherStyle' ] }
],
styles: {
header: {
fontSize: 22,
bold: true
},
anotherStyle: {
italics: true,
alignment: 'right'
}
}
};
скачать
pdfMake.createPdf(docDefinition).download();
открыть
var win = window.open('', '_blank');
pdfMake.createPdf(docDefinition).open({}, win);
печать
pdfMake.createPdf(docDefinition).print();