The goal of googlePrintr is to connect to the Google Cloud Print API. It is depends on the awesome googleAuthR
package.
You can install googlePrintr from github with:
# install.packages("devtools")
devtools::install_github("CannaData/googlePrintr")
Printing:
library(googleAuthR)
library(googlePrintr)
options("googleAuthR.scopes.selected" = c("https://www.googleapis.com/auth/cloudprint"))
options("googleAuthR.ok_content_types"= c(getOption("googleAuthR.ok_content_types"),
"text/plain"))
# login using googleAuthR
gar_auth_service("my.json", scope = c("https://www.googleapis.com/auth/cloudprint"))
printer <- gcp_search("myPrinter")
gcp_submit(printer$id[1],
"New Title",
content =
"<h1>Hello World</h1>",
contentType = "text/html"
)