Gufel.QrRender 1.0.0

dotnet add package Gufel.QrRender --version 1.0.0
                    
NuGet\Install-Package Gufel.QrRender -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Gufel.QrRender" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Gufel.QrRender" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Gufel.QrRender" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Gufel.QrRender --version 1.0.0
                    
#r "nuget: Gufel.QrRender, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Gufel.QrRender@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Gufel.QrRender&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Gufel.QrRender&version=1.0.0
                    
Install as a Cake Tool

Gufel Advanced QrCode Svg Render

Based on QRCoder nuget package, this package exports qrcode as high quality verctor svg format with customization and templates. You can also export svg as png or pdf with helper services and tools.

you can build high quality svg qrcode with 20 predefined template.

<img src="/Asset/template/13.png" width="60%" alt="13"> <img src="/Asset/template/15.png" width="60%" alt="14">

Features:

  1. ⭐ Customization of eye color, eye frame and eye
  2. ⭐ Gradient customization
  3. ⭐ Ability to define and rotate eye graphics based on placement
  4. ⭐ Ability to customize all graphics by defining dedicated storage
  5. ⭐ Template definition to simplify production
  6. ⭐ PDF and PNG output helper
  7. ⭐ Sample and Dockerized project
  8. ⭐ Outputs work on all operating systems: Linux, Mac and Windows
<img src="/Asset/diff/Vectorized.png" width="60%" alt="13"> <img src="/Asset/diff/Rasterisation.png" width="60%" alt="14">
Vectorized Rasterized

☕ Buy Me a Coffee (Crypto)

I spent many hours and produced a lot of code

testing and testing and testing refactoring and refactoring

If you'd like to support this project, you can send crypto to:

Bitcoin (BTC) 18gMqPRoLmG9vMvFYgdREpAtYPafYC2r5B

Dogecoin (DOGE) DNrtbptXEpWjniJ7zTMH14namJd38494Sv

Sample:

web api sample project found under folder: Gufel.QrRender.SampleWebApi

console project found under folder: Gufel.QrRender.SampleConsoleApp

To start the creation of qrcode, you need qrcode data that can be generated using payload or simple text. reffer to QRCoder for more information.

using var qrCodeData = QRCodeGenerator.GenerateQrCode("https://github.com/mahdiit", QRCodeGenerator.ECCLevel.M);

main class must load resources and svg graphics for creating qrcode, so we need to register default implementation and static content for resource:

services.AddSingleton<ILogoRepository, StaticLogoRepository>();
services.AddSingleton<ILogoLoader, LogoLoader>();
services.AddSingleton<IResourceRepository, StaticResourceRepository>();

note: default resource manger implemented and use static resource that embed in assembly file

next pass qrCodeData to main svg creator:

 using var svgRenderer = new SvgQrCode(app.GetRequiredService<IResourceRepository>());
 svgRenderer.SetQRCodeData(qrCodeData);

to complete creation of high quality vector qrcode you need to pass options or template. simple way is predefined template. see template list

svgRenderer.GetGraphic(templateId: 1).SvgContent

Convert Helper

there are 3 helpers for converting svg content to pdf or png and each of them has pros and cons and there is a commercial library that can help. in this library use a free/open source and fast solution.

Method Platform Free Quality
⭐ Svg.Skia Cross-platform Excellent
⭐ Magick.NET Cross-platform Excellent
⭐ Inkscape CLI Any OS w/ Inkscape Very high
Aspose.SVG Any Enterprise
Method Vector PDF Cross-Platform Free Dependencies
Svg.Skia SkiaSharp + Svg.Skia
Aspose.SVG Paid library
Magick.NET ❌ (raster) ImageMagick core
Inkscape CLI Inkscape installed

Inkscape Cli

for setting inkscape paramater see official inkscape documentation

for working with inkscape, first install Inkscape in os or docker image and then pass execlutable file to helper service:

// Windows 
// C:\Program Files\Inkscape\bin\inkscape.exe
// Linux
// usr/bin/inkscape
var inkscape = new InkscapeExportBuilder(path);
inkscape.ExportType([InkscapeExportTypes.pdf, InkscapeExportTypes.png]);
inkscape.InputFile(svgPath);

// default output path is input folder
await inkscape.Execute();

install docker file sample:

USER root
# Install Inkscape
RUN apt-get update && \
    apt-get install -y inkscape && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

# Print Inkscape path and set environment variable
RUN which inkscape
ENV INKSCAPE_PATH=/usr/bin/inkscape

SkiaSharp

SkiaSharpExport.SvgToPdf(svgPath, svgPath + "-skia.pdf");
SkiaSharpExport.SvgToPng(svgPath, svgPath + "-skia.png");

MagickNet

MagickNetExport.SvgToPdf(svgPath, svgPath + "-magick.pdf");
MagickNetExport.SvgToPng(svgPath, svgPath + "-magick.png");

License

By using this software, you agree to the terms of either the GPLv3 license or the commercial license, depending on your use in LICENSE.

Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.0 205 10/28/2025

Init public version