Last active
September 20, 2024 23:21
Convert SVG to PNG in Python. For more details: https://kb.aspose.com/svg/python/convert-svg-to-png-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.svg | |
from aspose.svg import * | |
from aspose.svg.converters import * | |
from aspose.svg.drawing.skiasharp import * | |
from aspose.svg.saving import * | |
# Activate the Aspose.SVG.Drawing.SkiaSharp feature | |
Configuration.set_extension(SkiaModule()) | |
options = ImageSaveOptions() | |
options.format = aspose.svg.rendering.image.ImageFormat.PNG | |
with SVGDocument("svg.svg") as document: | |
# Convert SVG to PNG | |
Converter.convert_svg(document, options, "SVGtoPNG.png") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment