Created
January 15, 2026 19:49
-
-
Save GroupDocsGists/0fd0e5ddb3b557d0287778cc71ded879 to your computer and use it in GitHub Desktop.
Building a JPG to SVG File Converter in .NET
This file contains hidden or 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
| using System; | |
| using GroupDocs.Conversion; | |
| using GroupDocs.Conversion.Options.Convert; | |
| namespace JpgToSvgDemo | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { | |
| // Set up license (required for production) | |
| var license = new License(); | |
| license.SetLicense("license.lic"); // Path to your .lic file | |
| // Input and output paths | |
| string inputPath = "sample.jpg"; | |
| string outputPath = "sample.svg"; | |
| try | |
| { | |
| // Initialize the converter with the JPG file | |
| using var converter = new Converter(inputPath); | |
| // Configure SVG conversion options | |
| var options = new SvgConvertOptions(); | |
| // Perform conversion | |
| converter.Convert(outputPath, options); | |
| Console.WriteLine($"Conversion completed successfully. SVG saved at {outputPath}"); | |
| } | |
| catch (Exception ex) | |
| { | |
| Console.WriteLine($"Error during conversion: {ex.Message}"); | |
| } | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment