简体   繁体   中英

Barcode generation in Qt4

Any ideas for barcode generation into a textbox in c++ under Qt4?

The idea is to have it in some kind of text format to save it and be able to read it later on.

What about generating the image for printing?

Thanks in advance.

Generating a barcode is as simple as using a barcode font . You can embed the font in your application, and create barcode wherever you can put text.

It depends on what kind of a barcode you are talking about, however, a search on Codeproject yielded this interesting library that is written in C#, however it can generate Code 39, Code 128, Interleaved 2 of 5, to name but a few. Perhaps, this could be recompiled to make it look like a COM object using Runtime Callable COM Wrapper (RCCW), meaning on the C++ side, it looks like a COM library? And hence interact with it from a QT/C++ runtime environment.

Hope this helps, Best regards, Tom.

请检查zint,可以在Sourceforge上找到它。

Generating barcode with Qt is quite easy - as Reverend Gonzo pointed out, you use a barcode font. Then you can paint it with QPainter onto anything. Or print it.

I wrote a post/tutorial on generating code128 with Qt, github example included. How to generate barcode with a font in Qt

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM