PDPageContentStream contents = new PDPageContentStream(document, page, AppendMode.APPEND, true, true);
with this problem solved in PDFBOX-2.0.30 but it repeats in PDFBOX-3.0.4.