I want to create a pdf (with pdflatex) with some ocgs layers. These layers are only images. Further I want to activate and deactivate these layers with boxes and checkmarks. So for example if I see a image the box has a checkmark. Then I click in the box on the checkmark and the image will disappear.
I already created the pdf with the images, the boxes (makeboxes) with checkmarks at the right position. I used makeboxes, because I could not handle checkboxes. The only problem is, that I do not know, how to include the function, that the checkmark in the box will disappear and appear again, if I click on it.
Currently I just have one makebox with a checkmark for one layer.
Can someone help me?
Thank you.
That is my code:
\documentclass{article}
\usepackage[pscoord]{eso-pic}
\usepackage[left=0.0001mm, right=0.0001mm, top=0.0001mm, bottom=0.0001mm, paperheight=16.54in, paperwidth=11.69in]{geometry}
\usepackage{pdflscape}
\usepackage{ocgx}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{rotating}
\usepackage{listings}
\usepackage{wasysym}
\usepackage{hyperref}
\newcommand{\placetextbox}[3]{% \placetextbox{<horizontal pos>}{<vertical pos>}{<stuff>}
\setbox0=\hbox{#3}% Put <stuff> in a box
\AddToShipoutPictureFG*{% Add <stuff> to current page foreground
\put(\LenToUnit{#1\paperwidth},\LenToUnit{#2\paperheight}){\vtop{{\null}\makebox[2pt][c]{#3}}}%
}%
}%
\begin{document}
\begin{landscape}
\makebox[0pt][l]{%
\begin{ocg}{a}{1}{1}%
\begin{tikzpicture}%
\node [inner sep=0pt] {\includegraphics[scale=0.98]{image_a}};%
\placetextbox{0.31}{0.81}{%
\switchocg{2}{%
\begin{sideways}%
\scalebox{2.6}{%
\makebox{\ooalign{$\checkmark$\cr\hidewidth$\square$\hidewidth\cr}}}%
\end{sideways}}}%
\end{tikzpicture}%
\end{ocg}%
}%
\makebox[0pt][l]{%
\begin{ocg}{b}{2}{1}%
\begin{tikzpicture}%
\node [inner sep=0pt] {\includegraphics[scale=0.98]{image_b}};%
\end{tikzpicture}%
\end{ocg}%
}%
\end{landscape}
\end{document}
I have the ocgx2 package. Do you have a tip for me? Thank you.
– HHVice May 02 '16 at 17:06