SVG Converter – Python Code Examples

Contents
[ Hide Show ]

SVG files are Scalable Vector Graphics Files that use XML based text format for describing the appearance of an image. The word Scalable refers to the fact that SVG can be scaled to different sizes without losing any quality. A text-based description of such files makes them independent of resolution. It is one of the most used formats for website building and print graphics to achieve scalability.

The main highlight of Aspose.HTML is the conversion feature. Converting between formats is required for various reasons: to work in a familiar, convenient format or to take advantage of different formats for specific tasks. The Aspose.Html.Converters namespace implements easy access to conversion methods. It provides a wide range of SVG conversions to popular formats, such as PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, and GIF.

The articles in this section provide information on the list of supported SVG conversions and how to perform them using convert_svg() methods. It can be different scenarios, but any SVG conversion can be made with a few required steps:

  1. Load an SVG document. You can load SVG from a file, SVG code, or URL.
  2. Create a Save Options object. The aspose.html.saving namespace offers PdfSaveOptions, XpsSaveOptions, DocSaveOptions, and ImageSaveOptions classes to to describe specific save options during the conversion saving process. You may customize the rendering process to get the desired result.
  3. Invoke one of the convert_svg() methods and pass the required parameters to it.

Online SVG Converter

You can convert SVG to other formats with Aspose.HTML API in real time. First, load an SVG file from your local drive or URL and then run the example. The example uses the default save options. You will immediately receive the conversion result as a separate file.

                
            

Aspose.HTML offers free online SVG Converters for converting SVG files to a variety of popular formats. You can easily convert SVG to PDF, SVG to JPG, SVG to PNG, SVG to BMP, SVG to TIFF, or SVG to GIF. Just select a file, choose the format to convert, and you’re done. It’s fast and completely free!

Subscribe to Aspose Product Updates

Get monthly newsletters & offers directly delivered to your mailbox.