How to Begin Editing a Document Online in C#

Cloudmersive
2 min readFeb 8, 2021

If you’re trying to edit a document online but don’t know where to begin, we’ve got an API to help with that. The following API will create a secure URL that opens up your document for further editing functions including deleting pages, deleting slides, inserting tables, and more. To fully ensure the safety of your document, the editing URL is temporary and will automatically expire from the in-memory cache after 30 minutes.

To use the Cloudmersive API, run this command to install the .NET Framework SDK (.NET Core also available):

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 3.2.8

Next, you can call the begin editing function with the following code:

using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;
namespace Example
{
public class EditDocumentBeginEditingExample
{
public void main()
{
// Configure API key authorization: Apikey
Configuration.Default.AddApiKey("Apikey", "YOUR_API_KEY");
var apiInstance = new EditDocumentApi();
var inputFile = new System.IO.FileStream("C:\\temp\\inputfile", System.IO.FileMode.Open); // System.IO.Stream | Input file to perform the operation on.
try
{
// Begin editing a document
string result = apiInstance.EditDocumentBeginEditing(inputFile);
Debug.WriteLine(result);
}
catch (Exception e)
{
Debug.Print("Exception when calling EditDocumentApi.EditDocumentBeginEditing: " + e.Message );
}
}
}
}

From here, you can continue on your editing journey with the returned URL. Once your changes are completed, you can leverage our ‘FinishEditing’ API to seal the deal and download the result. Check out the Cloudmersive website to retrieve your free API key and gain access to 800 monthly calls across our variety of APIs.

--

--

Cloudmersive

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.