create_PDF {baRcodeR}R Documentation

Make QR codes and print labels

Description

Input vector or data.frame of ID codes to produce a PDF of QR codes which can be printed. This is a wrapper function for custom_create_PDF

Usage

create_PDF(user = FALSE, Labels = NULL, name = "LabelsOut",
  ErrCorr = "H", Fsz = 2.5, ...)

Arguments

user

logical. Run function using interactive mode (prompts user for parameter values) Default is FALSE

Labels

vector or data frame object containing label names (i.e. unique ID codes).

name

character. Name of the PDF output file. Default is "LabelsOut".

ErrCorr

error correction value. Level of damage from low to high: "L", "M", "Q", "H". Default is "H"

Fsz

numerical. Sets font size using a number between 2.2 and 4.7. Longer ID codes may not fit on the labels using larger font sizes. Default font size is 2.5

...

advanced arguments to modify the PDF layout. See custom_create_PDF for arguments. The advanced options can be accessed interactively with user = TRUE and then entering TRUE when prompted to modify advanced options.

Value

a PDF file containing QR-coded labels, saved to the default directory.

The default PDF setup is for ULINE 1.75" * 0.5" WEATHER RESISTANT LABEL for laser printer; item # S-19297 (uline.ca). The page format can be modified using the ... (advanced arguments) for other label types.

See Also

custom_create_PDF

Examples

## data frame
example_vector <- as.data.frame(c("ao1", "a02", "a03"))

## Not run: 
## run with default options
## pdf file will be "example.pdf" saved into a temp directory

create_PDF(Labels = example_vector, name = file.path(tempdir(), "example"))

## view example output from temp folder
system(paste0('open "', file.path(tempdir(), "example"), ".pdf"))

## End(Not run)

## run interactively. Overrides default pdf options
if(interactive()){
    create_PDF(user = TRUE, Labels = example_vector)
}


## run using a data frame, automatically choosing the "label" column
example_df <- data.frame("level1" = c("a1", "a2"), "label" = c("a1-b1",
"a1-b2"), "level2" = c("b1", "b1"))
create_PDF(user = FALSE, Labels = example_df, name = file.path(tempdir(), "example_2"))



## run using an unnamed data frame
example_df <- data.frame(c("a1", "a2"), c("a1-b1", "a1-b2"), c("b1", "b1"))
## specify column from data frame
create_PDF(user = FALSE, Labels = example_df[,2], name = file.path(tempdir(), "example_3"))


[Package baRcodeR version 0.1.0 Index]