R/create_address_barcode.R

Defines functions create_address_barcode

Documented in create_address_barcode

#' Create Address Barcode
#'
#' This functions invokes a system command to `Zint` and outputs a **Code 128** barcode.
#'
#' Barcodes are saved to the directory which has been created using `create_directory`.
#'
#' @param address A character string with no white space which is used as the sample address
#' @export

create_address_barcode <- function(address = 'CarwynJamesBuilding')
{
  fileOut <- 'ADDRESS.png'
  ZintCommand <-
    paste0("zint --notext --scale 1.0 --height 15",
           " -o ",
           "'",
           fileOut,
           "'",
           " -d ",
           "'",
           address,
           "'")
  system(ZintCommand, intern = TRUE)
  file.copy(from = fileOut, to = getOption('savePath'))
  file.remove(fileOut)

  return(invisible(NULL))

}
aberWARU/bronglaisBarcodes documentation built on Dec. 13, 2021, 12:46 a.m.