Hello all, I'm using Apache PDFBox 3.0.1, and I tried to add annotations to an existing PDF document, using basically the same code as supplied in example class org.apache.pdfbox.examples.pdmodel.AddAnnotations.
There are only few differences to the original code, i.e. I'm loading an existing document using PDDocument document = Loader.loadPDF(new RandomAccessReadBufferedFile(args[0])) instead of making a new one, and I'm skipping the lines in example where contents of new file are created, because my file already has some content. This existing document has electronic signature on it. After running the example code, and adding annotations to the document, when I open that document in Adobe Acrobat Reader (should be the latest version, 23.8.20555.0), and then try to validate signatures, it first shows an error message: There was an error creating a temporary file. Then, when I look at the Signature Panel, it show the following: Signature is invalid: There are errors in the formatting or information contained in this signature (support information: SigDict /Contents illegal data) My code, as well as the PDF document can be found on address: https://files.fm/u/bsm5vzg9wk This PDF was signed most likely by custom code based on an old version of iText, but I have also tried on another document which was produced by Adobe Acrobat and signed by GetAccept service (I haven't provided this document, but I probably could if needed), and the behaviour is the same after adding annotations. Can you please check what is happening here? Best regards, Predrag Stojković