Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

279
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda