Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Document upload with Field extract example
- Loading branch information
1 parent
569355e
commit 85fb99b
Showing
3 changed files
with
85 additions
and
0 deletions.
There are no files selected for viewing
28 changes: 28 additions & 0 deletions
28
SignNow.Net.Examples/Documents/UploadDocumentWithFieldExtract.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using System.IO; | ||
using System.Threading.Tasks; | ||
using SignNow.Net.Model; | ||
|
||
namespace SignNow.Net.Examples.Documents | ||
{ | ||
public static class DocumentExamples | ||
{ | ||
/// <summary> | ||
/// Uploads a PDF with fillable field (Signature field) | ||
/// </summary> | ||
/// <param name="pdfFilePath">Full qualified path to your PDF with field tags.</param> | ||
/// <param name="token">Access token</param> | ||
public static async Task<SignNowDocument> UploadDocumentWithFieldExtract(string pdfFilePath, Token token) | ||
{ | ||
var signNowContext = new SignNowContext(token); | ||
|
||
await using var fileStream = File.OpenRead(pdfFilePath); | ||
// Upload the document with field extract | ||
var uploadResponse = signNowContext.Documents | ||
.UploadDocumentWithFieldExtractAsync(fileStream, "DocumentSampleWithSignatureTextTag.pdf").Result; | ||
|
||
var documentId = uploadResponse.Id; | ||
|
||
return await signNowContext.Documents.GetDocumentAsync(documentId); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.