2020 年之后,如何向 (hyperref) pdf 表单 TextField 添加换行符?

2020 年之后,如何向 (hyperref) pdf 表单 TextField 添加换行符?

这是这个问题。Ulrike Fischer 给出的答案在 2020 年之后不再适用于 hyperref 包。

重现步骤:

\documentclass{article}
\usepackage{hyperref}
  \renewcommand*{\DefaultHeightofTextMultiline}{20\baselineskip}

\begin{document}
  \centering
  \begin{Form}
    \TextField[multiline,width=\textwidth,
    value={%
      You should write your feedback in a readable way, for example using bullet points:\string\n
      * Insert at least 1 positive comment (mandatory)\string\n
      * Insert at least 1 critical comment or question (mandatory)\string\n
      Use multiple paragraphs.
      \string\n
      Some examples of concrete, actionable feedback:\string\n
      * The first figure does not have a caption; please add it.\string\n
      * The derivation of Equation (7) became unclear around Equation (5). I think this is because you did not make the substitution of x explicit and feel doing so would make the argument clearer.\string\n%
  },
  name=mytextfield]{}%
  \end{Form}
\end{document}

结果:

有中文符号代替换行符。 结果

答案1

您可以使用 \textCR 或 \textLF:

\documentclass{article}
\usepackage{hyperref}
  \renewcommand*{\DefaultHeightofTextMultiline}{20\baselineskip}

\begin{document}
  \centering
  \begin{Form}
    \TextField[multiline,width=\textwidth,
    value={%
      You\textLF blub
  },
  name=mytextfield]{}%
  \end{Form}
\end{document}

相关内容