[Tex/LaTex] get an extra white page before the TikZ picture

blank-pagegeometrylandscapepage-breakingtikz-pgf

I've created a little diagram in TikZ.
Only problem is, it's quite big, so I figured I should use landscape mode for it.

Only problem is, when I put it between

\begin{landscape}
\input{erd.tikz.tex} % my diagram
\end{landscape}

I get an extra white page before the diagram itself.

I can't seem to understand why, any idea?

Thanks.

Here is the document:

\documentclass[border=0.4in]{article}

\usepackage{tikz}
\usetikzlibrary{shapes.multipart}
\usetikzlibrary{matrix}
\usetikzlibrary{positioning}
\usetikzlibrary{calc}
\usepackage{scalefnt}
\usepackage{geometry}
\usepackage{pdflscape}

\makeatletter


\begin{document}

\section{Foo}
Foo bar bar bar foo, foo bar.
\newgeometry{left=2cm,bottom=3cm}
\begin{landscape}
\input{erd.tikz.tex}
\end{landscape}
\restoregeometry
\section{Zip}
Boom boom, zip.

\end{document}

Best Answer

use

\begin{landscape}
\resizebox{!}{0.95\textheight}{\input{erd.tikz.tex}}
\end{landscape}

The image is too big. The reason why it is placed on the following page.