---
title: ''
geometry: "left=0cm,right=0cm,top=2cm,bottom=0cm"
output:
  pdf_document: default
classoption: 
    landscape
header-includes:
    \usepackage{pgfpages}
    \usepackage{qrcode}
    \usepackage{pspicture}
    \usepackage{mdframed}
    \usepackage{pagecolor}
    \usepackage{xcolor}
    \usepackage{changepage}
    \pgfpagesuselayout{8 on 1}[a4paper]
params:
  qr.i: ""
  field1.i: ""
  field2.i: ""
  field3.i: ""
  field4.i: ""
  field5.i: ""
  bgcolor: ""
  textcolor: ""
---

```{r echo=FALSE, results='asis'}

for (i in seq_along(params$field1.i)) {
  
  cat("
  \\pagenumbering{gobble}
  \\definecolor{mycolor}{HTML}{",params$bgcolor,"}
  \\definecolor{mycolortext}{HTML}{",params$textcolor,"}
  \\begin{mdframed}[linecolor=mycolortext, linewidth=2pt, backgroundcolor=mycolor]\n
  \\bigskip
  \\bigskip
  \\begin{flushright}
  \\begin{minipage}[b][0ex][t]{16em}",
  if (params$qr.i[i] != "") "\\qrcode[height=2in, version=5]{",
  if (params$qr.i[i] != "") params$qr.i[i],
  if (params$qr.i[i] != "") "}",
  "
  \\end{minipage}
  \\end{flushright}
  \\begin{adjustwidth}{1cm}{1cm}
  {\\fontsize{35pt}{100pt}\\selectfont\\emph{\\textcolor{mycolortext}{",
  params$field1.i[i],
  "}}} \\\\
  \\linebreak
  \\linebreak
  {\\fontsize{40pt}{0pt}\\selectfont\\bf{\\textcolor{mycolortext}{", 
  params$field2.i[i],
  "}}} \\\\
  \\vfill
  {\\fontsize{30pt}{100pt}\\selectfont\\textcolor{mycolortext}{", 
  params$field3.i[i],
  "}} \\\\
  \\vfill
  {\\fontsize{30pt}{100pt}\\selectfont\\textcolor{mycolortext}{",
  params$field4.i[i],
  "}} \\\\
  \\vfill
  {\\fontsize{30pt}{50pt}\\selectfont\\textcolor{mycolortext}{",
  params$field5.i[i],
  "}} \\\\
  \\end{adjustwidth}
  \\begin{center}
  \\includegraphics[height=1.5in]{logo.png}
  \\end{center}
  \\end{mdframed}
  \\pagebreak
  ")
}
```



