Barcode Text not rendered in Viewer output
See original GitHub issueUsing:
.NET Framework 4.7.2 BinaryKits.Zpl.Label 3.1.0 BinaryKits.Zpl.Viewer 1.1.1
All other dependencies up to date.
Method for creating label preview:
DialogResult result = this.openFileDialog.ShowDialog();
if(result == DialogResult.OK) {
string content = File.ReadAllText(this.openFileDialog.FileName);
IPrinterStorage printerStorage = new PrinterStorage();
ZplElementDrawer drawer = new ZplElementDrawer(printerStorage);
ZplAnalyzer analyzer = new ZplAnalyzer(printerStorage);
AnalyzeInfo analyzeInfo = analyzer.Analyze(content);
foreach(LabelInfo labelInfo in analyzeInfo.LabelInfos) {
byte[] labelData = drawer.Draw(labelInfo.ZplElements);
File.WriteAllBytes("label.png", labelData);
}
}
Using this sample label data:
^XA
^BY3,2,100
^FO100,750,^BC^FDTEST0123456789^FS
^XZ
Actual:
Expected (labelary.com reference):
Issue Analytics
- State:
- Created a year ago
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Barcode fonts not rendering in report view or PDF export
My understanding was that the barcode was embedded in the report, and that the .PDF export should support that. Users *are* able to...
Read more >Barcode Reader - no output value to text box
Solved: Hi All, I'm trying to create a simple asset registry, part of this is has a barcode scanner function to make life...
Read more >code 128 barcode font not displaying in pdf [closed]
I want to generate code 128 barcode via font. In my Report Viewer, barcode is working well. But when I exported it into...
Read more >Barcode not showing up
How to check, open PDF file with a barcode in Reader/Acrobat, File>Properties> General, ... This could be the reason that the bar code...
Read more >Custom barcode font doesn't render on PDF document #6448
Problem: barcode font doesn't render properly in pdf.js, as shown below: As you can see, Adobe Reader displays this font properly.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can also set the
LabelPosition
of theBarcodeLib.Barcode
toTOPCENTER
, e.g.:Hi Tino, first I’m dont have the sufficient knowledge of C#, also I used tried to use the viewer to create PDF files intead images.
The first approach was to only append the image to a pdf file, but the final file size, was big on a document with some labels.
Then I tried pdfSharp to make “native pdf file”, it worked well.
The problem came when I made some tests, the ram memory usage was increasingly, lets say that on every page added to document, ram was increased by 20mb. I tried some some solutions, but no one worked. Then I tried on my win11 partition, and the ram leak was not present (I develop on Ubuntu).
After some research I discovered that the “System.Drawing.Common” library only works on windows (: and the problem with memory leak, was pdfSharp that doesn’t already implemented a solution to that.
Also this is the only open source library to analyze Zpl, and I use Go in my microservices, so I made a port.
I will upload that port to github and make open source this week, I’m solving some details. And I will explicitily say that is a port from this library, thats the reality and not a problem to me.
Also was a personal challenge, and it was fun.