# Extra blank page is at end of the pdf when use vertical text using tikz

I need some text in the left and right side of the pdf vertically so I use the following code but an extra blank page appears and end please help.

\documentclass[twoside]{article}
\usepackage{lipsum}
\usepackage{atbegshi}
\usepackage{tikz}
\usepackage{etoolbox}
\usepackage{xhfill}

\usepackage[paperheight=9.75in,paperwidth=7.25in]{geometry}
\begin{document}
%\makebox[2em]{\xdotfill{.4pt}}

\newcommand{\LeftSideBar}{
\begin{tikzpicture}[remember picture,overlay]
\draw[fill,color=orange]
([xshift=1cm,yshift=0cm]current page.south west) rectangle ([xshift=0cm,yshift=0cm]current page.north west);
\node [rotate=90] at ([xshift=1.2cm,yshift=7cm]current page.west) {\sffamily\bfseries\resizebox{!}{0.5cm}{\color{black}{\LeftSideText}}$\cdots$};%
\end{tikzpicture}
}%

\newcommand{\RightSideBar}{
\begin{tikzpicture}[remember picture,overlay]
\draw[fill,color=white]
([xshift=-1cm,yshift=0cm]current page.south east) rectangle ([xshift=0cm,yshift=0cm]current page.north east);
\node [rotate=90] at ([xshift=-2cm,yshift=7cm]current page.east) {\sffamily\bfseries\resizebox{!}{0.5cm}{\color{black}{\RightSideText}}$\cdots$};%
\end{tikzpicture}

\AtBeginShipout{
\ifnumodd{\thepage}{\LeftSideBar}{\RightSideBar}
}

\lipsum[1-20]
\end{document}


The problem is that the command you are using puts the stuff on the next page, which is why there one more page appeared. I openly admit that I was too lazy to look up the "correct" command in atbegshi. However, if I use eso-pic, which is based on atbegshi, and for which I know the "correct" command, the problem does not appear.

\documentclass[twoside]{article}
\usepackage{lipsum}
\usepackage{eso-pic}
\usepackage{tikz}
%\usepackage{etoolbox}
%\usepackage{xhfill}
\usepackage[paperheight=9.75in,paperwidth=7.25in]{geometry}

\newcommand{\LeftSideBar}{%
\begin{tikzpicture}[remember picture,overlay]
\draw[fill,color=orange]
([xshift=1cm,yshift=0cm]current page.south west) rectangle ([xshift=0cm,yshift=0cm]current page.north west);
\node [rotate=90] at ([xshift=1.2cm,yshift=7cm]current page.west) {\sffamily\bfseries\resizebox{!}{0.5cm}{\color{black}{\LeftSideText}}$\cdots$};%
\end{tikzpicture}}%

\newcommand{\RightSideBar}{%
\begin{tikzpicture}[remember picture,overlay]
\draw[fill,color=white]
([xshift=-1cm,yshift=0cm]current page.south east) rectangle ([xshift=0cm,yshift=0cm]current page.north east);
\node [rotate=90] at ([xshift=-1cm,yshift=2cm]current page.east)
{\sffamily\bfseries\resizebox{!}{0.5cm}{\color{black}{\RightSideText}}$\cdots$};%

\begin{document}
%\makebox[2em]{\xdotfill{.4pt}}

\ifnum\number\value{page}>1
\ifodd\number\value{page}%
\LeftSideBar%
\else%
\RightSideBar%
\fi%
\fi}

\lipsum[1-20]
\end{document}


• In the First page did not need the vertical text. – Shalu Apr 4 at 17:10
• @Shalu I removed it. – user121799 Apr 4 at 17:17