
이 질문은 다음과 관련이 있습니다.텍스트 필드에 고유한 이름 생성
hyperref
PDF 양식을 생성하는 데 사용하기 때문에 위 질문에 제공된 솔루션을 사용할 수 없습니다 .
내 문서에는 많은 테이블이 있으며 그 안에 PDF 양식을 만들고 싶습니다. 텍스트 필드의 이름은 중요하지 않습니다. 사용자가 텍스트 필드를 채울 수만 있으면 됩니다.
문제는 사용자가 PDF 보기의 텍스트 필드 중 하나를 채우려고 하면 다른 필드도 채워진다는 것입니다.
\TextField{}
대신 사용하면 \TextField{\ }
Acrobat Reader에서 PDF 파일을 열 때 텍스트 필드가 표시되지 않습니다.
\documentclass{article}
\usepackage{hyperref}
\begin{document}
\begin{Form}
\begin{tabular}{llll}
A & B & C & D \\
\TextField{\ } & \TextField{\ } & \TextField{\ } & \TextField{\ }\\
\TextField{\ } & \TextField{\ } & \TextField{\ } & \TextField{\ } \\
\TextField{\ } & \TextField{\ } & \TextField{\ } & \TextField{\ }
\end{tabular}
\end{Form}
\end{document}
답변1
텍스트 필드에는 고유한 이름이 필요하지만 예를 들어 카운터와 새 명령을 사용하여 생성할 수 있습니다.
\documentclass{article}
\usepackage{hyperref}
\newcounter{textfield}
\newcommand\AutoTextField{\stepcounter{textfield}\TextField[width=2cm,name=autotextfield\thetextfield]{}}
\begin{document}
\begin{Form}
\begin{tabular}{llll}
A & B & C & D \\
\AutoTextField & \AutoTextField & \AutoTextField & \AutoTextField\\
\AutoTextField & \AutoTextField & \AutoTextField & \AutoTextField \\
\AutoTextField & \AutoTextField & \AutoTextField & \AutoTextField
\end{tabular}
\end{Form}
\end{document}