0

I'm trying to create a PDF417 Reader Application. I was able to create PDF417 Codes.

This is the code I use to create the PDF417 Codes:

using STROKESCRIBECLSLib;

StrokeScribeClass ss = new StrokeScribeClass();
ss.Alphabet = enumAlphabet.PDF417;
ss.Text = "My Text";
ss.PDF417ErrLevel = 8;
ss.PDF417SymbolAspectRatio = 5;
int w = ss.BitmapW;
int h = ss.BitmapH;
ss.SavePicture(@"D:\pdf417.bmp", enumFormats.BMP, w, h);
if (ss.Error != 0)
    MessageBox.Show(ss.ErrorDescription, "Write Error");

When I try to read the file:

MessageBox.Show(ss.GetPicture(enumFormats.GIF, w, h).ToString());

It gives me:

System.__ComObject

Does anyone have any idea how I can read the text in this PDF417 Code?

Carlos Oliveira
  • 477
  • 6
  • 11
sikas
  • 5,435
  • 28
  • 75
  • 120
  • Obviously `ToString()` does not return the decoded string. `GetPicture` is returning an object, look at its fields/methods. Read the documentation. – Ed S. Jun 21 '14 at 17:37

1 Answers1

0

If I understand correctly, it seems you're trying to read a PDF417 barcode from a bitmap file, generated by the StrokeScribe library. You'll need a barcode recognition library to do that. I recommend Inlite's ClearImage barcode recognition SDK which has a free dev license.

Here's some sample code to use ClearImage with C#:

using Inlite.ClearImageNet;
...
BarcodeReader reader = new BarcodeReader();
reader.Pdf417 = true;
Barcode[] barcodes = reader.Read(@"D:\pdf417.bmp");
foreach (Barcode barcode in barcodes)
  {MessageBox.Show ("TEXT = " + barcode.Text);}

Disclaimer: I've done some work for Inlite in the past.

Dan
  • 573
  • 6
  • 9