Hi Andreas,
thanks for your answer. As far as I can see, you paint the image at the
position, where the RubberStamp is placed too. Is the the way it should
usually work, or just a method to make it working at the moment?
Many thanks again for the example,
Greetings,
Erik
Andreas Lehmkuehler wrote:
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