Take a survey

API Quick Starts (Code Examples) > Signature Service API Quick Starts > Quick Start: Removing a digital signature using the web service API

Quick Start: Removing a digital signature using the web service API
The following C# code example removes a digital signature from a signature field named SignatureField1.
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.IO ; 
 
namespace ClearSignatureField
{
	class Class1
	{
		[STAThread]
		static void Main(string[] args)
		{
		try
			{
			//Create a SignatureServiceService client object
			SignatureServiceService  signClient = new SignatureServiceService(); 
			signClient.Credentials = new System.Net.NetworkCredential("administrator", "password");
       
			//Create a BLOB object
			BLOB inDoc = new BLOB();
 
			//Specify a PDF document that contains a digital signature
			string path = "C:\\Adobe\\Loan.pdf";
			FileStream fs = new FileStream(path, FileMode.Open);
 
			//Get the length of the file stream 
			int len = (int)fs.Length; 
			byte[] ByteArray=new byte[len];
 
			//Populate the byte array with the contents of the FileStream object
			fs.Read(ByteArray, 0, len);
			inDoc.binaryData = ByteArray; 
 
			//Specify the name of the signature field
			string fieldName = "SignatureField1[0]";
	
			//Clear the signature field
			BLOB signedDoc = signClient.clearSignatureField(inDoc,fieldName);
			
			//Populate a byte array with a BLOB data
			byte[] outByteArray=signedDoc.binaryData; 
 
			//Create a new file instance
			string fileName ="C:\\Adobe\\Loan.pdf" ; 
			FileStream fs2 = new FileStream(fileName, FileMode.OpenOrCreate);
 
			//Create a BinaryWriter object
			BinaryWriter w = new BinaryWriter(fs2);
			w.Write(outByteArray);
			w.Close();
			fs2.Close();
			}
		catch (Exception ee)
			{
			Console.WriteLine(ee.Message);  
			}
 
 
		}
	}
}
 
 

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/es/sdkHelp/programmer/sdkHelp/quickStarts_Signatures.16.13.html