nerdolando-svg-api-client
1.0.2
dotnet add package nerdolando-svg-api-client --version 1.0.2
NuGet\Install-Package nerdolando-svg-api-client -Version 1.0.2
<PackageReference Include="nerdolando-svg-api-client" Version="1.0.2" />
paket add nerdolando-svg-api-client --version 1.0.2
#r "nuget: nerdolando-svg-api-client, 1.0.2"
// Install nerdolando-svg-api-client as a Cake Addin #addin nuget:?package=nerdolando-svg-api-client&version=1.0.2 // Install nerdolando-svg-api-client as a Cake Tool #tool nuget:?package=nerdolando-svg-api-client&version=1.0.2
This library converts SVG files to other graphic formats:
- PNG
- EPS
- EMF
- WMF
It connects to https://sevigo.eu application in order to do that.
You can use it for free. To use it:
- Register your api client here: https://sevigo.eu/Api
- Create application settings:
"SevigoApiOptions": { "ApiKey": <your API Key> }
- Register SevigoClient:
services.AddSevigo(Configuration.GetSection("SevigoApiOptions");
- Usage:
ApiClient adds itself to Dependency Injection mechanism. So you can call it like that:
using Nerdolando.SevigoApiClient; using Nerdolando.SevigoApiClient.Common;
class MyService { private readonly MainApiClient _sevigoApiClient;
public MyService(MainApiClient sevigoApiClient)
{
_sevigoApiClient = sevigoApiClient;
}
public async Task ConvertSvg(string svgContent)
{
var request = new ConvertFileRequest();
request.SvgContent = svgContent;
request.ExportType = ExportType.PNG; //or choose any other
var response = await _apiClient.ConvertSvg(request);
}
}
- Return value You will get example response:
{ "error": "", // error message if any, may be null "statusCode": 200, //request status code, if 401 or 403 it means that your API Key is incorrect "downloadUrl": "", //url where your converted file is stored - it will be available only for 7 days "isErrorStatusCode": true/false //tells you if request has succeeded or not. }
WARNING! As Sevigo is being hosted on Azure consumption plan, SevigoApi may not always be ready to run. Thus you should wake it up first - for this call CallHealthCheck() method before your first action.
That's all! Any questions? Leave a message at: admin@sevigo.eu
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net7.0 is compatible. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net7.0
- Microsoft.Extensions.Configuration.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Configuration.Binder (>= 7.0.4)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 7.0.0)
- Microsoft.Extensions.Http (>= 7.0.0)
- Nerdolando.SevigoApiClient.Common (>= 1.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.