# Confused visibility of PDF layers when restoring from fullscreen mode

one of may colleagues observed that the visibility of some PDF layers may (unreasonably) change when the document restores from Fullscreen mode.

Steps to reproduce:

1. Open the file ocg-p_example_4.pdf from ocg-p bundle at http://www.ctan.org/pkg/ocg-p . The direct link is http://mirror.ibcp.fr/pub/CTAN/macros/latex/contrib/ocg-p/examples/ocg-p_example_4.pdf .

2. Press ctrl+L for fullscreen.

3. Click the header "Grade" in the second table (ocgtabular). The table becomes sorted with respect to grade.

4. Press Esc to return to the window mode. The table is not sorted now.

Few more tests give suspicion that some of the changes of visibility of PDF layers which have been made in Fullscreen mode and with help of javascripts do not persist after leaving fullscreen.

Do you have any idea how to change this behavior? Many thanks.

EDIT: The question is related to Adobe Reader browser (because of ocg layers and javascripts).

This is an Acrobat Reader feature. Upon exit from full-screen mode, AR forgets any layer visibility changes made by the user during full-screen mode. Layer visibilities prior to entering full-screen mode are restored.

Evince and other PDF readers are not affected.

Small example for testing:

\documentclass{article}

\usepackage{ocgx2}

\begin{document}
\begin{ocg}{A}{A}{on}\fbox{A}\end{ocg}%
\begin{ocg}{B}{B}{off}\fbox{B}\end{ocg}

\switchocg{A B}{\fbox{Toggle}}
\end{document}