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

626
Views
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
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!