java - PDFBOX 1.8.9 Overlay two PDF documents: Layout pages with COSArray currently not supported -
i want use apache pdfbox (1.8.9) library print white/invisible text on existing pdf documents, therefore create new document, add text in color.white , use "overlay" method merge 2 documents together. doing encountered following problem: java.lang.unsupportedoperationexception: layout pages cosarray not supported. @ org.apache.pdfbox.overlay.collectlayoutpages(overlay.java:269) @ org.apache.pdfbox.overlay.overlay(overlay.java:224) @ com.db.jocr.main.overlay(main.java:194) @ com.db.jocr.main.main(main.java:91) the code looks this: realdoc = pddocument.load(pathinputdoc); string pathwatermarkdoc = createwhiteonwhitedoc(text, pagecount, color); watermarkdoc = pddocument.load(pathwatermarkdoc); overlay overlay = new overlay(); overlay.overlay(realdoc,watermarkdoc); line 194 code throws exception "overlay.overlay(doc1, doc2)" command i found similar question on apache mailinglist (from 2009, apparently no answer, https://mail-archives.apache.org/mod_mbox/p...