Last active
September 16, 2023 07:41
How to Convert a JPG to Word in Python. For more details: https://kb.aspose.com/words/python/how-to-convert-a-jpg-to-word-in-python/
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
import aspose.words | |
from aspose.words import * | |
license = aspose.words.License() | |
license.set_license("License.lic") | |
# Create a document | |
doc = Document() | |
# Instantiate the document builder | |
builder = DocumentBuilder(doc) | |
# Insert the image | |
builder.insert_image("image1.jpg") | |
# Save the document | |
doc.save("Output.doc") | |
print("JPG to Word file converted successfully") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment