Goal
I created a twoside document, that contains some sidewaysfigures (using the package rotating). I would like these pages to be shown rotated in the PDF viewer, without affecting the printing. It should be one PDF file that can be used for reading and printing.
Research
- Question with different goal: How to change certain pages into landscape/portrait mode
lscapedoes not work well withtwoside
- Question with similar goal, but without the printing aspect: Rotate single PDF page when viewing
- odd page:
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90} - even page:
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 270}
- odd page:
Current Approach
I created a MWE with one image on page 3 (odd) and a second image on page 6 (even).
MWE
\documentclass[a4paper, 11pt, twoside]{scrbook}
\usepackage{lipsum}
\usepackage{rotating}
\newenvironment{mysidewayspage}{%
\clearpage%
\Ifthispageodd{%
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 270}%
}{%
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 90}%
}
}{%
\clearpage%
\global\pdfpageattr\expandafter{\the\pdfpageattr/Rotate 0}%
}
\begin{document}
\lipsum[1-8]
\begin{mysidewayspage}
\begin{sidewaysfigure}[htb]
\centering
\includegraphics[height=.6\textwidth, keepaspectratio]{example-image}
\caption{Example Image}
\end{sidewaysfigure}
\end{mysidewayspage}
\lipsum[5-15]
\begin{mysidewayspage}
\begin{sidewaysfigure}[htb]
\centering
\includegraphics[height=.6\textwidth, keepaspectratio]{example-image}
\caption{Example Image}
\end{sidewaysfigure}
\end{mysidewayspage}
\lipsum[16-20]
\end{document}
Result
The result is correctly shown in the viewer (Adobe Reader).
Problem with Printing
When printing this (or viewing the preview for 2 on 1), the rotated odd page 3 will be correctly arranged:
But the rotated even page 6 is upside down:
Question
Is there a solution to show rotated pages in landscape mode only for the PDF view without affecting the printing, so one PDF file can be used for both cases?
There might be some viewer-depend behavior, but a solution that work for the default viewers would be good (esp. Adobe Reader).



/Rotate 90/Rotate 0/Rotate 270in a page (but I don't if the printer will behave if you correct that.) – Ulrike Fischer Oct 24 '23 at 21:20\pdfpageattr{/Rotate 270}etc., the printing problem remains. – dexteritas Oct 24 '23 at 21:39sidewaysfigurerotates the images so that they can be read from the edge of the book. I think this is common and useful for printed books. You can see that the whole page is rotated 180° here by the page number. If I print the document double-sided, then suddenly one page would be the wrong way around. – dexteritas Oct 25 '23 at 11:00