Every ByteScout tool includes samplePowerShell source codes that you can find here or in the folder with installed ByteScout product. Barcode reader API in PowerShell can be applied with ByteScout Cloud API Server. ByteScout Cloud API Server is the ready to deploy Web API Server that can be deployed in less than thirty minutes into your own in-house Windows server (no Internet connnection is required to process data!) or into private cloud server. Can store data on in-house local server based storage or in Amazon AWS S3 bucket. Processing data solely on the server using built-in ByteScout powered engine, no cloud services are used to process your data!.
Save time on writing and testing code by using the code below and use it in your application. To use barcode reader API in your PowerShell project or application just copy & paste the code and then run your app! Further improvement of the code will make it more robust.
Trial version along with the source code samples for PowerShell can be downloaded from our website
On-demand (REST Web API) version:
Web API (on-demand version)
On-premise offline SDK for Windows:
60 Day Free Trial (on-premise)
# Please NOTE: In this sample we're assuming Cloud Api Server is hosted at "https://localhost". # If it's not then please replace this with with your hosting url. # Direct URL of source file to search barcodes in. $SourceFileURL = "https://bytescout-com.s3.amazonaws.com/files/demo-files/cloud-api/barcode-reader/sample.pdf" # Comma-separated list of barcode types to search. $BarcodeTypes = "Code128,Code39,Interleaved2of5,EAN13" # Comma-separated list of page indices (or ranges) to process. Leave empty for all pages. Example: '0,2-5,7-'. $Pages = "" # Sample profile that sets advanced conversion options # Advanced options are properties of Reader class from Bytescout BarCodeReader used in the back-end: # https://cdn.bytescout.com/help/BytescoutBarCodeReaderSDK/html/ba101d21-3db7-eb54-d112-39cadc023d02.htm $Profiles = '{ "profiles": [ { "profile1": { "FastMode": true } } ] }' # Prepare URL for `Barcode Reader` API call $query = "https://localhost/barcode/read/from/url?types=$($BarcodeTypes)&pages=$($Pages)&url=$($SourceFileURL)&profiles=$($Profiles)" $query = [System.Uri]::EscapeUriString($query) try { # Execute request $jsonResponse = Invoke-RestMethod -Method Get -Uri $query if ($jsonResponse.error -eq $false) { # Display found barcodes in console foreach ($barcode in $jsonResponse.barcodes) { Write-Host "Found barcode:" Write-Host " Type: " $barcode.TypeName Write-Host " Value: " $barcode."Value" Write-Host " Document Page Index: " $barcode."Page" Write-Host " Rectangle: " $barcode."Rect" Write-Host " Confidence: " $barcode."Confidence" Write-Host "" } } else { # Display service reported error Write-Host $jsonResponse.message } } catch { # Display request error Write-Host $_.Exception }
60 Day Free Trial or Visit ByteScout Cloud API Server Home Page
Explore ByteScout Cloud API Server Documentation
Explore Samples
Sign Up for ByteScout Cloud API Server Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
@echo off echo (Get-Location).Path powershell -NoProfile -ExecutionPolicy Bypass -Command "& .\ReadBarcodeFromURL.ps1" echo Script finished with errorlevel=%errorlevel% pause
60 Day Free Trial or Visit ByteScout Cloud API Server Home Page
Explore ByteScout Cloud API Server Documentation
Explore Samples
Sign Up for ByteScout Cloud API Server Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples
60 Day Free Trial or Visit ByteScout Cloud API Server Home Page
Explore ByteScout Cloud API Server Documentation
Explore Samples
Sign Up for ByteScout Cloud API Server Online Training
Get Your API Key
Explore Web API Docs
Explore Web API Samples