I think you'd have to make a new layout that lays out the pages RTL.
I change one line in the 2 on 1
layout from:
center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}%
to:
center=\pgfpoint{-.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
I'ts possible to do this with xpatch
:
\usepackage{xpatch}
\expandafter\xpatchcmd\csname pgfpages@layout@2 on 1\endcsname
{center=\pgfpoint{.75\pgfphysicalwidth}{.5\pgfphysicalheight}}
{center=\pgfpoint{-.25\pgfphysicalwidth}{.5\pgfphysicalheight}}
{}
{}
For the layouts with more pages per page, you'd need multiple calls to xpatchcmd
.
Full example:
\documentclass{article}
\usepackage[showframe]{geometry}
\usepackage{pgfpages}
\pgfpagesdeclarelayout{rtl 2 on 1}
{
\edef\pgfpageoptionheight{\the\paperwidth} % landscaped by default
\edef\pgfpageoptionwidth{\the\paperheight}
\def\pgfpageoptionborder{0pt}
\def\pgfpageoptionfirstshipout{1}
}
{
\pgfpagesphysicalpageoptions
{%
logical pages=2,%
physical height=\pgfpageoptionheight,%
physical width=\pgfpageoptionwidth,%
current logical shipout=\pgfpageoptionfirstshipout%
}
\ifdim\paperheight>\paperwidth\relax
% put side-by-side
\pgfpageslogicalpageoptions{1}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=\pgfphysicalheight,%
center=\pgfpoint{.25\pgfphysicalwidth}{.5\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{2}
{%
border shrink=\pgfpageoptionborder,%
resized width=.5\pgfphysicalwidth,%
resized height=\pgfphysicalheight,%
center=\pgfpoint{-.25\pgfphysicalwidth}{.5\pgfphysicalheight}% <- Shift second page to left hand side
}%
\else
% stack on top of one another
\pgfpageslogicalpageoptions{1}
{%
border shrink=\pgfpageoptionborder,%
resized width=\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.5\pgfphysicalwidth}{.75\pgfphysicalheight}%
}%
\pgfpageslogicalpageoptions{2}
{%
border shrink=\pgfpageoptionborder,%
resized width=\pgfphysicalwidth,%
resized height=.5\pgfphysicalheight,%
center=\pgfpoint{.5\pgfphysicalwidth}{.25\pgfphysicalheight}%
}%
\fi
}
\pgfpagesuselayout{rtl 2 on 1}[a4paper,border shrink=5mm,landscape]
\usepackage[bidi=basic-r,nil]{babel}
\babelprovide[import,main]{arabic}
\babelfont{rm}{Amiri}
\begin{document}
\Huge
نص من اليمين الى اليسار
الصفحة الأولى 1
\newpage
\Huge
نص من اليمين الى اليسار
الصفحة الثانية 2
\end{document}

2 on 1
layout that you have, what should the order of logical pages be on the physical page? In the image, you have Page 1 on the left with Page 2 on the right. With RTL, shouldn't it be the other way around?