### Supported Template Objects Source: https://github.com/yeasir01/bpac-js/blob/main/docs/readme.md Details the types of objects that can be used in Brother P-Touch Editor templates and provides examples for each. ```APIDOC Text: Type: String Example: "My Label" Date: Type: JS Date Object Example: new Date("2024-01-22") Barcode: Type: String Example: "826218016158" Image: Type: String Example: "C:/Photos/shoe.png" Clipart: Type: N/A Description: Not Supported ``` -------------------------------- ### Install bpac-js using npm Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Installs the bpac-js package using npm. This is the primary method for adding the library to your project. ```sh $ npm install bpac-js ``` -------------------------------- ### Install bpac-js via npm Source: https://github.com/yeasir01/bpac-js/blob/main/README.md Installs the bpac-js package using npm, the Node Package Manager. This is the recommended way to add the SDK to your project for managing dependencies. ```bash $ npm i bpac-js ``` -------------------------------- ### Get List of Printers Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Retrieves a list of all available Brother printers connected to the system. This is a static method of the BrotherSdk class. ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const getPrinters = async () => { try { const printers = await BrotherSdk.getPrinterList(); console.log({printers}) // Output: {printers: ["Brother QL-820NWB", "Brother PT-9800PCN"]} } catch (error) { console.log({error}) } }; btn.addEventListener("click", getPrinters); ``` -------------------------------- ### Get Printer Name Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Fetches the name of the currently connected or default Brother printer. This function requires an instance of the BrotherSdk initialized with a template path. ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const label = new BrotherSdk({ templatePath: "C:\\Templates\\shoe-template.lbx" }); const getPrinter = async () => { try { const printer = await label.getPrinterName(); console.log({printer}) // Output: {printer: "Brother QL-820NWB"} } catch (error) { console.log({error}) } }; btn.addEventListener("click", getPrinter); ``` -------------------------------- ### Import bpac-js (Default Import) Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Shows how to import the BrotherBrotherSdk using a default import, providing an alternative way to include the library. ```javascript import { BrotherBrotherSdk } from "bpac-js"; ``` -------------------------------- ### QL Series Printer Settings (Extended) Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details the settings for a wide range of QL series printers, including 'noCut', 'autoCut', and 'cutAtEnd' options, and their corresponding print results. ```markdown ## QL-560 / QL-570 / QL-580N / QL-600 / QL-650TD / QL-700 / QL-710W / QL-720NW / QL-800 / QL-810W / QL-820NWB / QL-1050 / QL-1060N / QL-1100 / QL-1110NWB / QL-1115NWB / TD-4000 / TD-4100N / TD-4410D / TD-4420DN / TD-4510D / TD-4520DN / TD-4550DNWB / TD-4210D / TD-4420TN / TD-4520TN / TD-4650TNWB / TD-4750TNWB / TD-4650TNWBR / TD-4750TNWBR / TJ-4010TN / TJ-4005DN / TJ-4020TN / TJ-4021TN / TJ-4021TNR / TJ-4120TN / TJ-4121TN / TJ-4121TNR / TJ-4420TN / TJ-4422TN / TJ-4520TN / TJ-4522TN | **noCut** | **autoCut** | **cutAtEnd** | **Result** | |:---:|:---:|:---:|---:| |✔️|-|-|![noCut](../.github/images/no-margin-no-cut.png) | |-|-|✔️|![cutAtEnd](../.github/images/no-cut-no-margin.png) | |-|✔️|-|![autoCut](../.github/images/auto-cut-no-margin.png) | |-|✔️|✔️|![autoCut cutAtEnd](../.github/images/auto-cut-no-margin.png) | ``` -------------------------------- ### QL-550 Printer Settings Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Describes the behavior of the QL-550 printer based on 'noCut' and 'autoCut' settings. It shows the resulting print output for each configuration. ```markdown ## QL-550 | **noCut** | **autoCut** | **Result** | |:---:|:---:|---:| |✔️|-|![noCut](../.github/images/no-margin-no-cut.png) | |-|✔️|![autoCut](../.github/images/auto-cut-no-margin.png) | ``` -------------------------------- ### Export Label with BPAC-JS Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md This snippet demonstrates how to initialize the BPAC-JS SDK with template and export paths, define label data including text and barcode information, and export the label as a BMP file. It includes error handling and logs the success status. ```javascript import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const label = new BrotherSdk({ templatePath: "C:\\Templates\\shoe-template.lbx", exportPath: "C:\\Users\\YourProfile\\Desktop\\Exported_Labels\" }); // The keys and values must match the objects/types in the template file. const data = { title: "Air Force One", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }; const newFileName = "shoe-label-img.bmp"; const handleExport = async () => { try { // All Options: Docs >> Options >> Supported Ext Types const success = await label.export(data, newFileName, 300); console.log({success}) // Output: {success: true} } catch (error) { console.log({error}) } }; btn.addEventListener("click", handleExport); ``` -------------------------------- ### Print Shoe Label with BrotherSdk Source: https://github.com/yeasir01/bpac-js/blob/main/README.md This snippet demonstrates how to initialize the BrotherSdk, define label data and print options, and send the label to a Brother QL Series printer. It includes event handling for a print button click and asynchronous printing with error handling. ```javascript import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const printBtn = document.getElementById("print-btn"); const shoeLabel = new BrotherSdk({ templatePath: "C:/Templates/shoe-template.lbx", exportPath: "C:/Users/YourProfile/Desktop/Exported Labels/", }); // The keys and values must match the objects/types in the template file. const data = { title: "Air Force 1", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }; const options = { copies: 1, // Optional - Defaults: 1 printName: "Air Force One Label", // Optional - Defaults: BPAC-Document highResolution: true // Optional } const sendToPrinter = async () => { try { const isPrinted = await shoeLabel.print(data, options); console.log({isPrinted}) } catch (error) { console.log({error}) } }; printBtn.addEventListener("click", sendToPrinter); ``` -------------------------------- ### Import bpac-js via CDN Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Illustrates how to include the bpac-js library in your HTML using a CDN link. This method is suitable for quick integration or when not using a module bundler. ```javascript import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; ``` -------------------------------- ### Supported Ext Types Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Lists the supported file extensions for exporting files within the BPAC-JS project. This includes various label and image formats. ```APIDOC .lbx: LBX type .lbl: LBL (P-touch Editor 4.2) .lbi: LBI type .bmp: BMP Image .paf: PAF Type ``` -------------------------------- ### Import bpac-js (Named Import) Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Demonstrates how to import the BrotherBrotherSdk using a named import, a common practice in modern JavaScript development. ```javascript import BrotherBrotherSdk from "bpac-js"; ``` -------------------------------- ### Include bpac-js via CDN Source: https://github.com/yeasir01/bpac-js/blob/main/README.md Includes the bpac-js SDK using a Content Delivery Network (CDN). This method is useful for quick integration or for projects not using a package manager. It's recommended to use specific version numbers in production. ```link https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js ``` -------------------------------- ### Print Option Compatibility: PT-D450 Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md This table specifies the print option compatibility for the PT-D450 model, detailing the effects of `noCut`, `cutMark`, and `chainPrint` options on the printing output, with corresponding image references. ```APIDOC Model: PT-D450 | noCut | cutMark | chainPrint | Result | |---|---|---|---| | ✔ | - | - | ![noCut](../.github/images/ncp-no-cut.png) | | - | - | ✔ | ![chainPrint](../.github/images/chain-print.png) | | - | ✔ | - | ![cutMark](../.github/images/ncp-cut-mark.png) | | - | ✔ | ✔ | ![cutMark chainPrint](../.github/images/half-cut-chain.png) | ``` -------------------------------- ### Print Option Compatibility: PT-9500PC / PT-9600 / PT-3600 Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md This table outlines the print option compatibility for PT-9500PC, PT-9600, and PT-3600 models, specifically focusing on the interaction between `noCut`, `autoCut`, `halfCut`, and `chainPrint` options and their resulting print behavior, often illustrated with images. ```APIDOC Model: PT-9500PC / PT-9600 / PT-3600 | noCut | autoCut | halfCut | chainPrint | Result | |---|---|---|---|---| | ✔ | - | - | - | ![noCut](../.github/images/no-cut.png) | | - | - | - | ✔ | ![chainPrint](../.github/images/chain-print.png) | | - | - | ✔ | - | ![halfCut](../.github/images/half-cut.png) | | - | - | ✔ | ✔ | ![halfCut chainPrint](../.github/images/half-cut-chain.png) | | - | ✔ | - | - | ![autoCut](../.github/images/auto-cut.png) | | - | ✔ | - | ✔ | ![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | | - | ✔ | ✔ | - | ![autoCut halfCut](../.github/images/auto-cut-half-cut.png) | | - | ✔ | ✔ | ✔ | ![autoCut halfCut chainPrint](../.github/images/auto-cut-half-chain.png) | ``` -------------------------------- ### Preview Label Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Generates a preview of a label as a base64 encoded PNG image. This is useful for displaying a representation of the label before printing. It takes a data object and optional preview options. ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const imgElement = document.getElementById("img"); const label = new BrotherSdk({ templatePath: "C:\\Templates\\shoe-template.lbx" }); // Important: The keys and values must match the object name & type in the template file. const data = { title: "Air Force One", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }; const options = { height: 300 } const handlePreview = async () => { try { const base64EncodedPNG = await label.getImageData(data, options); imgElement.src = base64EncodedPNG; } catch (error) { console.log({error}) } }; btn.addEventListener("click", handlePreview); ``` -------------------------------- ### HTML Script Tag for CDN Import Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Specifies the necessary HTML script tag to enable module loading when using the bpac-js library via CDN. ```html ``` -------------------------------- ### BPAC-JS Print Options Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md This section details the available print options for the BPAC-JS project. Each option specifies its type, default value, and a description of its functionality. These options control various aspects of the printing process, such as the number of copies, document naming, auto-cutting, mirroring, and print quality. ```APIDOC copies: number (default: 1) Number of copies to print. printName: string (default: "BPAC-Document") Document Name for print queue. autoCut: boolean Auto cut after print. cutPause: boolean Pause to cut is applied. Valid only with models not supporting the auto cut function. cutMark: boolean Cut mark is inserted. Valid only with models not supporting the auto cut function. halfCut: boolean Performs half cut. chainPrint: boolean Continuous printing is performed. The final label is not cut, but when the next labels are output, the preceding blank is cut in line with the cut option setting. tailCut: boolean Whenever a label is output, the trailing end of the form is forcibly cut to leave a leading blank for the next label output specialTape: boolean No cutting is performed when printing on special tape. Valid only with PT-2430PC. cutAtEnd: boolean Cut at end is performed. noCut: boolean Disable auto cut mirroring: boolean Mirror print label. quality: boolean Fine quality print. highSpeed: boolean High speed printing. highResolution: boolean High resolution printing. color: boolean Print in color. mono: boolean Print in monochrome. fitPage: boolean Specify whether to adjust the size and position of objects in the template in accordance with layout changes resulting from media changes. If set to true, adjustments will be made; otherwise, if set to false or undefined, no adjustments will be applied. ``` -------------------------------- ### PT-1230PC Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for the PT-1230PC printer. Supports noCut and cutMark functionalities. ```markdown ## PT-1230PC | **noCut** | **cutMark** | **Result** | |:---:|:---:|---:| |✔️|-|![noCut](../.github/images/ncp-no-cut.png) | |-|✔️|![cutMark](../.github/images/ncp-cut-mark.png) | ``` -------------------------------- ### PT-D410/PT-D460BT Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-D410 and PT-D460BT printers. Supports noCut, cutPause, chainPrint, and specialTape functionalities. ```markdown ## PT-D410/PT-D460BT | **noCut** | **cutPause** | **chainPrint**| **specialTape** | **Result** | |:---:|:---:|:---:|:---:|---:| |✔️|-|-|-|![noCut](../.github/images/no-cut.png) | |-|-|✔️|-|![chainPrint](../.github/images/chain-print.png) | |-|✔️|-|-|![cutPause](../.github/images/auto-cut.png) | |-|✔️|✔️|-|![cutPause chainPrint](../.github/images/auto-cut-chain-print.png) | |-|-|-|✔️|![specialTape](../.github/images/special-tape.png) | ``` -------------------------------- ### Print Option Compatibility: PT-9700PC / PT-9800PCN / PT-P750W / PT-P910BT / PT-E550W Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md This table details the print option compatibility for PT-9700PC, PT-9800PCN, PT-P750W, PT-P910BT, and PT-E550W models. It illustrates the behavior when combining `noCut`, `autoCut`, `halfCut`, `chainPrint`, and `specialTape` options, with visual references to the output. ```APIDOC Model: PT-9700PC / PT-9800PCN / PT-P750W / PT-P910BT / PT-E550W | noCut | autoCut | halfCut | chainPrint | specialTape | Result | |---|---|---|---|---|---| | ✔ | - | - | - | - | ![noCut](../.github/images/no-cut.png) | | - | - | - | ✔ | - | ![chainPrint](../.github/images/chain-print.png) | | - | - | ✔ | - | - | ![halfCut](../.github/images/half-cut.png) | | - | - | ✔ | ✔ | - | ![halfCut chainPrint](../.github/images/half-cut-chain.png) | | - | ✔ | - | - | - | ![autoCut](../.github/images/auto-cut.png) | | - | ✔ | - | ✔ | - | ![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | | - | ✔ | ✔ | - | - | ![autoCut halfCut](../.github/images/auto-cut-half-cut.png) | | - | ✔ | ✔ | ✔ | - | ![autoCut halfCut chainPrint](../.github/images/auto-cut-half-chain.png) | | - | - | - | - | ✔ | ![specialTape](../.github/images/special-tape.png) | ``` -------------------------------- ### PT-2600 / PT-2610 Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-2600 and PT-2610 printers. Supports noCut and autoCut functionalities. ```markdown ## PT-2600 / PT-2610 | **noCut** | **autoCut** | **Result** | |:---:|:---:|---:| |✔️|-|![noCut](../.github/images/ncp-no-cut.png) | |-|✔️|![autoCut](../.github/images/auto-cut.png) | ``` -------------------------------- ### PT-1950 / PT-1960 Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-1950 and PT-1960 printers. Supports noCut, cutMark, and chainPrint functionalities. ```markdown ## PT-1950 / PT-1960 | **noCut** | **cutMark** | **chainPrint** | **Result** | |:---:|:---:|:---:|---:| |✔️|-|-|![noCut](../.github/images/no-cut.png) | |-|-|✔️|![chainPrint](../.github/images/chain-print.png) | |-|✔️|-|![cutMark](../.github/images/cp-cut-mark.png) | |-|✔️|✔️|![cutMark chainPrint](../.github/images/half-cut-chain.png) | ``` -------------------------------- ### PT-E800T / PT-E800TK / PT-E850TKW Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-E800T, PT-E800TK, and PT-E850TKW printers. Supports TZe tape with various cutting options including noCut, chainPrint, halfCut, and specialTape. ```markdown ## PT-E800T / PT-E800TK / PT-E850TKW | **Media** | **noCut** | **autoCut** | **halfCut** | **chainPrint** | **specialTape** | **Result** | |:----------|:---:|:---:|:---:|:---:|:---:|---:| | TZe |✔️|-|-|-|-|![noCut](../.github/images/no-cut.png) | | TZe |-|-|-|✔️|-|![chainPrint](../.github/images/chain-print.png) | | TZe |-|-|✔️|-|-|![halfCut](../.github/images/half-cut.png) | | TZe |-|-|✔️|✔️|-|![halfCut chainPrint](../.github/images/half-cut-chain.png) | | TZe |-|✔️|-|-|-|![autoCut](../.github/images/auto-cut.png) | | TZe |-|✔️|-|✔️|-|![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | | TZe |-|✔️|✔️|-|-|![autoCut halfCut](../.github/images/auto-cut-half-cut.png) | | TZe |-|✔️|✔️|✔️|-|![autoCut halfCut chainPrint](../.github/images/auto-cut-half-chain.png) | | TZe |-|-|-|-|✔️|![specialTape](../.github/images/special-tape.png) | | PVC Tube |✔️|❌|-|❌|❌|![noCut](../.github/images/no-cut.png) | | PVC Tube |-|❌|✔️|❌|❌|![halfCut](../.github/images/half-cut.png) | | FLe |✔️|-|❌|❌|❌|![noCut](../.github/images/no-cut-no-margin.png) | | FLe |-|✔️|❌|❌|❌|![autoCut](../.github/images/auto-cut-no-margin.png) | ``` -------------------------------- ### MW / PJ / RJ / TD Series Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for various mobile and portable printers including MW, PJ, RJ, and TD series. Primarily supports noCut functionality. ```markdown ## MW-100e / MW-120 / MW-140BT / MW-145BT / MW-170 / MW-260 / MW-270 / PJ-623 / PJ-663 / PJ-722 / PJ-723 / PJ-762 / PJ-763 / PJ-763MFi / PJ-773 / RJ-2030 / RJ-2150 / RJ-2140 / RJ-2050 / RJ-3050 / RJ-3050Ai / RJ-3150 / RJ-3150Ai / RJ-3230B / RJ-3250WB / RJ-4030 / RJ-4030Ai / RJ-4040 / RJ-4230B / RJ-4250WB / PJ-822 / PJ-823 / PJ-862 / PJ-863 / PJ-883 / TD-2020 / TD-2120N / TD-2130N / TD-2030A / TD-2125N / TD-2125NWB / TD-2135N / TD-2135NWB | **noCut** | **Result** | |:---:|---:| |✔️|![noCut](../.github/images/no-margin-no-cut.png) | ``` -------------------------------- ### PT-2100 / PT-2700 / PT-24 / PT-18R / PT-18NR Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-2100, PT-2700, PT-24, PT-18R, and PT-18NR printers. Supports noCut, chainPrint, and autoCut functionalities. ```markdown ## PT-2100 / PT-2700 / PT-24 / PT-18R / PT-18NR | **noCut** | **autoCut** | **chainPrint** | **Result** | |:---:|:---:|:---:|---:| |✔️|-|-|![noCut](../.github/images/no-cut.png) | |-|-|✔️|![chainPrint](../.github/images/chain-print.png) | |-|✔️|-|![autoCut](../.github/images/auto-cut.png) | |-|✔️|✔️|![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | ``` -------------------------------- ### PT-D800W / PT-P900 / PT-P900W / PT-P950NW Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for PT-D800W, PT-P900, PT-P900W, and PT-P950NW printers. Supports TZe and FLe media with various cutting options including noCut, chainPrint, halfCut, autoCut, and specialTape. ```markdown ## PT-D800W / PT-P900 / PT-P900W / PT-P950NW | **Media** | **noCut** | **autoCut** | **halfCut** | **chainPrint** | **specialTape** | **Result** | |:----------|:---:|:---:|:---:|:---:|:---:|---:| | TZe |✔️|-|-|-|-|![noCut](../.github/images/no-cut.png) | | TZe |-|-|-|✔️|-|![chainPrint](../.github/images/chain-print.png) | | TZe |-|-|✔️|-|-|![halfCut](../.github/images/half-cut.png) | | TZe |-|-|✔️|✔️|-|![halfCut chainPrint](../.github/images/half-cut-chain.png) | | TZe |-|✔️|-|-|-|![autoCut](../.github/images/auto-cut.png) | | TZe |-|✔️|-|✔️|-|![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | | TZe |-|✔️|✔️|-|-|![autoCut halfCut](../.github/images/auto-cut-half-cut.png) | | TZe |-|✔️|✔️|✔️|-|![autoCut halfCut chainPrint](../.github/images/auto-cut-half-chain.png) | | TZe |-|-|-|-|✔️|![specialTape](../.github/images/special-tape.png) | | FLe |✔️|-|❌|❌|❌|![noCut](../.github/images/no-cut-no-margin.png) | | FLe |-|✔️|❌|❌|❌|![autoCut](../.github/images/auto-cut-no-margin.png) | ``` -------------------------------- ### PT-2430PC / PT-2730 / PT-P700 / PT-P710BT / PT-P715eBT / PT-H500 / PT-E500 / PT-D600 / PT-D610BT Media and Cut Features Source: https://github.com/yeasir01/bpac-js/blob/main/docs/options.md Details media compatibility and cutting features for a range of printers including PT-2430PC, PT-2730, PT-P700 series, PT-H500, PT-E500, and PT-D600 series. Supports noCut, chainPrint, specialTape, and autoCut functionalities. ```markdown ## PT-2430PC / PT-2730 / PT-P700 / PT-P710BT / PT-P715eBT / PT-H500 / PT-E500 / PT-D600 / PT-D610BT | **noCut** | **autoCut** | **chainPrint**| **specialTape** | **Result** | |:---:|:---:|:---:|:---:|---:| |✔️|-|-|-|![noCut](../.github/images/no-cut.png) | |-|-|-|✔️|![specialTape](../.github/images/special-tape.png) | |-|-|✔️|-|![chainPrint](../.github/images/chain-print.png) | |-|✔️|-|-|![autoCut](../.github/images/auto-cut.png) | |-|✔️|✔️|-|![autoCut chainPrint](../.github/images/auto-cut-chain-print.png) | ``` -------------------------------- ### Print One Label Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Prints a single label using data provided in an object. The keys in the data object must match the field names in the specified template file. Optional print options can be provided. ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const label = new BrotherSdk({ templatePath: "C:\\Templates\\shoe-template.lbx" }); // Important: The keys and values must match the object name & type in the template file. const dataObject = { title: "Air Force One", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }; // All Options: Docs >> Options >> Print Options const options = { copies: 3, printName: "Air Force Label", highResolution: true } const handlePrint = async () => { try { const isPrinted = await label.print(dataObject, options); console.log({isPrinted}) // Output: {isPrinted: true} } catch (error) { console.log({error}) } }; btn.addEventListener("click", handlePrint); ``` -------------------------------- ### Print Many Labels Source: https://github.com/yeasir01/bpac-js/blob/main/docs/usage.md Prints multiple labels by providing an array of data objects. Each object in the array will be used to generate a separate label. Optional print options can be applied to all labels. ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; const btn = document.getElementById("btn"); const label = new BrotherSdk({ templatePath: "C:\\Templates\\shoe-template.lbx" }); // Important: The keys and values must match the object name & type in the template file. const dataArray = [{ title: "Air Force One", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }, { title: "Air Force One", price: "$149.99", barcode: "091207567724", date: new Date("2024-1-20"), }]; // All Options: Docs >> Options >> Print Options const options = { highResolution: true } const handlePrint = async () => { try { const isPrinted = await label.print(dataArray, options); console.log({isPrinted}) // Output: {isPrinted: true} } catch (error) { console.log({error}) } }; btn.addEventListener("click", handlePrint); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.