1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

How to display header on first page only using PDFmake

Discussão em 'Angular' iniciado por Damien Garlinge, Setembro 25, 2024.

  1. I am trying to build a dynamic invoice using PDFmake. The issue I'm having is that the header displays perfectly on the first page and then overlaps the table I generate from the second page onwards. The two possibly solutions I've tried is removing the header from the second page onwards and adjusting the table positioning so that it is below the header but both were unsuccessful.

    let docDefinition: TDocumentDefinitions = {
    header: {
    margin: [35, 35, 0, 50],
    width: 200,
    image: `image base 64`,
    alignment: 'right'

    },
    footer: {
    margin: 10,
    fontSize: 7,
    columns: [
    { text: new Date().toDateString(), alignment: 'left' },
    { text: `Company Name | ${this.pdfData.quotation.employeeName} `, alignment: 'center' },
    { text: '', alignment: 'right' }
    ]},


    I tried to use pageBreak to remove the header from the second page onwards but it removed the header entirely. The documentation also wasn't helpful with this scenario.

    Continue reading...

Compartilhe esta Página