Convert SVG to PNG – Online Converter and C# code
Mục lục
Convert SVG to PNG Using C#
SVG is an XML language for creating two-dimensional vector and mixed vector/raster graphics. In order to convert SVG to PNG, we will use
Aspose.HTML for .NET
API which is a feature-rich, powerful and easy to use document manipulation and conversion API for the C# platform. SVG conversion is often required to take advantage of other formats. Using our document processing library, you can programmatically convert SVG to PNG image with full control over various conversion options with just a few lines of code.
Steps to Convert SVG to PNG in C#
- Load an SVG file using one of the SVGDocument() constructors of the
SVGDocument
class. - Create a new
ImageSaveOptions
object. By default, the Format property is
PNG. - Use the
ConvertSVG()
method to save SVG as a PNG image. You need to pass the SVGDocument, ImageSaveOptions, and output file path to the ConvertSVG() method.
SVG to PNG Conversion in Documentation
PNG file format supports lossless image compression that makes it popular among its users. Please visit the documentation article
Convert SVG to PNG
to learn more about Aspose.HTML for .NET API conversion features and to consider C# examples for the most common SVG to PNG conversion scenarios. In the article, you will find information on how to convert SVG to PNG using ConvertSVG() methods and how to apply ImageSaveOptions.
Free Online Converters
Aspose.HTML offers free online
applications
for converting
HTML
,
XHTML
,
MHTML
,
EPUB
,
XML
or
Markdown
documents to PDF, XPS, DOCX, JPG, PNG, BMP, TIFF, GIF, Markdown and other formats. Just upload, convert your documents and get results in a few seconds. You don’t need any additional software. Powerful C# API allows converting HTML to popular formats quickly and in high quality. Try our forceful online Converters for free now!
FAQ
1. Why convert SVG?
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. Sometimes SVG files may not be compatible with some software, and you need to convert them to another file format to open and read them.
2. What other file formats can I convert SVG to?
Aspose.HTML API provides a wide range of SVG conversions to popular formats, such as PDF, XPS, DOCX, JPEG, PNG, BMP, TIFF, GIF, and more.
3. What formats does Aspose.HTML support?
Out-of-the-box we support HTML, XHTML, SVG, EPUB, MHTML and Markdown documents. As a part of mentioned documents, we also support CSS, JavaScript, XPath and HTML5 Canvas specifications.