I'd like to typeset a checkbox, which one could simply do by using $\Box$
. However, it should be part of a PDF form as well, which one could do by using the CheckBox
command of hyperref
.
Now, I need the combination of these two -- a box that's a visible and printable part of the "text" and the functionality as a PDF form.
When using a hyperref
CheckBox
, there is no box drawn in the PDF file, except for the box that's drawn as a part of the form, i.e. is drawn depending on the PDF viewer and not printed. I'd like to have a box as a part of the normal text with a hyperref
CheckBox
over it.
This should illustrate the problem:
\documentclass{article}
\usepackage{hyperref}
\usepackage{amssymb}
\parindent0pt
\begin{document}
\begin{Form}
\mbox{\CheckBox[width=10pt,height=10pt,bordercolor=0 0 0]{\null}} Option 1\\
$\Box$ Option 2\\
\fbox{\CheckBox[width=10pt,height=10pt,bordercolor=1 1 1]{\null}} Option 3
\end{Form}
\end{document}
The first "box" works as a PDF CheckBox
and gets drawn by most PDF viewers as a black box; when printing, however, it vanishes, and some PDF viewers ignore the box.
The second box is just a plain box, which is printed in the required way but isn't a PDF form.
The third box is an fbox
around a CheckBox
, which is the desired result except that it has a weird shape and is too big -- reducing the dimensions of the CheckBox
so the fbox
gets small enough results in a not properly working (partially hidden) CheckBox
.