Difference between the barcode fonts and other barcode libraries - c#

I would like to know the difference between the barcode fonts and other barcode libraries that are available.
How does these fonts work?
I mean how does it differ from other barcode libraries?can these barcode fonts be used for commercial purpose too?
Is it feasible enough to use in commercial applications?
There are some third party barcode libraries.
how do i see from their dll or lib file that which are libraries they have used.
Difference between free barcode fonts and other barcode libraries?

Since each barcode is a representation of a string, and each character in the string is represented exactly by a segment of a barcode, each character of the barcode string may be represented individually. Because of this, you can represent a barcode using a font (although barcodes such as EAN13 require a prefix and suffix, but these can be represented by a character as well).
The font simply draws a set of lines instead of drawing a 4, for example.
The other way of rendering barcodes is by drawing lines manually, which may produce the same output. Scaling of the barcode would have to be done manually as well. By using fonts you get the best result when printing a barcode though.
Using fonts usually provides the best result detail-wise, especially when printing. I can't think of a limitation that would make them not suitable for commercial applications. The ability to display barcodes in office applications is a nice bonus.
I don't know of any libraries, sofar I've used fonts or rendered my own.
If it's a .NET assembly you can use ILSpy to view contents / dependencies of the assembly if the library was merged into the main assembly, otherwise the dll will be in the folder of the application.

Related

Barcode (code 39) generation

I've been looking for solutions and so far the best one I think for my project is to use a free Code 39 font. However, I've tried printing some samples and my barcode scanners can't read them.
I researched a bit more and stumbled upon this.
I printed Code 39 barcodes using that library and it worked just fine, the scanners are able to read them.
Problem is, the library is written in C# but not for ASP.net. I've tried playing around with the code but it's too complex for my basic knowledge. There are a lot of functions included in that library code and has a lot of other barcode types, making it harder for me to analyze.
Are there other ways to generate a Code 39 barcode? The library in codeproject seems a little to complex for my requirements.
Barcode scanners require your code 39 barcodes to be prefixed and suffixed with asterisks to read. Example: *12345*
First off, you say the library isn't written for ASP.NET, but if you can produce images with it then the easiest thing to do is write an HttpHandler that sits overtop of the library and returns the generated images to the browser. If it's a .NET library, I don't see any reason why that shouldn't work.
That being said, there are a couple things to look out for when generating Code39 barcodes:
Are you producing a valid Code39 barcode (see other answers, a Code39 barcode should start and end with *)?
Is the barcode you are printing sharp enough to be scanned?
For #1, I would check to make sure the images you are printing from your Code39 font look the same as the ones from the library. If they are, then image quality is probably the issue.
As far as #2 goes, I've successfully used a free Code 39 font with GDI+ to generate barcode images that I then displayed in HTML pages for printing. One of the problems I ran into when trying to scan the printed barcode images was that the images were not sharp enough (the edges of the barcode lines were blurry) and were not able to be read by the scanners.
The way I got around low quality images was to generate a large Code39 barcode image (say 1000 x 400), and then on the <img> tag that was displaying that barcode, I would set the width to something much smaller, say (200px, or 2.0 in). I would be sure to set only the width, the height will scale proportionally with the image. That would effectively increase the DPI of the image when it is printed, allowing us to produce barcode images that are easily able to be scanned (especially if you are printing using a laser printer).
EDIT
Almost forgot, one other good practice to use when generating these barcodes is to always print what you are barcoding underneath the barcode image. That's your failsafe in case the barcode image will not scan for whatever reason. You can see an example of this if you look at any standard UPC symbol. The numbers at the bottom are exactly what the barcode will read when it is scanned.

Choosing a cross-platform library for PDF rendering and analysis app (preferably using C#)

I am planning to write an app that can open and display PDF documents, and perform OCR on vector graphic elements within the PDFs. The user must be able to select regions of the document and I need to draw real-time annotations on the document. I don't need to alter or save the document itself.
I have plenty of experience with C# and WPF; I have written a similar application already that does the above on XPS/XAML documents rather than PDF. However that app only runs on Windows and PDF documents must be converted to XPS first.
I have done quite a bit of research and there are many, many options available, none of which seem an obvious choice. There are many libraries that can open PDFs or create PDFs, but most don't seem to give you access to individual vector graphic elements in a format that lets you draw/manipulate them on the screen (similar to what I could do with WPF graphic elements extracted from XPS documents).
I am familiar with .Net and C# (including .Net 2 GDI+ graphics) and I am very keen to stick to what I know. I am also using EmguCV for image recognition which can be compiled in Mono or .Net. As such I am looking at Silverlight (running standalone) or Mono options, both of which should run on PC and Mac.
Performance (for both graphics and number crunching) is a strong consideration, though I am just as interested in getting this up and running quickly.
Does anyone have any experience with opening PDFs, extracting vector graphic elements (perhaps as SVG) and rendering them in a Mono app? Can individual elements be rendered to bitmap?
Alternatively, does anyone have experience with opening PDFs in Silverlight and converting them to XPS or XAML at runtime? I know that WPF and Silverlight graphics libraries are not 1:1, but I'm not sure how this affects XPS contents (generally composed of Canvas, Glyphs and StreamGeometry objects).
Thank you for any advice, tips or links you have to share.
look at this
http://silverpdf.codeplex.com/
it's client side pdf reading library. actually right now it can only read files, but you could play with it and make your own "display" functionality.
You might want to examine the internals of your PDFs so you understand what they actually contain better - you might be very surprised! For example, text can often be scanned pages or images and vecotr graphics do not exist as neat little packages. We wrote a whole load of general articles about what is inside a PDF and analysis tools at http://www.jpedal.org/PDFblog which are not specific to any tool or language.

How to load EPS files and draw them using WinForms

Is it possible to load and display EPS file using plain WinForms GDI+? If not, is there a free library to help out?
I seem to remember that Windows GDI supported EPS files, but after Googling around a bit, I am starting to doubt that memory.
All I want to do is load the file and draw it using a Graphics context.
I am aware that I can just use any program to convert the file to PNG or something and render it that way, but because I am trying to render at multiple resolutions, I would prefer to keep the vector data in the EPS file.
Thanks!
All the free or open source libraries I know that can convert EPS to other vector or raster format are all based on Ghostscript. You can invoke ghostscript directly, with wrapper provided or alternatively look at imagemagick. It is a very popular library for manipulating image graphics and has been around for a long time. It also internally relies on Ghostscript for handling EPS format. There is a .NET wrapper for it that you can find at http://imagemagick.codeplex.com/. You can read a bit about its background here too http://www.codeproject.com/KB/dotnet/ImageMagick_in_VBNET.aspx. There is also pstoedit that is also based on ghostscript to read EPS and allow export to format like WMF. You will need to the call to pstoedit API using interop in .NET
Besides Ghostscript there are several commercial products that I known of like ImageGear and LeadTools which will let you take EPS to almost any other kind of graphic formats.
You can use GhostScript to produce images from an EPS. Once you have an image you can then display that within your application.
In your question you indicated you want the output in a vector format which would preclude bitmaps, jpeg etc. Here are a couple of ways of getting a XAML file which is a vector file with extensive support by Microsoft.
Microsoft Expression Blend 3 and Design 3 can both open .ai (eps) files and convert them to vector formats, design and XAML respectively, so it is definitely possible.
I know it is relatively easy to automate most Microsoft Office applications like Word and Excel, but I have not seen any documented com inter-op assemblies for these Expression products.
Perhaps you can use the converters that are part of Expression in an undocumented way?
If that doesn't work here is plan B:
Here is a free converter that will convert .ai (eps) files to XAML. To use it you need Adobe Illustrator however.

How to generate barcode from a string using C#?

Is it possible to generate barcode from a string
using c#?
Is there any builtin classes for generating barcodes in asp.net?
Is it possible to detect a barcode printer connected with a system?
Yep. Of course it is possible. :-)
As far as I know there are two ways to generate bar codes:
Using a special bar code font (try to google for "barcode font free")
Render the bar code to an image and display that (try using the Barcode Rendering Framework available on github)
In response to your updated question about detecting barcode printers:
I think a barcode printer will show up as a regular printer on your system. At least that is how the devices I have played with have worked.
This means that you can detect a specific barcode printer by enumerating the installed printers on the system and looking for the specified device, but in most cases I would suggest that you let the user specify the printer himself using either the standard print dialog or using a custom dialog.
Is it possible to generate barcodes from a string using c#?
Yes, it is. There are quite a lot of frameworks that do it - either as a font or an image.
Is there any built-in classes for generating barcodes in asp.net?
No, but this c# project on github allows a string to be converted into an image (even multiple barcode types). All you need to do then is display the image in your application, just like any other image.
Is it possible to detect a barcode printer connected with a system?
Yes, in a WinForm application, for example, you could use System.Drawing.Printing.PrinterSettings.InstalledPrinters.
to detect if you have printer installed then you may simply enumerate available printers using:
System.Drawing.Printing.PrinterSettings.InstalledPrinters
Is it possible to generate barcode from a string using c#?
If you want a C# barcode generator that can create your desired barcode type in a single line of code, you can use IronOcr.
// Create A Barcode in 1 Line of Code
BarcodeWriter.CreateBarcode("https://ironsoftware.com/csharp/barcode", BarcodeWriterEncoding.QRCode).SaveAsJpeg("QR.jpg");
The result can be exported as images, bitmaps, binary data, streams, stand-alone HTML image tag, Data Uris, PDFs or HTML.
If you need more advanced barcodes, QR Codes with logos - these are also supported.
Disclaimer: I work for Iron Software, makers of IronBarcode
Yes, it's possible using C#.
No, there are no built-in classes. But there are 3rd-party libraries.
For example, a free cross-platform C# library Gehtsoft.Barcodes for generation of different types of barcodes and QR codes from string into image. You can find it in nuget.
Moreover, you can generate barcode directly into PDF document with Gehtsoft.PDFFlowLib.Barcodes C# library (it uses Gehtsoft.Barcodes library automatically). It can also be downloaded from nuget.
DocumentBuilder.New()
.AddSection()
.AddParagraph()
.AddBarcode("4810151021665", BarcodeType.EAN_13)
.ToDocument()
.Build("Result.pdf");
Using this libraries you can generate barcodes UPC-A, EAN-13, EAN-8, GS1-128 (Code Sets A, B, and C) and QR codes (variants 1-40, four levels of error correction available).
Here is a tutorial with many examples: Adding barcodes.
Note, that Gehtsoft.PDFFlowLib.Barcodes library is an extension of PDFFlow library for generation PDF documents using C#.

Barcode 128 size restrictions. Most compact barcode font?

I am generating a barcode label and sending it to the user as a .pdf (this is a web app). The user has already purchased barcode labels that are only 2 inches wide. I want to use an image so that I don't have to install fonts on all of the users machines that will be using the web site. I am able to get the barcodes small enough if I use fonts from IDeautomation.com but I would much rather use an image generated using BarCodeRenderer
or some other opensource project but I can not get the barcodes small enough as the system has pre-existing ID's of around 20 characters in length. What is the smallest Barcode font (I am trying to use 128 as the IDS are alphanumeric) and how can I resize the generated image in a way to make it fit in the width that I have available?(Other ideas or Libraries that do this are also accepted as answers)
IDautomation has several products.
Specifically they have one for Crystal reports with a Code 128 checksum calculator. It bypasses the need for a font and generates the font right in the report, which can go straight to PDF. The smallest size I have been able to use this feature is at about 12 point font. Specifically they have broken down the Code 128 font spec to allow you the smallest barcodes possible. This does not render as a font, or an image as far as I recall.
Alternatively I recall them having a product that will render a font as an image.
Another product that might be useful is Barbeque. Maybe you can find something along that line.
The other factors that weigh in when trying to print and read small barcodes are:
How long is the value that you are encoding in the barcode. 20 Characters is a lot.. Is there any way you can concatenate it, or shrink it somehow? Tricks I have used in the past include using a hashed value (or record number) that would link to all the values I needed. The shorter you can get your barcode, the smaller you can make it and still have it super clear.
Will the barcode get longer over time? If so, you might need a wider label, or consider a different format. I am starting to like a few of the 2D barcodes a lot.
Label material. I have seen issues with using colored or overly shiny labels instead of white, matte ones making it much harder to read.
The barcode readers can make a big difference. Having a laser based reader instead of an optical based one will give you greater resolution in reading barcodes. This means you can read them from further away, or read smaller ones. Symbol has some great $150 laser based barcode scanners.
The bar code printing and reading systems I've worked on have done in the range of a few million prints and reads with barcodes of small to medium sizes, so I hope some of the suffering and learning I've had above helps!
What I've done is to take the barcode and make it fit the width that I want by resizing it down. What then happens is that the height is not good enough for most readers, so I copy the image and duplicated it above it, so it now is the width I want and double the height of the generator. That makes it more readable to most common off-the-shelf barcode readers.
If your barcodes only consist of an even number of numeric digits, you can quite easily switch to the Code C variant to get them down to half the size.
Generating a small barcode as an image in a PDF is going to be error prone, since you can't optimize to the dot size of the printer. Your barcode widths are going to be off by plus or minus half a dot; the wider your bars are, the less of an issue this will be. I've worked with label printers that are 203 DPI, and they would be nearly impossible to support with a generic image. Fonts are better since they can be hinted to be an exact multiple of dots. I don't know if any of the commercial barcode fonts have the necessary hinting, but I presume at least one of them does.
I have had good luck using Data Matrix format as you can have varying amounts of data, and you can size the barcode as you wish.
Here are some links that may help:
libdmtx
Aspose.BarCode for .NET and Java
Barcode Writer in Pure PostScript
The checkbox "Use Unicode UTF-8 for worldwide language support" should not be checked.

Categories

Resources