pdftooltip does not work fine with OCG layers
Issue #28
new
Hallo Josef,
Tooltips (\pdftooltip) show up even for deactivated (invisible) OCG layers. I expected them to be invisible too.
I run my code with XeTeX, Version 3.141592653-2.6-0.999994 (TeX Live 2022) (preloaded format=xelatex 2022.4.5)
Code for reproduction:
%!TEX TS-program = xelatex
\RequirePackage[tikz]{ocgx2}
\documentclass[a4paper]{article}
\usepackage{pdfcomment}
%
\begin{document}
%
\fbox{
\begin{ocg}{ocg1}{ocg1}{1}
\pdftooltip{Text01}{Tooltip01}
\end{ocg}
}
\\~\\
The first text and tooltip work fine as long as it is visible.\\~\\
%
\fbox{
\begin{ocg}{ocg2}{ocg2}{0}
\pdftooltip{Text02}{Tooltip02}
\end{ocg}
}
\\~\\
There should not be a tooltip for the second text (second box) since the OCG layer is not turned on (not visible, therefore the box appears to be empty).
%
\end{document}
I work with several OCG layers and only want the tooltips enabled for visible elements, others (invisible ones) shold not generate tooltips when passing the mouse over it.
Grüße
Eddy