Skip to content

Instantly share code, notes, and snippets.

@blog-aspose-cloud
Last active April 26, 2022 03:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blog-aspose-cloud/731f220e0525008296d1bdd23123f5d9 to your computer and use it in GitHub Desktop.
Save blog-aspose-cloud/731f220e0525008296d1bdd23123f5d9 to your computer and use it in GitHub Desktop.
This Gist contains details on how to convert Word to PNG using Aspose.Words Cloud SDK for Python

Word to PNG Converter in Python


This Gist provides details on how to convert Word to PNG using Aspose.Words Cloud SDK for Python.

In following code sample, we are going to upload Word document from local drive to cloud storage and then convert word doc to PNG format. The resultant PNG is saved in cloud storage. For complete details, please visit Convert Word to PNG Online using Python | Word DOC to PNG.

Online Word to PNG Converter

Important Links

Home | Product Page | Docs | API Reference | Cloud Dashboard | Code Samples | Source Code | Blog | Free Support | Free Trial

// For complete examples and data files, please go to https://github.com/aspose-words-cloud/aspose-words-cloud-python
// Get client credentials from https://dashboard.aspose.cloud/
def wordtopng():
try:
# create an instance of WordsApi
words_api = WordsApi("bbf94a2c-6d7e-4020-b4d2-b9809741374e","1c9379bb7d701c26cc87e741a29987bb")
# Name of input word document
inputFileName = 'test_multi_pages.docx'
resultantFile = 'Converted.png'
# Upload source Word document to Cloud Storage
words_api.upload_file(asposewordscloud.models.requests.UploadFileRequest(open('C:\\Users\\shahbnay\\Downloads\\'+inputFileName, 'rb'), "", None))
# Create an object for Document conversion
request = asposewordscloud.models.requests.GetDocumentWithFormatRequest(inputFileName, "PNG", None, None, None,
None, resultantFile, None)
# initiate Word to PNG conversion operation
result = words_api.get_document_with_format(request)
# print message in console (optional)
print('Conversion process completed successfully !')
except Api as e:
print("Exception while Converting Word to PNG using Aspose.Words Cloud Api: {0}".format(e))
This Gist contains details on how to convert Word to PNG using Aspose.Words Cloud SDK for Python
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment