# Pdfpages insert always the same on a specific position

Suppose I have a document containing A n pages an another one (B) containing one page. How can I use pdfpages to create a landscape document has on the ith page the ith page of A on the left and B on the right, i.e.

1 page: page 1 of A, B
2 page: page 2 of A, B
3 page: page 3 of A, B
etc.

The solution should update automatically if n changes.

This doesn't use pdfpages, but I think it does what you ask. lipsum.pdf was a PDF containing just some \lipsum text, replace with your file A.

\documentclass{article}
\usepackage[
a4paper,
landscape,
showframe% show text area
]{geometry}
\usepackage{graphicx}
\usepackage{pgffor} % for foreach
% get page count from PDF
% cf. e.g. https://tex.stackexchange.com/questions/8316
\pdfximage{lipsum.pdf}
\def\nbframes{\the\pdflastximagepages}
\begin{document}
\pagestyle{empty}
\foreach \i in {1,2,...,\nbframes}
{%
\includegraphics[page=\i,width=0.47\linewidth,valign=c]{lipsum}\hfill
\includegraphics[width=0.47\linewidth,valign=c]{example-image}%
\newpage
}
\end{document}