How to Begin Editing a Document in Python

Cloudmersive
2 min readJan 15, 2021

--

Editing a document online can be a challenging task if you’re not sure where to start. Fortunately, we’re here to provide you with the tools you need to produce safe and successful edits. The following API will call a begin editing function on your document and create a secure URL that you can perform one or more editing operations on, including inserting tables, deleting pages, or replacing matching paragraphs.

To use this Cloudmersive API, run this command to install the SDK:

pip install cloudmersive-convert-api-client

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

from __future__ import print_function
import time
import cloudmersive_convert_api_client
from cloudmersive_convert_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_convert_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_convert_api_client.EditDocumentApi(cloudmersive_convert_api_client.ApiClient(configuration))
input_file = '/path/to/inputfile' # file | Input file to perform the operation on.
try:
# Begin editing a document
api_response = api_instance.edit_document_begin_editing(input_file)
pprint(api_response)
except ApiException as e:
print("Exception when calling EditDocumentApi->edit_document_begin_editing: %s\n" % e)

As mentioned earlier, this will return a ready-to-edit URL for your document. To ensure the security of your information, the URL is temporary and will automatically expire from the in-memory cache after 30 minutes. To retrieve your personal API key and access to 800 calls/month, simply register for free on the Cloudmersive website.

--

--

Cloudmersive
Cloudmersive

Written by Cloudmersive

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

No responses yet