Hello,
i'm trying to place multiple signatures on a PDF file (i need 4 signatures).
I tried modifying OpenSignPDF but when i add more than two signatures i
always get that only the first and the last one are valid while all the
signatures among the two show a red X on them.

For instance... lets say that i have 3 signatures, then the first and third
signature are valid, but not the second. Same thing if i have 4 signatures:
the first and fourth signature are valid but not the second and the third.

This is a piece of the code that i am using:
            if (.....) { //First signature
                pdfStamper = PdfStamper.createSignature(pdfReader, bos,
'\0');

            } else { //Other signatures
                pdfStamper = PdfStamper.createSignature(pdfReader, bos,
'\0', null, true);
            }

      [CUT]

        if (.....) { //First signature
            signApp.setReason("Author");
            signApp.setCertificationLevel(
PdfSignatureAppearance.CERTIFIED_FORM_FILLING);
            signApp.setVisibleSignature(new Rectangle(100, 600, 200, 640),
1, null);
            PdfFormField sign2 = PdfFormField.createSignature(
pdfStamper.getWriter());
            sign2.setWidget(new Rectangle(200, 600, 300, 640), null);
            sign2.setFlags(PdfAnnotation.FLAGS_PRINT);
            sign2.setFieldName("sign2");
            sign2.setPage(1);
            pdfStamper.addAnnotation(sign2, 1);
            PdfFormField sign3 = PdfFormField.createSignature(
pdfStamper.getWriter());
            sign3.setWidget(new Rectangle(300, 600, 400, 640), null);
            sign3.setFlags(PdfAnnotation.FLAGS_PRINT);
            sign3.setFieldName("sign3");
            sign3.setPage(1);
            pdfStamper.addAnnotation(sign3, 1);
            PdfFormField sign4 = PdfFormField.createSignature(
pdfStamper.getWriter());
            sign4.setWidget(new Rectangle(400, 600, 500, 640), null);
            sign4.setFlags(PdfAnnotation.FLAGS_PRINT);
            sign4.setFieldName("sign4");
            sign4.setPage(1);
            pdfStamper.addAnnotation(sign4, 1);
        } else { //Other signatures
            signApp.setReason("Countersign");
            signApp.setCertificationLevel(
PdfSignatureAppearance.NOT_CERTIFIED);
            signApp.setVisibleSignature("sign" + (round+1)); //round tells
me which field to sign
        }

    [CUT]





Am i doing something wrong?

Thank you,
  Luca
-------------------------------------------------------------------------
SF.Net email is sponsored by:
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions
Buy the iText book: http://itext.ugent.be/itext-in-action/

Reply via email to