diff --git a/docs/options.md b/docs/options.md new file mode 100644 index 0000000..68ce94d --- /dev/null +++ b/docs/options.md @@ -0,0 +1,33 @@ +# Notice +Properties are applicable exclusively to models that support each respective function. If a model does not support a particular function, the configuration becomes invalid, even if a prop is specified. + +## Print Config Options +| **Key** | **Type** | **Default** | **Description** | +|---|---|:---:|---| +| copies | number | 1 |Number of copies to print.| +| printName | string | "BPAC-Document" |Document Name for print queue.| +| autoCut | boolean | false |Auto cut after print.| +| cutPause | boolean | false |Pause to cut is applied. Valid only with models not supporting the auto cut function.| +| cutMark | boolean | false |Cut mark is inserted. Valid only with models not supporting the auto cut function.| +| halfCut | boolean | false |Performs half cut.| +| chainPrint | boolean | false |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 | false |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 | false |No cutting is performed when printing on special tape. Valid only with PT-2430PC.| +| cutAtEnd | boolean | false |Cut at end is performed.| +| noCut | boolean | false |Disable auto cut| +| mirroring | boolean | false |Mirror print label.| +| quality | boolean | false |Fine quality print.| +| highSpeed | boolean | false |High speed printing.| +| highResolution | boolean | false |High resolution printing.| +| color | boolean | false |Print in color.| +| mono | boolean | false |Print in monochrome.| +| continue | boolean | false |Front margin not output.| + +## Supported Export Extensions +| **Description** | **Extension** | +|---|:---:| +| LBX type | .lbx | +| LBL (P-touch Editor 4.2) | .lbl | +| LBI type | .lbi | +| BMP Image | .bmp | +| PAF Type | .paf | diff --git a/docs/react-js.md b/docs/react.md similarity index 100% rename from docs/react-js.md rename to docs/react.md diff --git a/docs/vanilla-js.md b/docs/vanilla.md similarity index 88% rename from docs/vanilla-js.md rename to docs/vanilla.md index b19ceba..ad53b3f 100644 --- a/docs/vanilla-js.md +++ b/docs/vanilla.md @@ -1,12 +1,7 @@ # Vanilla JS 📢 This Readme is written for Vanilla JS users only to use in your react project please checkout the react-js readme. -## Setup -1. download the ./dist/bundle.js file from the repo. (Coming Soon) -2. include the file in your assets folder (./assets/js/bundle.js) -3. create your script file (./assets/js/script.js) - -### Printer Name +### Get Printer Name ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; @@ -32,7 +27,7 @@ getNameBtn.addEventListener("click", getName); ``` -### List of Printer Names +### Get List Of Printers ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; @@ -52,7 +47,7 @@ getNameBtn.addEventListener("click", getNames); ``` -### Printing +### Print ```javascript // script.js file import BrotherSdk from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; @@ -72,10 +67,11 @@ const data = { date: new Date("2024-1-20"), }; +// Docs >> Options >> Print Config Options - for all options const options = { - copies: 1, // Optional - Defaults to 1 - printName: "Air Force Label", // Optional - Defaults to BPAC-Document - highResolution: true // Optional + copies: 1, + printName: "Air Force Label", + highResolution: true } const sendToPrinter = async () => { diff --git a/tests/browser/playground.js b/tests/browser/playground.js index ef03a43..fa27e9a 100644 --- a/tests/browser/playground.js +++ b/tests/browser/playground.js @@ -1,5 +1,5 @@ //import BrotherSdK from "https://cdn.jsdelivr.net/npm/bpac-js@latest/dist/index.js"; -import BrotherSdk from "../../dist/index.js"; +import { BrotherSdk } from "../../dist/index.js"; const printBtn = document.getElementById("print-btn"); const previewBtn = document.getElementById("preview-btn"); @@ -20,7 +20,7 @@ const data = { /* {autoCut: true, mirroring: true, specialTape:true} */ const printTag = async () => { try { - const complete = await tag.print(data); + const complete = await tag.print(data, { mirroring: true, autoCut: true }); console.log({ complete }); } catch (error) { console.log({ error });