【问题标题】:Convert Encode string value to PDF-417 barcode in Windows 8 application?在 Windows 8 应用程序中将编码字符串值转换为 PDF-417 条形码?
【发布时间】:2013-06-21 10:35:16
【问题描述】:

我正在尝试在 Windows 8 应用程序中使用 ZXing https://zxingnet.codeplex.com/ 将字符串值转换为 PDF-417 条形码格式。目前我只能在下面编写代码,如何将 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();

我怎样才能做到这一点?或者我需要使用任何其他 dll 吗?

【问题讨论】:

    标签: c# windows-8 windows-runtime barcode zxing


    【解决方案1】:

    要使用 ZXing.Net 从某些内容生成 PDF417 代码,您应该尝试以下 sn-p:

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

    imgBitmap 是 WriteableBitmap 的一个实例,我认为它是您的图像源。

    【讨论】:

    • 如何提高生成图像的质量?我已经看到我可以放置的最大宽度和高度是 200,超过 130 就会给我超出界限异常。
    • 我可以使用更高的值而不会出错。您尝试了哪些值(宽度和高度)?您编码了哪些内容?请发布异常的堆栈跟踪。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-07-01
    • 2019-02-16
    • 2021-03-16
    • 2012-11-12
    • 2016-10-01
    • 1970-01-01
    • 2011-12-08
    相关资源
    最近更新 更多