[Tex/LaTex] A new blank page is created bofore the plot when inserting a plot into a landscape page using pdflscape

pdflscape

I am inserting a picture into a file. To make the page landscape, I used the "pdflscape" package, but it creates a blank page before the plot.

\documentclass{article}
\usepackage{pdflscape}
\begin{document}    
  \begin{landscape} 
    \includegraphics{1.png}
  \end{landscape}   
\end{document}

How can I get rid of the blank page?

Best Answer

No, packages pdflscape and lscape do not insert blank pages (they only start new pages). But TeX might do, if the object is too large to fit on the page. Check your .log file for overfull \vbox messages.

The following example increases the image as much as possible and ignores rounding errors that could cause overfull \vbox messages:

\documentclass{article}
\usepackage{pdflscape}
\usepackage{graphicx}
\usepackage{picture}
\begin{document}
  \begin{landscape}
    \centering
    \makebox(\linewidth,\textheight){%
      \includegraphics[
        width=\linewidth,
        height=\textheight,
        keepaspectratio
      ]{1.png}%
    }%
  \end{landscape}
\end{document}
Related Question