![텍스트 필드 이름을 지정하지 않고 PDF 형식으로 고유한 텍스트 필드를 만드는 방법](https://rvso.com/image/420745/%ED%85%8D%EC%8A%A4%ED%8A%B8%20%ED%95%84%EB%93%9C%20%EC%9D%B4%EB%A6%84%EC%9D%84%20%EC%A7%80%EC%A0%95%ED%95%98%EC%A7%80%20%EC%95%8A%EA%B3%A0%20PDF%20%ED%98%95%EC%8B%9D%EC%9C%BC%EB%A1%9C%20%EA%B3%A0%EC%9C%A0%ED%95%9C%20%ED%85%8D%EC%8A%A4%ED%8A%B8%20%ED%95%84%EB%93%9C%EB%A5%BC%20%EB%A7%8C%EB%93%9C%EB%8A%94%20%EB%B0%A9%EB%B2%95.png)
이 질문은 다음과 관련이 있습니다.텍스트 필드에 고유한 이름 생성
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}