I am trying to display different boxes with a logo in it based on which PDF layers are active. See the image below
In my example I only have 3, but for my actual problem I am guessing I need 3 groups. I want to switch the box based on three settings:
Language = {English|Bokmål|Nynorsk|Samisk},Color = {Black, Color},Secret = {True | False}
Only one setting in each group will be active at a time. My problem is that I am not able to stack the layers and they appear in sequential order. Is there a way to make sure every layer is on top of each other, and to construct the three groups in a manageable fashion.
MWE
\documentclass[12pt]{article}
\usepackage[samin, norsk, nynorsk, british]{babel}
\usepackage[utf8]{inputenc} % usually not needed (loaded by default)
\usepackage[T1]{fontenc}
\usepackage[tikz]{ocgx2}
\newcommand{\UNItitlebox}[1]{%
\begin{center}
\setlength{\fboxsep}{0pt}
\fbox{%
\begin{minipage}{\dimexpr\textwidth-2\fboxrule}
\vspace{1pt}
\hrule height 1pt
\vspace{1.2em}
\noindent
\mbox{}\quad\includegraphics[height=1.69cm,width=12.8cm]{#1}\\[5pt]
\mbox{}\quad MAT-1001\quad Calculus\hfill English\quad\mbox{}%
\\[5pt]
\mbox{}\quad Exam\hfill 23/09/2019\quad\mbox{}%
\vspace{1em}
\hrule height1pt
\vspace{1pt}
\end{minipage}%
}
\end{center}%
}
% Hyperlenker og klikkbare lenker.
\RequirePackage{hyperref}
\hypersetup{
colorlinks=true, % false: boxed links; true: colored links
linkcolor=black, % color of internal links (change box color with linkbordercolor)
}
\begin{document}
\section{Introduction}
\begin{ocg}{OCG 1}{ocg1}{1}
\noindent
\actionsocg{}{ocg1}{ocg2 ocg3 ocg4}{\color{green!50!black}English}\hfill%
\actionsocg{}{ocg2}{ocg1 ocg3 ocg4}{Bokmål}\hfill%
\actionsocg{}{ocg3}{ocg1 ocg2 ocg4}{Nynorsk}\hfill%
\actionsocg{}{ocg4}{ocg1 ocg2 ocg3}{Samisk}
\end{ocg}
\vspace{-\baselineskip}
\begin{ocg}{OCG 2}{ocg2}{0}
\noindent
\actionsocg{}{ocg1}{ocg2 ocg3 ocg4}{English}\hfill%
\actionsocg{}{ocg2}{ocg1 ocg3 ocg4}{\color{green!50!black}Bokmål}\hfill%
\actionsocg{}{ocg3}{ocg1 ocg2 ocg4}{Nynorsk}\hfill%
\actionsocg{}{ocg4}{ocg1 ocg2 ocg3}{Samisk}
\end{ocg}
\vspace{-\baselineskip}
\begin{ocg}{OCG 3}{ocg3}{0}
\noindent
\actionsocg{}{ocg1}{ocg2 ocg3 ocg4}{English}\hfill%
\actionsocg{}{ocg2}{ocg1 ocg3 ocg4}{Bokmål}\hfill%
\actionsocg{}{ocg3}{ocg1 ocg2 ocg4}{\color{green!50!black}Nynorsk}\hfill%
\actionsocg{}{ocg4}{ocg1 ocg2 ocg3}{Samisk}
\end{ocg}
\vspace{-\baselineskip}
\begin{ocg}{OCG 4}{ocg4}{0}
\noindent
\actionsocg{}{ocg1}{ocg2 ocg3 ocg4}{English}\hfill%
\actionsocg{}{ocg2}{ocg1 ocg3 ocg4}{Bokmål}\hfill%
\actionsocg{}{ocg3}{ocg1 ocg2 ocg4}{Nynorsk}\hfill%
\actionsocg{}{ocg4}{ocg1 ocg2 ocg3}{\color{green!50!black}Samisk}
\end{ocg}
\bigskip
\begin{ocg}{OCG 1}{ocg1}{1}
\UNItitlebox{example-image-a}
\end{ocg}
\vspace{-4.7cm}
\begin{ocg}{OCG 2}{ocg2}{0}
\UNItitlebox{example-image-b}
\end{ocg}
\vspace{-4.7cm}
\begin{ocg}{OCG 3}{ocg3}{0}
\UNItitlebox{example-image-c}
\end{ocg}
\vspace{-4.7cm}
\begin{ocg}{OCG 4}{ocg4}{0}
\UNItitlebox{example-image}
\end{ocg}
\end{document}

