multiple sign on single pdf is possible?

Hello, I tried to put two signatures on a single pdf
always the last is valid

in the others sign i get the following error when I open the PDF with Adobe

SignDict/Contents contains illegal data

this is my code i use android version

  private boolean firmaPDF( bmpCanvas )


            int scaledW= bmpCanvas.getWidth() / 2;
            int scaledH= bmpCanvas.getHeight() / 2;

          Bitmap bmp = Bitmap.createScaledBitmap(bmpCanvas, scaledW, scaledH, true);

            Resources res = getResources();
//pdf based
            InputStream is = res.openRawResource(R.raw.pdftron);

            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            int reads =;
            while (reads != -1) {
                reads =;

            // Add an StdSignatureHandler instance to PDFDoc, making sure to keep track of it using the ID returned.
            long sigHandlerId = doc.addStdSignatureHandler(baos.toByteArray(), "password");

            Date date = new Date();
            SimpleDateFormat sdf = new SimpleDateFormat ("yyyyMMddHHmmss");

//I have several fields to sign
              strFieldFirma ="firma_1_"+myExternalCounter;
            //temporary outname pdf
            outFile = getNomeFoglioFirme();

             Field sigField = doc.getField(strFieldFirma);

            Widget widgetAnnot = new Widget(sigField.getSDFObj());

           // Widget w2 = Widget.create(doc.getSDFDoc(), new pdftron.PDF.Rect(0, 0,bmp.getWidth(), bmp.getHeight()), sigField);

            // Tell PDFNet to use the SignatureHandler created to sign the new signature form field.
            Obj sigDict = sigField.useSignatureHandler(sigHandlerId);

            // Add more information to the signature dictionary
            sigDict.putName("SubFilter", "adbe.pkcs7.detached");
            sigDict.putString("Name", "PDFTron");
            sigDict.putString("Location", "Vancouver, BC");
            sigDict.putString("Reason", "Document verification.");

            // Add the signature appearance
            ElementWriter apWriter = new ElementWriter();
            ElementBuilder apBuilder = new ElementBuilder();
            Image sigImg = Image.create(doc, bmp);

            double w = sigImg.getImageWidth(), h = sigImg.getImageHeight();

            Element apElement = apBuilder.createImage(sigImg, 0, 0, w, h);

            // Element apElement = apBuilder.createImage(sigImg, new Matrix2D(sigImg.getImageWidth(), 0, 0, sigImg.getImageHeight(), 50, 350));


            Obj apObj = apWriter.end();
            apObj.putRect("BBox", 0, 0, w, h);
            apObj.putName("Subtype", "Form");
            apObj.putName("Type", "XObject");
            apElement = apBuilder.createForm(apObj);
            apObj = apWriter.end();
            apObj.putRect("BBox", 0, 0, w, h);
            apObj.putName("Subtype", "Form");
            apObj.putName("Type", "XObject");


            Image img = Image.create(doc.getSDFDoc(), bmp);
            Element element = apBuilder.createImage(img, new Matrix2D(200, 0, 0, 250, 50, 500));

            // Save the PDFDoc. Once the method below is called, PDFNet will also sign the document using the information
            // provided.

  , 0, null);

          return true;

        catch(Exception ex)

            return false;
        finally {


Hi, the issue is that you need to save using e_incremental flag on the 2nd+ signature. Otherwise, you are modifying the existing PDF, breaking the digital signature., 0, SDFDoc.e_incremental); // incremental appends bytes to the PDF

This forum post explains more about Digital Signatures