Following example demonstrates how to work with documents from URL.
publicstaticvoidRun(){stringurl="https://github.com/groupdocs-signature/GroupDocs.Signature-for-.NET/blob/api-v2/Examples/Resources/SampleFiles/sample.pdf?raw=true";using(Streamstream=GetRemoteFile(url)){using(Signaturesignature=newSignature(stream)){TextSignOptionsoptions=newTextSignOptions("John Smith"){Left=100,Top=100};// sign document to filesignature.Sign("SampleSigned",options);}}Console.WriteLine("\nSource document signed successfully.\nFile saved at "+outputFilePath);}privatestaticStreamGetRemoteFile(stringurl){WebRequestrequest=WebRequest.Create(url);using(WebResponseresponse=request.GetResponse())returnGetFileStream(response);}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: