I'm looking for a free to use c# library/code to create barcodes. Secifically I need to be able to create QR-Code type barcodes. I'm looking for free to use (Open Source or just Free, etc.) not pay to use.
-
Here is QR code generator application,you can go through the details here http://blogs.gcpowertools.co.in/2011/09/how-to-create-qrcode-barcode-using.html – Abhishek Nov 21 '11 at 16:05
-
4Take a look at this one [http://qrcodenet.codeplex.com/](http://qrcodenet.codeplex.com/) – George Mamaladze Oct 05 '11 at 20:53
4 Answers
Take a look QRCoder - pure C# open source QR code generator. Can be used in three lines of code
QRCodeGenerator qrGenerator = new QRCodeGenerator();
QRCodeGenerator.QRCode qrCode = qrGenerator.CreateQrCode(textBoxQRCode.Text, QRCodeGenerator.ECCLevel.Q);
pictureBoxQRCode.BackgroundImage = qrCode.GetGraphic(20);

- 4,011
- 5
- 27
- 32

- 1,715
- 1
- 17
- 22
-
2Note that this project uses C# 6. The significance is that the licensing of free Visual Studio environments (that support C# 6) prohibit commercial use except under very few and limited circumstances. If you've purchased a VS license you will require 2015 or later to get the C# 6 ability. – DAG Oct 13 '16 at 16:33
-
2The commercial use part could be bypassed by using raw msbuild to compile the project before commercial release. On the other hand - if you develop commercial software, then you could also buy a commercial version of VS. – netblognet Jan 30 '17 at 13:22
-
1QRCoder is really nice - it's simple, really is a few lines of code. VS 2015 is not required ? - it works just fine in VS 2010/NuGet. – Matthew M. Mar 30 '17 at 20:06
-
@DAG A non-enterprise client is a fairly generous circumstance, don't you think? – Ian Warburton May 09 '17 at 10:23
-
@MatthewM. the source code is chock full of interpolated strings... how did you get that C# 6 feature to compile in VS 2010? For example see http://stackoverflow.com/questions/31514767/string-interpolation-doesnt-work-with-net-framework-4-6 – DAG May 10 '17 at 16:02
-
@DAG I just added it with NuGet to my VS 2010 project. I do have .NET 4.6.x on my machine as well ; perhaps that is what enables it to work? I did no digging - it just worked. – Matthew M. May 31 '17 at 23:11
-
Sometime I get error: System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+. with this library. Can I solve this? – Hong Nguyen Feb 28 '18 at 03:40
-
@HongNguyen try to copy your image. It is probably related to your code, not this library. – Igor Yalovoy Feb 28 '18 at 22:22
-
I am using VS2013 targeting Framework 4.5. Can't I use a ZKWeb version compatible with F4.5 along with QRCoder? – Joster Mar 08 '18 at 11:46
-
It works in VS2013 if you load it using NuGet because you end up getting the BIN file. You cant change the code. But it works so why do you want to change the code? You can get the pay load generators here https://github.com/codebude/QRCoder/wiki/Advanced-usage---Payload-generators – alikuli May 12 '19 at 17:11
-
QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(textBoxQRCode.Text, QRCodeGenerator.ECCLevel.Q); QRCode qrCode = new QRCode(qrCodeData); pictureBoxQRCode.BackgroundImage = qrCode.GetGraphic(20); The usage was updated, referenced by the same git repo – mohaa8844 Nov 07 '22 at 05:38
ZXing is an open source project that can detect and parse a number of different barcodes. It can also generate QR-codes. (Only QR-codes, though).
There are a number of variants for different languages: ActionScript, Android (java), C++, C#, IPhone (Obj C), Java ME, Java SE, JRuby, JSP. Support for generating QR-codes comes with some of those: ActionScript, Android, C# and the Java variants.

- 86,735
- 21
- 136
- 138
-
@[Markus Jarderot] I'm not able to get a working download for ZXing. I downloaded the CodePlex one. The .chm documentation doesn't work - the topics load, but clicking "Display" doesn't display the content. And I can't get the solution to compile. All the projects in the solution give a long list of errors, and I can't figure out the purpose of any of the projects without working documentation, so I can't isolate and get a barebones example working. – Zesty Apr 30 '17 at 11:20
-
2@Zesty I'm assuming you mean [ZXing.Net](https://zxingnet.codeplex.com/). I'm also assuming the errors are signing errors. See [the documentation page](https://zxingnet.codeplex.com/documentation) for pre-requisites and steps to build. -- To view .chm files, you need to unblock them in the file properties. See [KB902225](https://support.microsoft.com/en-us/kb/902225) – Markus Jarderot Apr 30 '17 at 15:53
Generate QR Code Image in ASP.NET Using Google Chart API
Google Chart API returns an image in response to a URL GET or POST request. All the data required to create the graphic is included in the URL, including the image type and size.
var url = string.Format("http://chart.apis.google.com/chart?cht=qr&chs={1}x{2}&chl={0}", txtCode.Text, txtWidth.Text, txtHeight.Text);
WebResponse response = default(WebResponse);
Stream remoteStream = default(Stream);
StreamReader readStream = default(StreamReader);
WebRequest request = WebRequest.Create(url);
response = request.GetResponse();
remoteStream = response.GetResponseStream();
readStream = new StreamReader(remoteStream);
System.Drawing.Image img = System.Drawing.Image.FromStream(remoteStream);
img.Save("D:/QRCode/" + txtCode.Text + ".png");
response.Close();
remoteStream.Close();
readStream.Close();
txtCode.Text = string.Empty;
txtWidth.Text = string.Empty;
txtHeight.Text = string.Empty;
lblMsg.Text = "The QR Code generated successfully";
Click here for complete source code to download
Demo of application for free QR Code generator using C#

- 1
- 1

- 389
- 3
- 4
-
5
-
1It still works (as of 2016-10-21). You can even do a get. Try the following URL in your browser and you'll see a QR Code gen'd. http://chart.apis.google.com/chart?cht=qr&chs=250x250&chl=this%20is%20seriously%20cool – raddevus Oct 21 '16 at 13:39
-
-
var url = string.Format("https://chart.googleapis.com/chart?cht=qr&chs={1}x{2}&chl={0}", txtCode.Text, txtWidth.Text, txtHeight.Text); – Sandeep Maharjan Feb 12 '19 at 04:59
You can look at Open Source QR Code Library or messagingtoolkit-qrcode. I have not used either of them so I can not speak of their ease to use.