# hyperref : break long lines in pdftitle and other fields

I have a problem with hyperref: how to break long lines in pdf fields : the pdftitle is very long and I want hyperref to begin a new line, just like it does for key-words.

I compile with pdflatex, xelatex and lualatex.

\documentclass[oneside,a4paper, 12pt]{article}

%%\usepackage[T1]{fontenc}
%%\usepackage[frenchb]{babel}

%%%% \usepackage{alternative4ht}
\usepackage{fontspec}
\setmainfont{TeX Gyre Termes}
\usepackage{polyglossia}
\setmainlanguage{czech}

\usepackage{hyperref}
\hypersetup{
pdfencoding=auto,
psdextra,
}

\hypersetup{
pdftitle={\today Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit.},
}

\begin{document}
\today

\end{document}

• My version of Acrobat only has enough room for one line of title, but several lines of keywords. Any line breaking is done by the browser. not the document. Jan 4, 2016 at 17:44

The PDF format does not support explicit line breaks in PDF information fields.

\textLF (line feed) or \textCR (carriage return) could be tried:

\documentclass{article}
\usepackage{hyperref}
\hypersetup{
pdftitle={Hello\textLF World},
pdfsubject={Hello\textCR World},
}
\begin{document}
Hello World
\end{document}


And evince shows indeed line breaks. But AR shows only the first line and the rest of the title or subject is not displayed. Therefore this method is not recommended.

• summatra shows the LF and CR indeed, but not foxit.... Jan 5, 2016 at 5:41

To illustrate the point, using

\hypersetup{
pdftitle={\today Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit.},
pdfkeywords={Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit Lorem ipsum dolor sit amet, consectetur adipiscing elit.},
}


the corresponding object in the PDF is

15 0 obj
<<