Save PDFs to a remote server in UWP
Saving a local document to a server is a straightforward process with Nutrient UWP SDK. This is achievable by programmatically exporting the document and then sending it to its remote destination.
The example below uses Microsoft’s HttpClient
(opens in a new tab) for demonstration purposes, though the general idea should be easy to adapt to whatever solution you choose to use:
var storageFile = PDFView.Document?.DocumentSource.GetFile()
using (var fileStream = await storageFile.OpenReadAsync()){ using (var client = new HttpClient()) { var contentStream = new HttpStreamContent(fileStream); var response = await client.PostAsync(address, contentStream); }}
For a better understanding of the use of StorageFile
and DocumentSource
in our SDK, you can read our save a document to a StorageFile guide.