|
C# Syntax using System.Drawing; using System.Drawing.Imaging; using BarcodeWrapper;
BarcodeReader reader= new BarcodeReader(); reader.ScanWithoutRotation = true; reader.TryHard = true; reader.ScanMultiple = true; int iMyWidth=0; int iMyHeight=0; Bitmap bitmap;
int iPageCount=reader.GetPDFPageCount(strinputpath1); bool bResult=reader.GetPDFPage(strinputpath1, iPageNo, out iMyWidth, out iMyHeight); int iScaledWidth = (int)(iMyWidth * 2.5); int iScaledHeight = (int)(iMyHeight * 2.5);
bitmap = new Bitmap(iScaledWidth, iScaledHeight); bool bresult =reader.GetPDFBitmap(strinputpath1, iPageNo, bitmap); int count = reader.ReadBarcodeImage(bitmap, x, y, width, height); string text = "" + count + " codes found<br><br>";
for (int i = 0; i < count; i++) { text += reader.GetBarcodeType(i) + " value:" + reader.GetBarcodeValue(i) + "<br>"; }
|