Thanks, Tilman! I tried that and made some progress, but when I view the file in the PDF Debugger the Metadata object is still null, although the "Length" property now shows the right size of the string I applied... Weird, no? Here's the code I added:
OutputStream outStream = s.createOutputStream(); String jsonString = "<x:xmpmeta xmlns:x=\"adobe:ns:meta/\" x:xmptk=\"Adobe XMP Core 5.4-c006 80.159825, 2016/09/16-03:31:08\"></x:xmpmeta>"; outStream.write(jsonString.getBytes()); outStream.close(); Do you see any issues with it? On Mon, May 23, 2022 at 9:03 PM Tilman Hausherr <[email protected]> wrote: > Am 23.05.2022 um 14:56 schrieb Gilad Denneboom: > > Hi all, > > > > I have a signed document where the Signature field's value contains a > > Metadata dictionary with some info in it. I'm trying to reproduce this > > using PDFBox but am having a hard time doing so. > > This is what the original structure of the file looks like: > > https://imgur.com/yHE3r7j > > > > I've used CreateVisibleSignature as my base, and manipulated its > > findExistingSignature method to create the Metadata dictionary and add it > > to the field's value, but I don't manage to set the actual contents of > the > > object (seen in the right-hand side of the screenshot above). This is the > > code I added: > > https://imgur.com/gC9SZwk > > call COSStream.createOutputStream() and then write there and close it. > > Tilman > > > > > > The result is nearly identical to the original, just without any actual > > value under the Metadata object: > > https://imgur.com/86KDOC2 > > > > It seems like I'm missing something quite basic here, so any advice would > > be appreciated! > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >

