Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save GroupDocsGists/0fd0e5ddb3b557d0287778cc71ded879 to your computer and use it in GitHub Desktop.

Select an option

Save GroupDocsGists/0fd0e5ddb3b557d0287778cc71ded879 to your computer and use it in GitHub Desktop.
Building a JPG to SVG File Converter in .NET
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