[pdftex] multiline TextField

Heiko Oberdiek oberdiek at uni-freiburg.de
Wed Apr 30 14:37:28 CEST 2003


On Wed, Apr 30, 2003 at 12:15:44PM +0200, Joern Clausen wrote:

> I'd like to create a PDF form with a multiline TextField, using pdflatex
> and if possible hyperref. The default content of the field consists of
> several lines of text (Haskell code, actually). I have found no way to
> define linebreaks in this default text within the LaTeX source.
> 
> According to the PDF specification, a carriage return is encoded as
> "\r". I can insert linebreaks by hand in the generated PDF file, but I
> have found no possibility to pass the sequence "backslash - r" from
> LaTeX to PDF.

\string\r

You can use \pdfstringdef for converting TeX strings to PDF ones:

\pdfstringdef\mytext{Hello\string\r World}
...\mytext...

or

\pdfstringdefDisableCommands{\def\\{\string\r}}

\pdfstringdef\mytext{Hello\\World}

Yours sincerely
  Heiko <oberdiek at uni-freiburg.de>
-- 



More information about the pdftex mailing list