We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting the IsSigned and IsValid in SignatureLine

I am currently trying to update an existing Signature Line that is already inserted in to a in a Word Document and saved as a Template.

I am able to set the image path to a signature file but the image doesn’t show up. In reviewing the elements it appears that the IsValid and IsSigned are set to True when completed manually, via double clicking and manual navigation to the image file.

Currently the Aspose Word Signature class only allows for a “get” and does not have a “Set”. Is this by design or is this a feature currently on your development roadmap?

Below is an example of what I am trying to do:

Document doc = new Document(filename);
NodeCollection shapes = doc.GetChildNodes(NodeType.Shape, true);
foreach (Aspose.Words.Drawing.Shape shape in shapes)
{
if (shape.IsSignatureLine)
{
shape.SignatureLine.Signer = User.Current.FullName;
shape.SignatureLine.SignerTitle = User.Current.Title;
shape.SignatureLine.ShowDate = true;
shape.ImageData.SourceFullName = User.Current.ESignatureImagePath;
shape.SignatureLine.IsSigned = true;
shape.SignatureLine.IsValid = true;
}
}

@KyleKarlin,

Thanks for your inquiry.

To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word document.
  • Please attach the output Word file that shows the undesired behavior.
  • Please attach the image file.

As soon as you get these pieces of information ready, we’ll start investigation into your issue and provide you more information. Thanks for your cooperation.

Please use the DocumentBuilder.InsertSignatureLine method to insert a signature line at the current position and remove the existing Shape using Shape.Remove method. Hope this help you.

Best Regards,
Tahir Manzoor

Please find attached the is the signature file (User.Current.ESignatureImagePath) that i am trying to associate with the image data of the signature line.

Signature.jpg (2.1 KB)

Unfortunately the forum will not allow me to upload the Document.docx. It requires a jpg, jpeg, png, gif, zip, or pdf. Please let me know if there is a better way to get this to you.The document is just a word document with a signature line that has been added.

I have included a copy of the before and after in a PDF so that you can see what i am trying to do.
Aspose Test - After.pdf (144.0 KB)
Aspose Test - Before.pdf (96.9 KB)

@KyleKarlin,

Please zip your Word document and attach the ZIP file here for testing. We will investigate the issue and provide you more information about your issue. Thanks for your cooperation.

Best Regards,
Tahir Manzoor

Here is a copy of the Word Doc that i am using as a Test. Thank you for looking into this and helping me on this item.

Aspose Test.zip (18.2 KB)

@KyleKarlin,

Thanks for sharing the document. Please note that SignatureLine.IsValid and SignatureLine.IsSigned are readonly properties. These proeprties get the information from the SignatureLine either it is valid/signed or not. The Shape.ImageData.SourceFullName gets or sets the path and name of the source file for the linked image. You can not use it for Signature Shape.

Please manually create your expected output Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code. Thanks for your cooperation.

Best Regards,
Tahir Manzoor

Here is the completed document and has the signature image and has the SignatureLine.IsValid and SignatureLine.IsSigned are set to true if you look at the properties of the SignatureLine. This was done manually in the word document.

Aspose Test.zip (47.0 KB)

@KyleKarlin,

Thanks for sharing the detail. Unfortunately, Aspose.Words does not provide API to sign the signature line in Word document. However, we have logged this feature request as WORDSNET-15641 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

Best Regards,
Tahir Manzoor

@KyleKarlin,

The issues you have found earlier (filed as WORDSNET-15641) have been fixed in this Aspose.Words for .NET 17.8 update and this Aspose.Words for Java 17.8 update.