Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/hrbrmstr/escpos
R 📦 for printing text, images, and {ggplot2} or {grid} objects to ESC/POS compatible network devices
https://github.com/hrbrmstr/escpos
escpos escpos-printable-image escpos-printer r rstats tm-t88v
Last synced: 3 months ago
JSON representation
R 📦 for printing text, images, and {ggplot2} or {grid} objects to ESC/POS compatible network devices
- Host: GitHub
- URL: https://github.com/hrbrmstr/escpos
- Owner: hrbrmstr
- License: other
- Created: 2022-03-31T14:47:06.000Z (almost 3 years ago)
- Default Branch: batman
- Last Pushed: 2022-07-12T19:41:01.000Z (over 2 years ago)
- Last Synced: 2023-03-12T03:03:44.994Z (almost 2 years ago)
- Topics: escpos, escpos-printable-image, escpos-printer, r, rstats, tm-t88v
- Language: C++
- Homepage:
- Size: 802 KB
- Stars: 17
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: rmarkdown::github_document
editor_options:
chunk_output_type: console
---
```{r pkg-knitr-opts, include=FALSE}
hrbrpkghelpr::global_opts()
``````{r badges, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::stinking_badges()
``````{r description, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::yank_title_and_description()
```## What's Inside The Tin
The following functions are implemented:
```{r ingredients, results='asis', echo=FALSE, cache=FALSE}
hrbrpkghelpr::describe_ingredients()
```
- `escpos`: Create an `escpos` object for accumulating print commands## NOTE
I've only tested this on a single, networked EPSON TM-T88V printer.
## Installation
```{r install-ex, eval = FALSE}
remotes::install_github("hrbrmstr/escpos", ref = "batman")
```## Usage
```{r lib-ex}
library(escpos)# current version
packageVersion("escpos")```
```{r ex-01, eval = FALSE}
library(stringi)
library(hrbrthemes)
library(ggplot2)ggplot() +
geom_point(
data = mtcars,
aes(wt, mpg),
color = "red"
) +
labs(
title = "A good title"
) +
theme_ipsum_es(grid="XY") -> ggepson_ip = "HOSTNAME_OR_IP_OF_YOUR_PRINTER"
escpos(epson_ip) |>
pos_bold("on") %>%
pos_align("center") %>%
pos_size("2x") %>%
pos_underline("2dot") %>%
pos_plaintext("This Is A Title") %>%
pos_lf(2) |>
pos_underline("off") %>%
pos_size("normal") %>%
pos_align("left") %>%
pos_bold("off") %>%
pos_font("b") %>%
pos_plaintext(
stringi::stri_rand_lipsum(1)
) |>
pos_lf(2) |>
pos_font("a") %>%
pos_plaintext(
paste0(capture.output(
str(mtcars, width = 40, strict.width = "cut")
), collapse = "\n")
) |>
pos_lf(2L) |>
pos_plot(gg, color = TRUE) %>%
pos_lf(2L) |>
pos_font("c") %>%
pos_plaintext(
stringi::stri_rand_lipsum(1, start_lipsum = FALSE)
) |>
pos_lf(3) |>
pos_cut() %>%
pos_print()
```![](man/figures/escpos-complex.png)
## escpos Metrics
```{r cloc, echo=FALSE}
cloc::cloc_pkg_md()
```## Code of Conduct
Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.