Skip to content

Using ZXing.Net with Powershell

Michael Jahn edited this page Aug 9, 2017 · 3 revisions

You can use the ZXing barcode reader from the powershell. The following snippet shows one way to decode a barcode bitmap.

PS C:\>Add-Type -Path <place the path to the zxing.dll here>\zxing.dll

PS C:\>$reader = New-Object -TypeName ZXing.BarcodeReader

PS C:\>$bitmap = [System.Drawing.Bitmap]::FromFile("<path to your bitmap image file>")

PS C:\>$result = $reader.Decode($bitmap)

PS C:\>$bitmap.Dispose()

PS C:\>$result.Text

Clone this wiki locally