huysentruitw / barcoder Goto Github PK
View Code? Open in Web Editor NEWLightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.
License: MIT License
Lightweight Barcode Encoding Library for .NET Framework, .NET Standard and .NET Core.
License: MIT License
when generating code 128 with option gs1 = true it gives this error in
Code128Encoder.Encode("122345678901", true, true);
I installed these two packages as described in the documentation, the error thows in my netcoreapp3.1
var barcode = QrEncoder.Encode(qrcode.Content, Barcoder.Qr.ErrorCorrectionLevel.M, Encoding.Auto);
var renderer = new ImageRenderer(imageFormat: Barcoder.Renderer.Image.ImageFormat.Png);
using (var ms = new MemoryStream())
{
renderer.Render(barcode, ms);
var imageData = ms.ToArray();
this._skCanvas.DrawBitmap(SKBitmap.Decode(imageData), x, y);
}
I'm using your barcode generator and I want to thank you for sharing it with us! Right now I'm struggling with one thing. Is it done on purpose so that the width and height cannot be set? I wanted to set the width of the generated bar code and tried that by accessing Bounds, which is a struct...so its meant to be only readable.
Is there a way to set the width and heigt of the barcode before generating it?
Hi,
First of all, amazing work @huysentruitw. We are using your barcoder library for GS1 barcodes on stickers and it works flawlessly.
However, I do have one question. Whenever I generate the barcode as an image I get a white space (border?) around the barcode which takes up a lot of space in our word document which has a small size due to being a sticker. Is it possible to reduce this whitespace or remote it at all?
Now the GS1 Encoder is implemented it is easy to implement this as an optional overload on the Code-128 Barcode Type.
I've raised the following PR #20 for this small change along with a test, would be good to get it merged into main branch as this would solve a gap we currently have.
Hi,
First of all, amazing work @huysentruitw.
Is it possible to create rectangular datamatrixes (e.g. 36 columns 12 rows) ?
Thanks
Hi,
We have tested this in a C# app and it worked well. Thank you.
Do you know if it is possible to use this in a SSRS project (Reporting Services)?
Thank you,
Justin
Add feature for fixed rows and columns count in data matrix code.
Does this library support creating datamatrix barcodes that have multiple segments?
One labeling software I've seen called this "structured append".
I was able to get it to generate a barcode in this layout, but its restricted in size. Is it possible to automatically lengthen the CodeSize? For example, if I call DataMatrixEncoder.Encode(content, 16, 48, false); and it realizes there aren't enough segments to stuff the content in, it would just arbitrarily add more. It currently errors.
Support for FNC1
Are there any plans to update SixLabors.ImageSharp.Drawing to version 2.1.1?
Calling ImageRenderer.Render(IBarcode barcode, Stream outputStream) produces the error:
System.MissingMethodException: Method not found: 'Void SixLabors.ImageSharp.Formats.Jpeg.JpegEncoder.set_Quality(System.Nullable`1<Int32>)'.
And also the author issued a advisory report because a vulnerability was found.
Hello, I've been trying to work out if this is possible.
Can we set the length and height pixel / block sizes to be different? for example: its currently like 32 x 32 blocks, I want to set it so that it's like 16 x 64 blocks.
Thanks
DataMatrix now has a very simplistic GS1 implementation. Let's create an encoder that understands all AI's and can be reused for Code128.
I'm using this issue to track progress while working on it.
According to my research, it is possible to use UTF-8 in data matrix codes in addition to the ISO-8859-1 (Latin-1) standard.
ECI is used for this. In DataMatrixSpecialCodewords I found ECI but no usage of it.
(How) can I use encodings other than ISO-8859-1 in a data matrix code?
Hey,
the Code128Encoder is not working :-(
var code128 = Code128Encoder.Encode("123", false);
var renderer = new ImageRenderer();
using (var stream = new FileStream("output.png", FileMode.Create))
renderer.Render(code128, stream);
Process.Start("output.png");
I tried to read the code, but this code seems to be not valid!
Add DataMatrix and Code128 WPF Control
In QR code, my Norwegian characters are wrong (æøåÆØÅ). I checked the code in the barcoder/src/Barcoder/Qr/InternalEncoders/UnicodeEncoder.cs file and found the following error.
I corrected this in the code and now my Norwegian letters work fine. Here is my code now:
internal sealed class UnicodeEncoder : InternalEncoderBase
{
public override (BitList, VersionInfo) Encode(string content, ErrorCorrectionLevel errorCorrectionLevel)
{
bool insertBom = false; // Insert Byte order mark (BOM) for UTF-8
if (content == null) throw new ArgumentNullException(nameof(content));
foreach (char item in content)
{
if (item > 127) // Check if BOM is needed
{
insertBom = true;
break;
}
}
byte[] data = System.Text.Encoding.UTF8.GetBytes(content);
int dataLength = insertBom ? data.Length + 3 : data.Length;
EncodingMode encodingMode = EncodingMode.Byte;
var versionInfo = VersionInfo.FindSmallestVersionInfo(errorCorrectionLevel, encodingMode, dataLength * 8);
if (versionInfo == null)
throw new InvalidOperationException("Too much data to encode");
var bits = new BitList();
bits.AddBits((uint)encodingMode, 4);
bits.AddBits((uint)dataLength, versionInfo.CharCountBits(encodingMode));
if (insertBom) // Insert BOM
{
bits.AddByte(239);
bits.AddByte(187);
bits.AddByte(191);
}
foreach (var b in data)
bits.AddByte(b);
AddPaddingAndTerminator(ref bits, versionInfo);
return (bits, versionInfo);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.