How to add multiple signatures in a document using .NET

Hi,
Am working on signature part, i have placed multiple png/jpg in document… It seems i can’t pass multiple png/jpg to save in that document. Any suggestion?

        using (Signature signature = new Signature(document))
        {
            ImageSignOptions options = new ImageSignOptions(imageFilePath)
            {
                Left = 10,
                Top = 50,
                Height = 60,
                Width = 120,
                PageNumber = 1
            };
            SignResult result = signature.Sign(savePath, options);
        }
1 Like

@Arun_fz,

Do you mean you have placed multiple images in a folder (e.g. imageFilePath)? Please share following details so that we can further investigate this scenario:

  • Complete sample code/application
  • Problematic file
  • API version and variant (e.g. .NET 20.3, Java 20.3)

Yes, imageFilePath is an image path, in that i can pass only one image at that time but i need to upload multiple signature(image)…

@Arun_fz,

We are investigating this scenario. Your investigation ticket ID is SIGNATURENET-2740. As there’s any update, you’ll be notified.

@Arun_fz,

Please have a look at this documentation article. This example shows that there’s no limitation to add several signatures.
So, you may create multiple ImageSignOptions instances as per your need and add them to List<SignOptions> and pass this list to Sign method.

@atirtahir3

It seems esign are in different format like BarcodeSign, QrCodeSign and ect…
I have multiple png file which is comes dynamically and have to apply it in document.
Is that possible to apply?

1 Like

@Arun_fz

This is how you can apply multiple PNG files to the source document.

using (var signature = new Signature("sample.pdf"))
{
    var options1 = new ImageSignOptions("sample1.png")
    {
        // set signature position
        Left = 100,
        Top = 100,
        AllPages = true
    };
    var options2 = new ImageSignOptions("sample2.png")
    {
        // set signature position
        Left = 100,
        Top = 100,
        AllPages = true
    };

    List<SignOptions> listOptions = new List<SignOptions>();
    listOptions.Add(options1);
    listOptions.Add(options2);

    // sign document to file
    SignResult result = signature.Sign(outputFilePath, listOptions);

    Console.WriteLine($"\nSource document signed successfully with {result.Succeeded.Count} signature(s).\nFile saved at {outputFilePath}.");
}

For more options/examples could be found here.