nadiyaQ | Posts: 3

Multiple Signature Block on the same document for just one signer using SDK

0 votes
Hi, How can i use SDK to set multiple signature block on the same document for a single signer and the values to be passed dynamically. I have a list of coordinates which specify the position and size of my signature block for a single signer on a single document. How can i handle that with the SDK in java? I am looking forward to loop the process of adding signature fields on the document. The size of list might also vary in every request .

harishaidary | Posts: 1812

Reply to: Multiple Signature Block on the same document for just one signer using SDK

0 votes
Hi Nadiya, Here's an example of what I would do:
private static void addSignatures(DocumentPackage retrievedPackage, String documentId, Map coord, String signerEmail) {
	
	for (Map.Entry entry : coord.entrySet()) {

		Signature signature = SignatureBuilder.signatureFor(signerEmail)
				.onPage(Integer.parseInt(entry.getKey()))
				.atPosition(entry.getValue().getX(), entry.getValue().getY())
				.build();
		
		String addedSignature = eslClient.getApprovalService().addSignature(retrievedPackage, documentId, signature);
		
	}
}
public class Coordinates {
	
    private int X;
    private int Y;

    public Coordinates() {
        this(0,0);
    }        
    public Coordinates(int X, int Y) {
        this.X = X;
        this.Y = Y;
    }
    public int getX() {
        return X;
    }
    public int getY() {
        return Y;
    }
    public void setX(int X) {
        this.X = X;
    }
    public void setY(int Y) {
        this.Y = Y;
    }
}
Of course, there are many other ways to accomplish but this should get you going nicely.

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off