5

I am looking for a QR Code generator library. It should be possible to use it in a .NET application.

  • Free or paid (Open or closed source)
  • Active maintenance of the library (there are some inactive projects)
  • Supports to create the different types (URL, Text etc.)

I basically want to build my own QR code batch creation process.

Output preferably as vector (EPS or SVG) file. TIF or PNG would be OK too.

If there is something available to use in PHP I would be interessted too.

I am NOT looking for any web service.

Update: Here you find a description of the different possible Barcode content types: https://github.com/zxing/zxing/wiki/Barcode-Contents

2
  • This is some sort of duplicate: stackoverflow.com/questions/5640581/…
    – Marcel
    Feb 2, 2015 at 7:14
  • Thanks for providing the related link. The focus of this question are libraries that are still in active mantenance in 2014/2015.
    – Matthias
    Feb 2, 2015 at 10:09

4 Answers 4

2

Not .NET or PHP but there is a very nifty qrcode library for python. It also installs a command line interface, e.g.:

qr http://softwarerecs.stackexchange.com/questions/16794/qr-code-generator-library-no-web-service > question.png

results in: enter image description here

It is worth mentioning that svg format output is supported via the factory=svg flag. It is also worth mentioning that python & qrcode are both very small - for Windows 64 machines and Python 3.10 this runs at:

  • Python installer: 28 MB
  • qrcode & dependencies < 4 MB
2
  • I have not installed any Python Tools. What is the easiest way to try the command line version?
    – Matthias
    Feb 2, 2015 at 10:19
  • 2
    If you would like to try things out without installing python then on a windows machine portable python portablepython.com/wiki/PortablePython2.7.6.1 can be just installed to a folder on your hard drive, (or a USB stick), then cd to where you installed\Scripts and easy_install qrcode should install it locally. If you are on Mac or Linux python should already be installed or an option from the SW center and just pip qrcode Feb 2, 2015 at 19:11
2

I have used http://zxingnet.codeplex.com/ with success in one of my spare-time projects. It's easy to use but also has some nice options on the QR-Code output.

It supports both generating and decoding of QR-Codes.

From their description:

The following barcodes are supported by the decoder: UPC-A, UPC-E, EAN-8, EAN-13, Code 39, Code 93, Code 128, ITF, Codabar, MSI, RSS-14 (all variants), QR Code, Data Matrix, Aztec and PDF-417. The encoder supports the following formats: UPC-A, EAN-8, EAN-13, Code 39, Code 128, ITF, Codabar, Plessey, MSI, QR Code, PDF-417, Aztec, Data Matrix

Assemblies are available for the following platforms:

.Net 2.0, 3.5 and 4.0
Silverlight 4 and 5
Windows Phone 7.0, 7.1 and 8.0
Windows CE
Windows RT Class Library and Runtime Components (winmd)
Portable Class Library
Unity3D (.Net 2.0 built without System.Drawing reference)
Xamarin.Android (formerly Mono for Android)
5
  • Do you know why it is still in Beta?
    – Matthias
    Feb 2, 2015 at 10:17
  • Still? No, I used it probably a year ago with and it worked well for me, generating QR-Codes for my own web service :-)
    – Marcel
    Feb 2, 2015 at 10:19
  • I tried the command line encoder example. It worked. It makes a white border around every QR code. Do you know if this is a requirement or why are they doing this?
    – Matthias
    Feb 2, 2015 at 14:56
  • 1
    @Matthias The white area is a requirement for a proper QR code. It's called the 'quiet zone' and helps decoding the QR code properly.
    – Marcel
    Feb 2, 2015 at 14:59
  • @Macrel does it support UTF8 Encoding?
    – Matthias
    Feb 2, 2015 at 18:15
2

Matthias, if you are looking for .NET QR barcode generation I recommend looking at LEADTOOLS Barcode SDK. These are commercial imaging libraries for reading and writing barcode symbologies. LEADTOOLS supports a wide range of 1D and 2D barcode symbologies, including QR. Please note: I work for the company that develops this library

Using the evaluation demo, I create a QR code with a value of this StackExchange post.

enter image description here

Code required for this is as follows:

         BarcodeEngine barcodeEngine = new BarcodeEngine();
         QRBarcodeData data = BarcodeData.CreateDefaultBarcodeData(BarcodeSymbology.QR) as QRBarcodeData;
         data.Bounds = new LogicalRectangle(bounds.X, bounds.Y, 0, 0, LogicalUnit.Pixel);
         data.Value = "http://softwarerecs.stackexchange.com/questions/16794/qr-code-generator-library-no-web-service";
         QRBarcodeWriteOptions writeOptions = engine.Writer.GetDefaultOptions(data.Symbology) as QRBarcodeWriteOptions;
         writeOptions.XModule = 30;
         barcodeEngine.Writer.WriteBarcode(image, data, null);

As for output support, LEADTOOLS is able to write EPS, SVG, TIFF, PNG and roughly 150 more file formats and compressions

1

Actually for PHP there are several solutions to generate QR-code in pure PHP, thus without any Web service.

In particular, I liked these two PHP packages suggested in the page above: PHP QR Code Generator and QR SAT.

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.