
저는 여러 줄의 텍스트 필드와 세 장의 그림이 포함된 문서를 작성합니다. 클릭하면 사진의 가시성이 변경됩니다. 그러나 PDF를 볼 때 그림의 가시성이 변경된 후 문서가 저장되면 그림 변경 사항이 파일에 저장되지 않습니다. 텍스트 필드의 변경 사항이 저장됩니다.
사진 가시성 상태를 저장하는 방법은 무엇입니까?
\documentclass{scrartcl}
\usepackage{ocgx}
\usepackage{tikz}
\usepackage{hyperref}
\begin{document}
\begin{frame}
\begin{Form}
\TextField[multiline=true,width=\linewidth,height=50pt,value=Exampletext]{}
\end{Form}
\begin{tikzpicture}
\node at (0,0) {\begin{ocg}{Image 1}{ocg1}{1}\actionsocg{ocg1}{}{}{\includegraphics[width=1.0cm]{example-image-a}}\end{ocg}};
\node at (0,1) {\begin{ocg}{Image 2}{ocg2}{1}\actionsocg{ocg2}{}{}{\includegraphics[width=1.0cm]{example-image-b}}\end{ocg}};
\node at (0,2) {\begin{ocg}{Image 3}{ocg3}{1}\actionsocg{ocg3}{}{}{\includegraphics[width=1.0cm]{example-image-c}}\end{ocg}};
\end{tikzpicture}
\end{frame}
\end{document}
답변1
비결은
- 그림 위에 CheckBox를 그립니다.
- 배경색을 투명하게 설정
- 색상을 흰색으로 설정
- 테두리 제거
- 기호를 직사각형으로 설정
- 글꼴을 확대하면 기호가 상자 전체를 채울 수 있습니다.
- 그림과 같은 크기 설정
- 체크박스에서 라벨 제거
최신 hyperref 패키지가 필요합니다.
\documentclass{scrartcl}
\usepackage{tikz}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\TextField[multiline=true,width=\linewidth,height=50pt,value=Exampletext]{}
\begin{tikzpicture}
% get rid of label space
\def\LayoutCheckField#1#2{\makebox#2}
\node at (0,0) {\includegraphics[width=1cm,height=0.7cm]{example-image-a}};
\node at (0,0) {
\CheckBox[
borderwidth=1,
backgroundcolor=,
color=1 1 1,
bordercolor=,
checkboxsymbol=\ding{110},
charsize=100pt,
checked=false,
width=1cm,
height=0.7cm
]{}
};
\node at (0,1) {\includegraphics[width=1cm,height=0.7cm]{example-image-b}};
\node at (0,1) {
\CheckBox[
borderwidth=1,
backgroundcolor=,
color=1 1 1,
bordercolor=,
checkboxsymbol=\ding{110},
charsize=100pt,
checked=false,
width=1cm,
height=0.7cm
]{}
};
\node at (0,2) {\includegraphics[width=1cm,height=0.7cm]{example-image-c}};
\node at (0,2) {
\CheckBox[
borderwidth=1,
backgroundcolor=,
color=1 1 1,
bordercolor=,
checkboxsymbol=\ding{110},
charsize=100pt,
checked=false,
width=1cm,
height=0.7cm
]{}
};
\end{tikzpicture}
\end{Form}
\end{document}