使用itextsharp创建带有文本图像(不是pdf)的条形码 [英] Create barcode with text image (not pdf) using itextsharp
问题描述
我可以使用itextsharp CreateDrawingImage方法创建条形码。但我想将实际文本包含在图像中。我怎么做?或者我如何使用CreateImageWithBarcode方法保存为图像(Jpeg / Png)?
I am able to create barcode using itextsharp CreateDrawingImage method. But I want to include the actual text into the image. How do I do that? or How do I use CreateImageWithBarcode method to save as image (Jpeg/Png)?
谢谢
推荐答案
面对同样的问题,在查看iTextSharp来源后,看来你不能。除了使用CreateDrawingImage()之外,我还遇到了图像调整大小的问题,它模糊不清。
Facing the same problem and after looking in iTextSharp sources it appears you can't. Besides with CreateDrawingImage() I had problems with image resizing, it was fuzzy and unreadable.
我最终使用了这个库(非常酷):
I ended up using this library (very cool):
http://www.codeproject.com/KB/ graphics / BarcodeLibrary.aspx
EAN13的代码:
System.Drawing.Image imageBarcode = BarcodeLib.Barcode.DoEncode(BarcodeLib.TYPE.EAN13, barcode, true, Color.Black, Color.White, 500, 250);
这篇关于使用itextsharp创建带有文本图像(不是pdf)的条形码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!