# Creating a PDF with Content Hidden Depending on a Response to a Form

Would it possible to create a say 3-page PDF document with LaTeX such that

1. On page 1 the reader is presented with a yes/no question through something like a radio button;
2. If the answer is yes, then the reader may go on to page 2 and 3;
3. If the answer is no, then the reader goes to page 3, while page 2 remains hidden to him/her.

The idea is to create document with a non-disclosure clause in the cover page. If accepted, green light with reading the whole document. If declined, the access is only granted from one other page onwards, or to none.

A tricky implication is that page 2 in the example should ideally remain inaccessible also to previews, thumbnails and so forth.

I am aware of a similar unanswered question 'conditional text triggered by form'. If my question is too far-fetched, as I fear, it would be interesting to address that question instead.

Thanks for dealing with this.

The only means I can think of is OCGs (PDF Layers). However, it cannot eliminate pages, only hide their content.

\documentclass{article}
\usepackage{ocgx2} % supports multi-page PDF Layers
\usepackage{color}
\usepackage{kantlipsum}
\usepackage{hyperref}

\begin{document}
I agree \raisebox{-0.25\height}{\huge%
\makebox[0pt][l]{\showocg{classified}{\color{red}$\circ$}}%
\begin{ocg}{I agree.}{classified}{off}$\color{green}\bullet$\end{ocg}%
} to tell nothing about the following content to anybody.