Hi,
Erik Scholtz, ArgonSoft GmbH schrieb:
Hi again,
I found out, how to avoid the exception, by adding the following line:
...
PDResources myResources = new PDResources();
myResources.getXObjects().put("Im0", mypic);
COSStream s = new COSStream(document.getDocument().getScratchFile());
+++> s.createUnfilteredStream();
PDAppearanceStream myDic = new PDAppearanceStream(s);
myDic.setResources(myResources);
...
With this change, the PDF is written without exception. But the
RubberStamp does not appear. I filed an issue on JIRA with two example
PDFs (that one created by pdfbox, and that one created with Acrobat Pro).
JIRA: https://issues.apache.org/jira/browse/PDFBOX-607
I've added an example on how to add a rubber stamp including an image to
a pdf document. See PDFBOX-607 for further details.
Greetings,
Erik
BR
Andreas Lehmkühler