Suggestion by valerybokov
PDFPrintable.print (row 194). Suggestion: create a field instead of calling the method for document.getNumberOfPages(). Reason is TODO in PDDocument: REPLACE most calls to this method with BELOW method. Additionally check row 202. Maybe field PDPageTree will be better than current version.
He's right, printing might take a very long time for huge files.