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

273
Views
How to iterate through pdf pages for inserting page number in angular 7

What I m trying to achieve is to get the saved pdf from asset folder in angular 7 and insert page number through jsPDF in each page. I am stuck just after getting the pdf like this:

let headers = new HttpHeaders();
headers = headers.set('Accept', 'application/pdf');

this.http.get('/assets/pdf/myTest.pdf', { headers: headers, responseType: 'blob' }).subscribe(data => {
  console.log(data);
});

I am able to get the pdf but unable to loop through each page for inserting page number using jsPDF in angular 7. My Pdf do not have page number in it. Inserting page number through jsPdf can be achieved like this:

var doc = new jsPDF();
doc.page=1; // use this as a counter.

function footer(){ 
   doc.text(150,285, 'page ' + doc.page); //print number bottom right
   doc.page ++;
};

// and call footer() after each doc.addPage()

Sample pdf can be this. How can I insert page number in the saved pdf? any solution are highly appreciated.

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!