0

I am looking for a c# extension or nuget package to convert an SVG to PNG file with high picture quality.

3
  • I have edited out the off-topic coding question. You could place that on Stack Overflow, but not in its current form: it needs data (pictuires)
    – user416
    Commented Jun 27, 2019 at 6:24
  • 1
    Maybe like this: stackoverflow.com/a/35524206/480982 Commented Jun 27, 2019 at 9:04
  • OP is not asking how to write the code using that package/library, but for the package/library itself. So on-topic IMHO.
    – einpoklum
    Commented Aug 17, 2021 at 6:47

1 Answer 1

1

Consider using the DocumentConverter class from the Leadtools.Document.Sdk Nuget Package. You can use this class to take in your SVG as an input file and convert it to a number of supported Image and document formats, including PNG. (Disclaimer: I am an employee of this package’s vendor).

The C# code to use this would look like the following:

using (DocumentConverter documentConverter = new DocumentConverter())
{
   var format = RasterImageFormat.Png;
   var jobData = DocumentConverterJobs.CreateJobData(inFile, outFile, format);
   jobData.JobName = "SVG to PNG job";
   var job = documentConverter.Jobs.CreateJob(jobData);
   documentConverter.Jobs.RunJob(job);
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.