title: pdfbox - How to incrementally sign updated document or changes
body: <p>I have some questions wrt pdfbox.</p>
  <ol>
  <li>I want to sucessively sign a document that is subject to changes, e.g. a) originalPdf (signed by X), b) an image is added to the pdf (then signed by person Y), etc., such that the signatures are all valid. How can I reach that with pdfbox, if possible? I tried several things (e.g. with saveIncremental) but they did not give the intended result.</li>
  <li>Or do I need to define empty fields beforehand and allow them to be updated with images such that signatures are valid? Is this performed with Annotations, if yes, how could we realize that?</li>
  </ol>
  <p>Any helpful tips or code references in the public domain would be very helpful. Thanks.</p>
  <pre class="lang-java prettyprint-override"><code>.... 
  contentStream = new PDPageContentStream(doc, page, PDPageContentStream.AppendMode.APPEND, true); 
  PDImageXObject pdImage = PDImageXObject.createFromFile(&quot;C:/logo.png&quot;, doc); 
  ....  
  page.getResources().getCOSObject().getCOSDictionary(COSName.XOBJECT).setNeedToBeUpdated(true); 
  page.getCOSObject().setNeedToBeUpdated(true); 
  page.getResources().getCOSObject().setNeedToBeUpdated(true);    
  doc.getDocumentCatalog().getPages().getCOSObject().setNeedToBeUpdated(true);
  doc.getDocumentCatalog().getCOSObject().setNeedToBeUpdated(true); 
  doc.saveIncremental(fos);
  </code></pre>