# How to Include PDF as a Figure in Landscape Mode

I am trying to insert a single PDF page into LaTeX, but to also 1) have it in a figure and 2) have the page it is on be in landscape mode. (For the latter, see https://stackoverflow.com/questions/2524389/latex-including-a-landscape-pdf)

Here is something less than a MWE, but it should hopefully get the point across as the code is very simple:

\usepackage{pdfpages}
\usepackage{lscape}
...

\begin{landscape}
\begin{figure}
\caption{Title of the Figure}
\includepdf[landscape=true]{\dir/nameofpdf.pdf}
\end{figure}
\end{landscape}


The issue that I am running into is that the the Figure *: Title of the Figure caption does not appear at the top of the PDF figure, but smack dab in the middle.

I am open to other workarounds - I am not married to the packages/code that I have, but I would like to use a PDF, and have it be rotated and in landscape mode (including the caption).

Maybe you can use environment sidewaysfigure from package rotating:

\documentclass{article}
\usepackage{rotating}

\usepackage{mwe}% for dummy text and the example image
\begin{document}
\Blindtext
\begin{sidewaysfigure}
\caption{Title of the Figure}
\includegraphics[width=\textwidth]{example-image-a4-landscape}
\end{sidewaysfigure}
\Blindtext
\end{document}


You need to use pdflscape and include the image using the regular \includegraphics, not \includepdf from pdfpages.

\documentclass{article}

\usepackage{lipsum}
\usepackage{graphicx,pdflscape,float}

\newlength{\savetextdim}

\begin{document}

\lipsum[1-10]

\setlength{\savetextdim}{\textheight}%
\begin{landscape}
\begin{figure}[H]
\caption{Title of figure}
% Adjust the height dimension, if needed.
\includegraphics[width=\savetextdim,height=200pt]{example-image}
\end{figure}
\end{landscape}

\lipsum[1-10]

\end{document}


We set the figure inside a non-floating [H] environment. You can center it vertically by wrapping it with vertical fills. That is,

\begin{landscape}
\vspace*{\fill}

\begin{figure}[H]
\caption{Title of figure}
% Adjust the height dimension, if needed.
\includegraphics[width=\savetextdim,height=200pt]{example-image}
\end{figure}

\vfill
\end{landscape}