Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

733
Views
header and footer from html in html2pdf

I use my HTML code for the footer and header in html2pdf. I use this code, it works perfectly but it just shows plain text and I want to have my HTML code and style here.

html2pdf().from(element).set(opt).toContainer().toCanvas().toPdf().get('pdf').then((pdf) => {
var totalPages = pdf.internal.getNumberOfPages();


// console.log("getHeight:" + pdf.internal.pageSize.getHeight());
// console.log("getWidth:" + pdf.internal.pageSize.getWidth());
for (var i = 1; i <= totalPages; i++) {
    pdf.setPage(i);

    pdf.setFontSize(10);
    pdf.setTextColor(150);

    //  pdf.text(footerCR,totalPages, pdf.internal.pageSize.getWidth() /1.15, 
    // pdf.internal.pageSize.getHeight() /1.05);
    pdf.text(`${i} von${totalPages}`, pdf.internal.pageSize.getWidth() / 1.15,
        pdf.internal.pageSize.getHeight() / 1.05);
    pdf.setTextColor(10);
    pdf.text('www.jms-gruppe.ch', pdf.internal.pageSize.getWidth() / 15,
        pdf.internal.pageSize.getHeight() / 1.05);
    pdf.text('Hydraulik und Druckluftschläuche', pdf.internal.pageSize.getWidth() / 3,
        pdf.internal.pageSize.getHeight() / 1.05);
    // pdf.text('page_header', pdf.internal.pageSize.getWidth() /9, 
    // pdf.internal.pageSize.getHeight() /15);
}
}).save();
});
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!