Reading Barcode


#1

How to Read Barcode from PDFPrintBill_MOBD7BN6MWQR7CRP_1359903039.pdf (57.8 KB)


Read BarCode
#2

Only via custom activities. Please check this for QR CodeReader.


#6

Hi its working fine for QRCode but its not working for BARCODE??? help @badita


#7

For Barcode you’ll need to create your own reader following that example.


#8

for Barcode what code i write instead of this code @badita

QRCodeBitmapImage bitmapImage = new QRCodeBitmapImage((Bitmap)Image.FromFile(imagePath));

        QRCodeDecoder decoder = new QRCodeDecoder();
        var result = decoder.Decode(bitmapImage);
        

        QRValue.Set(context, result);

#9

You’ll need to create your own custom activities. Those works only for QRCode.


#10

can you edit this code for barcode??? @badita

using System;
using System.Activities;
using System.ComponentModel;
using System.Drawing;
using MessagingToolkit.QRCode.Codec;
using MessagingToolkit.QRCode.Codec.Data;
using MessagingToolkit.Barcode;

namespace BARCodeReader.Activities
{
public class BARCodeReader : CodeActivity
{
[Category(“Input”)]
public InArgument ImagePath { get; set; }

    [Category("Output")]
    public OutArgument<string> QRValue { get; set; }

    protected override void Execute(CodeActivityContext context)
    {
        var imagePath = ImagePath.Get(context);

        QRCodeBitmapImage bitmapImage = new QRCodeBitmapImage((Bitmap)Image.FromFile(imagePath));
        

        QRCodeDecoder decoder = new QRCodeDecoder();
        var result = decoder.Decode(bitmapImage);
        

        QRValue.Set(context, result);
    }
}

}


#11

Did you try this:

–> You should be having the MessagingToolKit.dll in C:\Windows\Microsoft.NET\Framework64\v4.0.30319

–> Try to import the Namespaces you need.

–> Add the Namespaces manually to your Xaml


#12

ya i did this thing but i dont know what the exact code i write instead of this part of QRCode which work for BRCode

QRCodeBitmapImage bitmapImage = new QRCodeBitmapImage((Bitmap)Image.FromFile(imagePath));

    QRCodeDecoder decoder = new QRCodeDecoder();
    var result = decoder.Decode(bitmapImage);
    

    QRValue.Set(context, result);

what i place instead of QRCodeDecoder decoder = new QRCodeDecoder() for BARCODE reader


#13

Not sure if it works, but try decode options. If are not sure about batcode type, then just put them all. :stuck_out_tongue: