简体   繁体   English

Qt4中的条形码生成

[英]Barcode generation in Qt4

Any ideas for barcode generation into a textbox in c++ under Qt4? 在Qt4下在c ++中将条形码生成到文本框中的任何想法吗?

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. 这取决于什么样的,你是在谈论一个条形码,但是,在CodeProject上搜索得到这个是用C#编写有趣的库,但它可以产生39码,128码,间隔2/5,仅举几例。 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? 也许可以使用Runtime Callable COM Wrapper(RCCW)将其重新编译为看起来像COM对象,这意味着在C ++方面,它看起来像COM库? And hence interact with it from a QT/C++ runtime environment. 因此,可以在QT / C ++运行时环境中与之交互。

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. 使用Qt生成条形码非常简单-正如Ronend Gonzo指出的那样,您使用条形码字体。 Then you can paint it with QPainter onto anything. 然后,您可以使用QPainter将其绘制到任何东西上。 Or print it. 或打印它。

I wrote a post/tutorial on generating code128 with Qt, github example included. 我写了一篇关于使用Qt生成code128的帖子/教程,其中包括github示例。 How to generate barcode with a font in Qt 如何在Qt中生成带有字体的条形码

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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