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

632
Visualizações
pdfMake pageBreakBefore feature is not working

I am trying to concatenate multiple pdf files to a content variable. However I want each pdf content to be on a new page, but pdfmake.js just concatenate each content right after the other. I have added 'pageBreakBefore' function right after my content but it still doesn't work. Is there a way to make each content to be on separate page. (I am using jpdmake.js 1.60). Thanks!

Below is my code:

        let content = [];
        content = this.getContent(checkedOrders, selectedLabOrders);
        this.docDefinition = {
                      info: {
                        title: 'Title',
                        subject: 'labOrder-' 
                      },
                      pageSize: 'LETTER',
                      pageOrientation: 'landscape',
                      pageMargins: [40, 30, 40, 30],
        
                      content: content,
                      pageBreakBefore: function(currentNode, followingNodesOnPage, nodesOnNextPage, previousNodesOnPage) {
                        return currentNode.headlineLevel === 1 && followingNodesOnPage.length === 0;
                      },
                      unbreakable: true,
                      styles: {
                        titleHeader: {
                          fontSize: 16,
                          bold: true,
                          margin: [0, 10, 0, 0],
                        },
                        tableHeader: {
                          bold: true,
                          fontSize: 13,
                          color: 'black'
                        }
                      },
                      defaultStyle: {
                        fontSize: 9,
                        lineHeight: .9
                      }
                    };

enter image description here

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