For me it was pageBreakBefore propery-method of the printer.createPdfKitDocument method. I had to fix a problem in the pageBreakBefore method that was defined on the application side.
pageBreakBefore
printer.createPdfKitDocument