# pdf meta data and title bar of pdf viewer

A convenient way to include a picture in the title page of a beamer document is to use \includegraphics inside the title environment. The drawback is that the filename of the document that shows up in the titlebar of some pdf readers includes also the filename of the picture and some positioning commands.

E.g., for the minimal working example

\documentclass{beamer}

\title{\hspace{-0.5cm} \includegraphics[width=0.1\textwidth]{pdflogo.pdf}\\ \hspace{0.5cm}\\ \large My Custom Title}
\author{Me}
\date

\begin{document}

\frame{\titlepage}

\end{document}


the result is (in Okular under Debian Linux)

As the Okular handbook writes (on p. 30) "Display document title in titlebar if available. Whether to show the current document title in the titlebar of Okular window. If no meta-data for title found in the document or this item is unchecked Okular shows filename of the document." I believe this is an issue with the meta-data.

However, changing the metadata via hyperref with

\usepackage{hyperref}
\hypersetup{
pdftitle={My Custom Title}
}


or pdfinfo with

\pdfinfo{/Title (My Custom Title)}


or adding a short title with

\title[My Custom Title]{\hspace{-0.5cm} \includegraphics[width=0.1\textwidth]{pdflogo.pdf}\\ \hspace{0.5cm}\\ \large My Custom Title}


does not solve the problem.

Question: Is there a way to change the metadata in a way that one can customize the titlebar entry of the pdf viewer (if taken from metadata)?

Note that this issue does not show up at most pdf viewers as they just use the filename in the titlepage (e.g, Acrobat reader under Windows or Mac, Sumatra under Windows). However, it does not seem to be Okular specific, as I could reproduce it with other viewers/programs (e.g., Evince and Gimp on Debian Linux).

Instead of spending time getting around the side effects from misusing the \title command you should better define your own title page template:

\documentclass{beamer}

\title{My Custom Title}
\titlegraphic{\includegraphics[height=1cm]{example-image-A}}
\author{Me}
\date{\today}

\defbeamertemplate{title page}{mystyle}[1][]
{
\vbox{}
\vfill
\begingroup
\centering
{\usebeamercolor[fg]{titlegraphic}\inserttitlegraphic\par}
\vskip1em
\begin{beamercolorbox}[sep=8pt,center,#1]{title}
\usebeamerfont{title}\inserttitle\par%
\ifx\insertsubtitle\@empty%
\else%
\vskip0.25em%
{\usebeamerfont{subtitle}\usebeamercolor[fg]{subtitle}\insertsubtitle\par}%
\fi%
\end{beamercolorbox}%
\vskip1em\par
\begin{beamercolorbox}[sep=8pt,center,#1]{author}
\usebeamerfont{author}\insertauthor
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{institute}
\usebeamerfont{institute}\insertinstitute
\end{beamercolorbox}
\begin{beamercolorbox}[sep=8pt,center,#1]{date}
\usebeamerfont{date}\insertdate
\end{beamercolorbox}%
\endgroup
\vfill
}

\setbeamertemplate{title page}[mystyle]

\begin{document}

\frame{\titlepage}

\end{document}


Instead of the combo \defbeamertemplate + \setbeamertemplate you can use \defbeamertemplate* which will activate the new template directly.

As mentioned in this answer, you can pass option usepdftitle=false to beamer (\documentclass[usepdftitle=false,...]{beamer}). After that, \hypersetup{pdftitle=foo} should work as intended.