Signer.Digital
User guide (Under Construction)
×
Menu
Index
SOAP API for Signing PDF
 
Action: SignPDFWithSettingName
 
Method Signature:
public SoapRespWithB64File SignPdfWithSettingName(string UserId, string ClientAppProfName, string SignSettingName, string SourceFile,
string SignatureFieldName = "", bool AppendMode = false, bool Certified = false, string AdminPasswordForSourcePDF = "",
string AdminPasswordForOutputPDF = "", string UserPasswordForOutputPDF = "", DocumentWatermark docWatermarkSetting = null)
 
Inpupt Paramaters:
 
Parameter
Description
UserId
UserId from Signer.Digital Server for which the SignatureSetting is Configured.
(Use Signer.Digital Console -> User Management to create UserId.)
ClientAppProfName
(OPTIONAL). Client Application Profile Name - used for logging.
If Signature Source is Kluis API, optionally used by Kluis OTP Key Authentication Configuration.
SignSettingName
Signature Setting Name as created for UserId under Signer.Digital Console -> Signature Settings.
SourceFile
Base64 encoded source PDF File.
SignatureFieldName
(OPTIONAL). If source pdf already contains blank signature field, please provide field name of that signature field, to use that field for inserting Digital Signature.
AppendMode
(OPTIONAL). Set to 'False' unless document contains form to be filled up after signing or needs to be signed further using other digital signature. (Multiple signatures on documents.)
Certified
(OPTIONAL). Set to 'True' if document needs to be certified.
AdminPasswordForSourcePDF
(OPTIONAL). Admin Password for source pdf so that service can read password protected pdf.
Empty if source pdf is not password protected.
AdminPasswordForOutputPDF
(OPTIONAL). Admin Password to be set for Signed Output PDF.
Empty if signed pdf is not to be admin password protected.
UserPasswordForOutputPDF
(OPTIONAL). User Password to be set for Signed Output PDF.
Empty if signed pdf is not to be password protected.
docWartermarkSetting
(OPTIONAL). Object of type DocumentWartermark:
    public class DocumentWatermark
    {
        public string WatermarkText;
        public float WatermarkFont;
        public byte[] DocWatermarkImage;
    }
 
 
Sample C# Call:
SoapRespWithB64File txnResp = await client.SignPdfWithSettingNameAsync("Admin", "MyClientAppProf", "InvoiceEastNarendra", pdfB64String, "", true, false, "", "", "", null);
 
For testing from Fiddler or Postman:
 
Method: POST
URIL: http://soap.signer.digital:8888/soap
HEADERS:
User-Agent: Fiddler
Host: soap.signer.digital:8888
Content-Length: 552
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/ISOAPManager/SignPdfWithSettingName"
Authorization: Basic QWRtaW4ERDSW6QDR45WRtaW4=  <= Replace with Base64 encoded <UserID>:<Password>
BODY:
<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SignPdfWithSettingName xmlns="http://tempuri.org/">
 <UserId>Admin</UserId>
 <ClientAppProfName>App</ClientAppProfName>
 <SignSettingName>Invoice</SignSettingName>
 <SourceFile/>
 <SignatureFieldName></SignatureFieldName>
 <AppendMode>true</AppendMode>
 <Certified>false</Certified>
 <AdminPasswordForSourcePDF/>
 <AdminPasswordForOutputPDF/>
 <UserPasswordForOutputPDF/>
 </SignPdfWithSettingName>
</s:Body>
</s:Envelope>
 
Response Object:
    public class SoapRespWithB64File
    {
        public bool IsSuccess;
        public string ErrorCode;
        public string SignedFile;  <== Base64 encoded Signed PDF file.
        public string TxnOutcome;
    }
 
Response Sample XML:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<SignPdfWithSettingNameResponse xmlns="http://tempuri.org/">
<SignPdfWithSettingNameResult xmlns:a="http://schemas.datacontract.org/2004/07/signer.digital.server" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:ErrorCode i:nil="true"/>
<a:IsSuccess>false</a:IsSuccess>
<a:SignedFile/>
<a:TxnOutcome>Source File not provided or empty.</a:TxnOutcome>
</SignPdfWithSettingNameResult>
</SignPdfWithSettingNameResponse>
</s:Body>
</s:Envelope>