--- title: "Barcode Scanner" url: https://docs.catalyst.zoho.com/en/sdk/java/v1/zia-services/barcode-scanner/ service: Zia Services type: general related_links: - name: "Barcode Scanner - API" url: /en/api/code-reference/zia-services/barcode-scanner/#BarcodeScanner --- # Barcode Scanner Zia Barcode Scanner enables you to scan the most commonly used linear and 2D barcode formats and decode the encoded data. Barcode Scanner can detect formats like Codabar, EAN-13, ITF, UPC-A, QR Code, and more. You can learn more from the Barcode Scanner help page. You can provide an input file of the format ._jpg_/._jpeg_ or ._png_. Refer to the API documentation for the request and response formats. You can specify the barcode format using setFormat. If you enter the format as ALL, Barcode Scanner automatically detects the format. It provides the decoded information as the response. #### Sample Code Snippet
import com.zc.component.ml.ZCBarcodeData; import com.zc.component.ml.ZCBarcodeFormat; import com.zc.component.ml.ZCBarcodeOptions; import com.zc.component.ml.ZCML; import java.io.File; File file = new File("{filePath}"); //Specify the file path ZCBarcodeOptions options = ZCBarcodeOptions.getInstance().setFormat(ZCBarcodeFormat.ALL); //Specify the format ZCBarcodeData barcodeResult =ZCML.getInstance().scanBarcode(file, options); //Call scanBarcode() with the input file and options String content = barcodeResult.getContent(); //getContent() obtains the decoded content