How to set font size while converting html to pdf?
Loading
How to set font size while converting html to pdf?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Sachin SinghRank #66 · 26.2K reputationPosted Nov 19, 2022, 4:02 AM EST
That depends on how are you converting html to pdf if you are using JsPDF then
window.jsPDF = window.jspdf.jsPDF; // Convert HTML content to PDF function Convert_HTML_To_PDF() { var doc = new jsPDF(); doc.setFont("times", "normal"); //setting font // Source HTMLElement or a string containing HTML. var elementHTML = document.querySelector("#contentToPrint"); doc.html(elementHTML, { callback: function(doc) { // Save the PDF doc.save('document-html.pdf'); }, margin: [10, 10, 10, 10], autoPaging: 'text', x: 0, y: 0, width: 190, //target width in the PDF document windowWidth: 675 //window width in CSS pixels }); } /* Place custom JavaScript code here */ Convert HTML to PDF What is Lorem Ipsum? Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.Abhishek YadavRank #217 · 11.3K reputationPosted Nov 19, 2022, 10:11 AM EST
no simply use the dll
kavya m144 reputationPosted Nov 21, 2022, 11:44 AM EST
I am using HIQPDF. Please let me know how to set font using hiqpdf