# How to rotate page in pdf viewer without xetex?

I want to rotate page with large figure in pdf viewer and it works only in xetex.

I found many similar questions and tried answers here but no one works as expected for me. There happen unwanted page breaks, to much pages are rotated, wrong page is rotated, page is converted to landscape, etc...

So how?

\documentclass{article}
\usepackage{ifxetex}
\usepackage{blindtext}
\usepackage[figuresleft]{rotating}
\usepackage{graphicx}

\begin{document}
\Blindtext END ONE

\Blindtext END TWO

\begin{figure}
\ifxetex
% this works with xetex
\special{pdf: put @thispage <</Rotate 90>>}%
\else
% so how to rotate page for luatex, pdftex, etc...?
\fi
\begin{sideways}
\resizebox{!}{\textwidth}{\includegraphics{example-image-a}}
\end{sideways}
\caption{Example}
\end{figure}

\Blindtext END THREE

\Blindtext END FOUR

\end{document}

• \pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90} or Rotate 270 depended if doublesided and the orientation you wish to have. – koleygr Feb 18 at 14:03
• See the pdflscape package. – John Kormylo Feb 18 at 16:45
• – Ulrike Fischer Feb 18 at 18:28
• Solution from above link works and that's great. But does it have to be so complicated in comparison to single line command with xetex? Any way to simplify it? – Simon Feb 18 at 20:01