简体   繁体   English

在Windows 8应用程序中将编码字符串值转换为PDF-417条码?

[英]Convert Encode string value to PDF-417 barcode in Windows 8 application?

I am trying to convert string value to PDF-417 barcode format using ZXing https://zxingnet.codeplex.com/ in Windows 8 application. 我正在尝试在Windows 8应用程序中使用ZXing https://zxingnet.codeplex.com/将字符串值转换为PDF-417条码格式。 Currently I am able to write only below code how can I put BitMatrix to image source. 目前,我只能在下面的代码中编写如何将BitMatrix放入图像源。

        int width = 115;
        int Height = 65;

        PDF417Writer writer = new PDF417Writer();
        BitMatrix bitIMGNew = writer.encode(value, BarcodeFormat.PDF_417, width, Height);
        WriteableBitmap imgBitmap = bitIMGNew.ToBitmap();

How can I achieve this? 我该如何实现? Or Do I need to use any other dll? 还是我需要使用其他任何dll?

To generate a PDF417 code from some content with ZXing.Net you should try the following snippet: 要使用ZXing.Net从某些内容生成PDF417代码,您应该尝试以下代码段:

var writer = new BarcodeWriter
{
   Format = BarcodeFormat.PDF_417,
   Options = new EncodingOptions {Width = 115, Height = 65}
};
var imgBitmap = writer.Write(value);

imgBitmap is a instance of WriteableBitmap which is your image source in my opinion. imgBitmap是WriteableBitmap的实例,我认为它是您的图像源。

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

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