I'm creating a beamer document in that several PDF documents get included by a python script. To keep the style of the slides and including the PDFs I'm using the \includepdf like that:
\setbeamercolor{background canvas}{bg=}
\includepdf[pages={1-},width = 0.9\\textwidth,pagecommand={}]{*Path}
The *Path gets replaced with the PDF name by the python script. The problem is, that the page numbers are not getting updated with the added PDFs.
On the other hand I found at: Base document page numbers with pdfpages
A way to add the page numbers with:
\includepdf[pages=-,pagecommand=\thispagestyle{plain}]{filename}
But in that case my header and footer get lose.
Does someone as an idea how to combine both?
Greetings
Stefan
EDIT
A (hopefully) MWE that shows my problem:
\documentclass{beamer}
\mode<presentation>
{
\usetheme{Warsaw}
}
\usepackage[ngerman]{babel}
\usepackage{pdfpages}
%%---------FootLine------------------------
\setbeamertemplate{footline}
{%
\centering
\begin{tabular*}{\textwidth}{l@{\extracolsep\fill}c c c c}
\hline
& & & \\
& \insertshorttitle & \today & {\insertframenumber}
\end{tabular*}
}
\setbeamertemplate{headline}
{
\leavevmode%
\hbox{%
\hspace{2em}
\begin{beamercolorbox}[wd=\paperwidth,ht=8.25ex,dp=3.5ex]{}%
\raggedright
\vbox to 7.25ex{\vfil\hbox{\sffamily\Large\color{orange}\insertsection}\vfil}\\
\vbox to0.25ex{\vfil\hbox{\sffamily\Large\color{orange}\insertsubsection}\vfil}
\end{beamercolorbox}%
}%
}
\setbeamertemplate{frametitle}
{\vskip-3pt
\leavevmode
\hbox{%
\begin{beamercolorbox}[wd=\paperwidth,ht=1.6ex,dp=1ex]{black_white}%
\raggedright
\hspace*{2em}
{\normalsize\insertframetitle}
\end{beamercolorbox}
}%
}
\begin{document}
\section*{First Section}
\begin{frame}
Hello1
\end{frame}
\newpage
\begin{frame}
Hello2
\end{frame}
\section*{PDF Test}
\setbeamercolor{background canvas}{bg=}
\includepdf[pages={-},width=0.9\textwidth,pagecommand={}]{test.pdf}
\end{document}