Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
yeasir01 committed Jan 29, 2024
1 parent 8b4d77b commit be4acea
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 13 deletions.
33 changes: 33 additions & 0 deletions docs/options.md
Original file line number Diff line number Diff line change
@@ -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 |
File renamed without changes.
18 changes: 7 additions & 11 deletions docs/vanilla-js.md → docs/vanilla.md
Original file line number Diff line number Diff line change
@@ -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";
Expand All @@ -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";
Expand All @@ -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";
Expand All @@ -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 () => {
Expand Down
4 changes: 2 additions & 2 deletions tests/browser/playground.js
Original file line number Diff line number Diff line change
@@ -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");
Expand All @@ -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 });
Expand Down

0 comments on commit be4acea

Please sign in to comment.