pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diego Azevedo <dazev...@esec.com.br>
Subject Update Signature Contents
Date Mon, 02 May 2016 21:16:06 GMT
Hello all,

I have a question regarding the update of a signature using PDFBox. I 
want to create a dummy signature (/Contents <000...00>), and update it 
latter with the real signature. Creating the dummy is easy, but I tried 
to update the signature and it didn't work out. Here is my code:

    byte[] signature = createRealSignature();
    PDSignature sig = doc.getLastSignatureDictionary();
    sig.setContents(signature);
    sig.getCOSObject().setNeedToBeUpdated(true);
    doc.saveIncremental(new FileOutputStream("signedPdf.pdf"))

Does anyone know how to do it? Do I need to set other objects as needed 
to be updated?

Thanks in advance,

-- 
*_______________________________________________

Diego Azevedo
Developer
E-SEC Digital Security
www.esec.com.br <http://www.esec.com.br>
61 3323-4410*


Mime
View raw message