Following example demonstrates how to process documents from FTP.
publicstaticvoidRun(){stringfilePath="ftp://localhost/sample.doc";using(Streamstream=GetFileFromFtp(filePath)){using(Signaturesignature=newSignature(stream)){QrCodeSignOptionsoptions=newQrCodeSignOptions("JohnSmith"){EncodeType=QRCodeTypes.QR,Left=100,Top=100};// sign document to filesignature.Sign("SampleSigned",options);}}}privatestaticStreamGetFileFromFtp(stringfilePath){Uriuri=newUri(filePath);FtpWebRequestrequest=CreateRequest(uri);using(WebResponseresponse=request.GetResponse())returnGetFileStream(response);}privatestaticFtpWebRequestCreateRequest(Uriuri){FtpWebRequestrequest=(FtpWebRequest)WebRequest.Create(uri);request.Method=WebRequestMethods.Ftp.DownloadFile;returnrequest;}privatestaticStreamGetFileStream(WebResponseresponse){MemoryStreamfileStream=newMemoryStream();using(StreamresponseStream=response.GetResponseStream())responseStream.CopyTo(fileStream);fileStream.Position=0;returnfileStream;}
More resources
GitHub Examples
You may easily run the code above and see the feature in action in ourΒ GitHub examples: