PDFBOX-1915: refactoring: base class and intermediate class (for types 4 5 6 7) to get rid of double code