Skip to content

Instantly share code, notes, and snippets.

@aspose-com-kb
Last active September 20, 2024 23:21

Revisions

  1. aspose-com-kb revised this gist Sep 20, 2024. No changes.
  2. aspose-com-kb created this gist Sep 13, 2024.
    14 changes: 14 additions & 0 deletions Convert SVG to PNG in Python.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    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")