-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(added): add addViewShot method to allow print from React Native …
…View (#176)
- Loading branch information
Showing
23 changed files
with
483 additions
and
11 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Interface: AddViewShotParams | ||
|
||
### viewNode | ||
|
||
*viewNode*: `View ref` | ||
|
||
Parent view node. | ||
|
||
### width (optional) | ||
|
||
*width*: `number` | ||
|
||
Width of the image in pixels. Default: `calculated using printer paper width`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
## static Printer.addTextLine | ||
|
||
Prints image captured from React Native View | ||
|
||
### Parameters | ||
|
||
#### printerInstance | ||
|
||
- `Printer` | ||
|
||
Printer instance defined by calling `new Printer(...)`. | ||
|
||
#### params | ||
|
||
- [AddViewShotParams](../interfaces/addViewShotParams.md) | ||
|
||
### Returns | ||
|
||
`Promise<void>` | ||
|
||
### Errors | ||
|
||
| **Error status** | **Description** | | ||
| --- | --- | | ||
| ERR_PARAM | An invalid parameter was passed. | | ||
| ERR_TIMEOUT | Failed to communicate with the devices within the specified time. | | ||
| ERR_MEMORY | Necessary memory could not be allocated. | | ||
| CODE_ERR_AUTORECOVER | Automatic recovery error occurred. | | ||
| CODE_ERR_COVER_OPEN | Cover open error occurred. | | ||
| CODE_ERR_CUTTER | Auto cutter error occurred. | | ||
| CODE_ERR_MECHANICAL | Mechanical error occurred. | | ||
| CODE_ERR_EMPTY | No paper is left in the roll paper end detector. | | ||
| CODE_ERR_PARAM | An invalid parameter was passed. | | ||
| CODE_ERR_MEMORY | Memory necessary for processing could not be allocated. | | ||
| CODE_ERR_TIMEOUT | Print timeout occurred. | | ||
| CODE_ERR_PROCESSING | Could not run the process. | | ||
| CODE_ERR_ILLEGAL | This API was called while no communication had been started. | | ||
| CODE_ERR_FAILURE | Error exists in the requested document syntax. | | ||
|
||
### Supplementary explanation | ||
|
||
- Uses [react-native-view-shot](https://github.com/gre/react-native-view-shot) | ||
- Internaly uses [addImage](./addText.md) and [getPrinterSetting](./getPrinterSetting.md) commands. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.