const element = request.responseText;
const opt = {
margin: 0,
filename: 'test.pdf',
pagebreak: { mode: 'legacy'},
image: { type: 'jpeg', quality: 0.98 },
enableLinks: true,
html2canvas: { dpi: 90, scale: 1, letterRendering: true},
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait', compress: true }
};
html2pdf().set(opt).from(element).save();