This topic contains 1 reply, has 2 voices, and was last updated by  nadiyaQ 1 week ago.

  • Author
    Posts
  • Participant
    nadiyaQ
    Member since: 27.07.2017
    Number of posts: 2

    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 .

    Keymaster
    Haris
    Jedi Master
    Member since: 05.11.2015
    Number of posts: 1134

    Score

    0

    Hi Nadiya,

    Here’s an example of what I would do:

    private static void addSignatures(DocumentPackage retrievedPackage, String documentId, Map<String, Coordinates> coord, String signerEmail) {
    	
    	for (Map.Entry<String, Coordinates> 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.


    Haris Haidary
    eSignLive Technical Evangelist
    • This reply was modified 1 week, 1 day ago by  Haris.

You must be logged in to reply to this topic.