We have a client side Angular application & we are generating a pdf from a lengthy report. It works fine but our output screen has the roboto fonts and I used this link to apply the custom fonts https://www.devlinpeck.com/content/jspdf-custom-font. When I add a css to override few classes then it works with downloaded pdf but not works with output screen. I wants to apply the same fonts to both on output screen and to the downloaded pdf.
Here is the sample snippest
`let DATA: any = document.getElementById(‘myHtmlData’);
html2canvas(DATA,{ scale: 1, logging: false }).then((canvas) => {
doc.html(DATA, {
autoPaging: ‘text’,
callback: function (doc) {
let j = 0;
let pagesLength = doc.internal.pages.length;
for (let i = 1; i < pagesLength; i++) {
doc.setPage(i);
doc.setFontSize(6);
doc.setFont('roboto');
}
}
})
})`
We have a client side Angular application & we are generating a pdf from a lengthy report. It works fine but our output screen has the roboto fonts and I used this link to apply the custom fonts https://www.devlinpeck.com/content/jspdf-custom-font. When I add a css to override few classes then it works with downloaded pdf but not works with output screen. I wants to apply the same fonts to both on output screen and to the downloaded pdf.
Daksheshkumar Patel is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.