Last active
November 24, 2024 14:32
-
-
Save aspose-com-kb/1554b9d0a528135600b7424b14886987 to your computer and use it in GitHub Desktop.
Convert HTML to GIF in Python. For further details:https://kb.aspose.com/html/python/convert-html-to-gif-in-python/
This file contains hidden or 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.html | |
import os | |
from aspose.html import * | |
from aspose.html.converters import * | |
from aspose.html.saving import * | |
from aspose.html.drawing import * | |
from aspose.html.rendering.image import * | |
path = "C:/" | |
document_path = os.path.join(path, "input.html") | |
save_path = os.path.join(path, "html-to-gif.gif") | |
# Initialize HTML document | |
document = HTMLDocument(document_path) | |
# Initialize ImageSaveOptions | |
options = ImageSaveOptions(ImageFormat.GIF) | |
# Convert HTML to GIF | |
Converter.convert_html(document, options, save_path) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment