Convert SVGZ to SVG using C#
SVGZ is a compressed version of the SVG file format, which is widely used for vector graphics on the web. Although SVGZ offers performance benefits due to its smaller file size, sometimes you may need to convert it back to the uncompressed SVG format. With Aspose.SVG for .NET , converting SVGZ to SVG is quick and easy.
Why Convert SVGZ to SVG?
SVGZ files are ideal for web use due to their reduced size, but in many cases, it is advisable to convert them back to standard SVG. Uncompressed SVG files are easier to edit, debug, and view and are better supported by older systems and software, allowing for wider compatibility and ease of collaboration. Here is a simple C# code snippet to convert a compressed SVGZ file to a standard SVG:
C# code to save SVGZ as SVG
using Aspose.Svg.Saving;
...
// Load an SVG document
SVGDocument document = new SVGDocument("document.svgz");
// Save the document as SVGZ
document.Save("document.svgz", SVGSaveFormat.SVG);
Steps to Save SVGZ as SVG
- Load an SVG document using one of the SVGDocument() constructors.
- Call the
Save(
path,saveFormat) method withSVGSaveFormat.SVGto export it as an uncompressed SVG. The resulting SVG file will maintain all the structural elements and visual accuracy of the original graphic without any compression.
See Also – Convert SVG to SVGZ
- The Aspose.SVG for .NET API also allows you to perform the reverse conversion from SVG to SVGZ with just a few lines of C# code!
- Aspose.SVG offers a free online SVG to SVGZ Converter that allows you to compress and convert SVG files directly in your browser, without the need for any installation or registration. This fast and user-friendly tool is designed for developers, designers, and anyone needing lightweight, optimized vector graphics for web or print use. Simply upload your SVG file, and download the compressed SVGZ in seconds.
Get Started with Aspose.SVG for .NET API
If you are interested in developing scalable vector graphics and their application, install our flexible, high-speed Aspose.SVG for .NET API with a powerful set of interfaces for C# and other .NET programming languages.Install from command line as
nuget install Aspose.SVG or via Package Manager Console of Visual Studio with Install-Package Aspose.SVG.
Alternatively, get the offline MSI installer or DLLs in a ZIP file from
downloads.
Aspose.SVG for .NET API is a standalone library and does not depend on any software for SVG document processing.For more details about C# library installation and system requirements, please refer to Aspose.SVG Documentation.
Other Supported Features
Create, convert, merge, edit SVG documents, convert color codes, vectorize images and more!