Skip to content

Commit 4616feb

Browse files
committed
[#547] zxing.net is missing NuGet package README file
1 parent 7e48858 commit 4616feb

File tree

3 files changed

+65
-5
lines changed

3 files changed

+65
-5
lines changed

3rdparty/NuGet/nuspec.xsd

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<xs:schema id="nuspec"
3-
targetNamespace="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
3+
targetNamespace="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
44
elementFormDefault="qualified"
5-
xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
6-
xmlns:mstns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
5+
xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
6+
xmlns:mstns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
77
xmlns:xs="http://www.w3.org/2001/XMLSchema"
88
>
99
<xs:complexType name="dependency">
@@ -75,6 +75,8 @@
7575
<xs:element name="language" maxOccurs="1" minOccurs="0" type="xs:string" default="en-US" />
7676
<xs:element name="tags" maxOccurs="1" minOccurs="0" type="xs:string" />
7777
<xs:element name="serviceable" maxOccurs="1" minOccurs="0" type="xs:boolean" />
78+
<xs:element name="icon" maxOccurs="1" minOccurs="0" type="xs:string" />
79+
<xs:element name="readme" maxOccurs="1" minOccurs="0" type="xs:string" />
7880
<xs:element name="repository" maxOccurs="1" minOccurs="0">
7981
<xs:complexType>
8082
<xs:attribute name="type" type="xs:string" use="optional" />
@@ -173,4 +175,5 @@
173175
</xs:sequence>
174176
</xs:complexType>
175177
</xs:element>
176-
</xs:schema>
178+
</xs:schema>
179+

README_NUGET.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
## About
2+
A library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.
3+
4+
## How to Use
5+
The source code repository includes small examples for Windows Forms, Silverlight, Windows Phone and other project types.
6+
7+
The following example works with the classic .Net framework until version 4.8.1:
8+
9+
```csharp
10+
// create a barcode reader instance
11+
IBarcodeReader reader = new BarcodeReader();
12+
// load a bitmap
13+
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
14+
// detect and decode the barcode inside the bitmap
15+
var result = reader.Decode(barcodeBitmap);
16+
// do something with the result
17+
if (result != null)
18+
{
19+
txtDecoderType.Text = result.BarcodeFormat.ToString();
20+
txtDecoderContent.Text = result.Text;
21+
}
22+
```
23+
If you want to try the sample code above within a project which target .Net Standard or .Net 5.0 or higher then you have to add one of the
24+
additional nuget package for a specific image library: https://www.nuget.org/packages?q=ZXing.Bindings
25+
The main package of ZXing.Net for such platforms only contains the core classes which are not dependent on a specific assembly for image formats.
26+
27+
```csharp
28+
// example shows a simple decoding snippet as a .Net 8.0 console appliation which uses the ZXing.Windows.Compatibility package
29+
using System.Drawing;
30+
using ZXing.Windows.Compatibility;
31+
32+
// create a barcode reader instance
33+
var reader = new BarcodeReader();
34+
// load a bitmap
35+
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
36+
// detect and decode the barcode inside the bitmap
37+
var result = reader.Decode(barcodeBitmap);
38+
// do something with the result
39+
if (result != null)
40+
{
41+
Console.WriteLine(result.BarcodeFormat.ToString());
42+
Console.WriteLine(result.Text);
43+
}
44+
else
45+
{
46+
Console.WriteLine("No barcode found");
47+
}
48+
```
49+
50+
## Related Packages
51+
There are several packages which can be used with different image libraries in combination with ZXing.Net.
52+
https://www.nuget.org/packages?q=ZXing.Bindings
53+
54+
## Feedback
55+
Bug reports and contributions are welcome at [the GitHub repository](https://github.com/micjahn/ZXing.Net).

zxing.nuspec

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
2+
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
33
<metadata>
44
<version>0.17.0</version>
55
<authors>Michael Jahn</authors>
@@ -11,6 +11,7 @@
1111
<id>ZXing.Net</id>
1212
<title>ZXing.Net</title>
1313
<requireLicenseAcceptance>false</requireLicenseAcceptance>
14+
<readme>docs\README.md</readme>
1415
<description>
1516
ZXing.Net is a port of ZXing, an open-source, multi-format 1D/2D barcode image processing library originally implemented in Java.
1617
It has been ported by hand with a lot of optimizations and improvements.
@@ -59,6 +60,7 @@
5960
</metadata>
6061
<files>
6162
<file src="Icons\logo.jpg" target="." />
63+
<file src="README_NUGET.md" target="docs\README.md" />
6264
<file src="Build\Release\net2.0\zxing.dll" target="lib\net20\zxing.dll" />
6365
<file src="Build\Release\net2.0\zxing.pdb" target="lib\net20\zxing.pdb" />
6466
<file src="Build\Release\net2.0\zxing.XML" target="lib\net20\zxing.XML" />

0 commit comments

Comments
 (0)