Skip to content

Commit

Permalink
[#547] zxing.net is missing NuGet package README file
Browse files Browse the repository at this point in the history
  • Loading branch information
micjahn committed Feb 16, 2025
1 parent 7e48858 commit 4616feb
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 5 deletions.
11 changes: 7 additions & 4 deletions 3rdparty/NuGet/nuspec.xsd
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="nuspec"
targetNamespace="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
targetNamespace="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
elementFormDefault="qualified"
xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
xmlns:mstns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"
xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
xmlns:mstns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:complexType name="dependency">
Expand Down Expand Up @@ -75,6 +75,8 @@
<xs:element name="language" maxOccurs="1" minOccurs="0" type="xs:string" default="en-US" />
<xs:element name="tags" maxOccurs="1" minOccurs="0" type="xs:string" />
<xs:element name="serviceable" maxOccurs="1" minOccurs="0" type="xs:boolean" />
<xs:element name="icon" maxOccurs="1" minOccurs="0" type="xs:string" />
<xs:element name="readme" maxOccurs="1" minOccurs="0" type="xs:string" />
<xs:element name="repository" maxOccurs="1" minOccurs="0">
<xs:complexType>
<xs:attribute name="type" type="xs:string" use="optional" />
Expand Down Expand Up @@ -173,4 +175,5 @@
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</xs:schema>

55 changes: 55 additions & 0 deletions README_NUGET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
## About
A library which supports decoding and generating of barcodes (like QR Code, PDF 417, EAN, UPC, Aztec, Data Matrix, Codabar) within images.

## How to Use
The source code repository includes small examples for Windows Forms, Silverlight, Windows Phone and other project types.

The following example works with the classic .Net framework until version 4.8.1:

```csharp
// create a barcode reader instance
IBarcodeReader reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
txtDecoderType.Text = result.BarcodeFormat.ToString();
txtDecoderContent.Text = result.Text;
}
```
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
additional nuget package for a specific image library: https://www.nuget.org/packages?q=ZXing.Bindings
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.

```csharp
// example shows a simple decoding snippet as a .Net 8.0 console appliation which uses the ZXing.Windows.Compatibility package
using System.Drawing;
using ZXing.Windows.Compatibility;

// create a barcode reader instance
var reader = new BarcodeReader();
// load a bitmap
var barcodeBitmap = (Bitmap)Image.FromFile("C:\\sample-barcode-image.png");
// detect and decode the barcode inside the bitmap
var result = reader.Decode(barcodeBitmap);
// do something with the result
if (result != null)
{
Console.WriteLine(result.BarcodeFormat.ToString());
Console.WriteLine(result.Text);
}
else
{
Console.WriteLine("No barcode found");
}
```

## Related Packages
There are several packages which can be used with different image libraries in combination with ZXing.Net.
https://www.nuget.org/packages?q=ZXing.Bindings

## Feedback
Bug reports and contributions are welcome at [the GitHub repository](https://github.com/micjahn/ZXing.Net).
4 changes: 3 additions & 1 deletion zxing.nuspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<package xmlns="http://schemas.microsoft.com/packaging/2013/05/nuspec.xsd">
<metadata>
<version>0.17.0</version>
<authors>Michael Jahn</authors>
Expand All @@ -11,6 +11,7 @@
<id>ZXing.Net</id>
<title>ZXing.Net</title>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<readme>docs\README.md</readme>
<description>
ZXing.Net is a port of ZXing, an open-source, multi-format 1D/2D barcode image processing library originally implemented in Java.
It has been ported by hand with a lot of optimizations and improvements.
Expand Down Expand Up @@ -59,6 +60,7 @@
</metadata>
<files>
<file src="Icons\logo.jpg" target="." />
<file src="README_NUGET.md" target="docs\README.md" />
<file src="Build\Release\net2.0\zxing.dll" target="lib\net20\zxing.dll" />
<file src="Build\Release\net2.0\zxing.pdb" target="lib\net20\zxing.pdb" />
<file src="Build\Release\net2.0\zxing.XML" target="lib\net20\zxing.XML" />
Expand Down

0 comments on commit 4616feb

Please # to comment.