Two-sided printing of A6 pages on A4 paper

book-designdouble-sidedpdfpagesprinting

I have a document, 78 pages long formatted into a6 paper size. I need to print those pages onto a4 sized paper, double sided.

SAMPLE LAYOUT BEGINS:
https://i.stack.imgur.com/rIyGB.png
SAMPLE LAYOUT ENDS

EDIT 2 begins:

In this way, if each of the 78 pages can be printed on both sides of an A4 paper, I can fold, cut and stack many such sheets (which are now in A6 size) and bind them together. This is my idea. NOTE: (inv) means inverted.

Another Question: What should be done to implement signatures in these A4-turned-into-A6 books? In the case of A5 books, that is very easy.

EDIT 2 ends

I went through the following links:

  1. Print eight A6 pages on one two-sided A4 sheet in a book folding order

  2. Print A6 book on A4 double-sided in correct order

  3. Duplicate A6 booklets on A4 paper

EDIT BEGINS

  1. Links (1) and (3) discuss about printing "duplicate" A6 pages on both sides of an A4 page. But I need a solution for printing a singular A6 book of 78 pages on A4 paper "Both sides".

  2. Link (2): More closer to my need. But only "eight" A6 pages are considered. How can I extend the code to 78 pages?

I'm not sure if the solution posted by @AndrewStacey in Print A6 book on A4 double-sided in correct order can be used for a bigger book also. If he or someone can clarify this point, it will be nice. It will also be nice if the code provided in the answer of Print A6 book on A4 double-sided in correct order be commented/explained in detail so that anyone can follow it. Example Doubt: I am not able to understand where I should specify my A6 PDF file in the code.

EDIT ENDS

I have made the following MWE that achieves the desired result for 1-sided printing. But how can we achieve 2-sided printing so that I can later cut, fold and bind the pages to form a A6 sized book?

\documentclass[a4paper]{article}
\usepackage[pdftex]{color,graphicx,epsfig}
\usepackage[margin=0in]{geometry}
\usepackage[final]{pdfpages}
\begin{document}
\includepdf[pages=-,nup=2x2,landscape=false,frame,noautoscale=true]{a6sized-doc.pdf}
\end{document}

Please edit my question/tages for clarity.

Best Answer

Here's an adaptation of the answer given at Print A6 book on A4 double-sided in correct order. It changes the order and turns the required pages upside-down. Each set of 8 pages gets printed onto two pages according to the specified layout. The code is meant to be put into the preamble of the original document (in place of all the \dopage stuff in the below), so there's only one tex document here.

\documentclass{article}
%\url{https://tex.stackexchange.com/q/638802/86}
%Adapted from \url{http://tex.stackexchange.com/q/279042/86}
\usepackage{pgfmorepages}

\pgfpagesdeclarelayout{8 on 2, book format}
{%
  \edef\pgfpageoptionheight{\the\paperheight}
  \edef\pgfpageoptionwidth{\the\paperwidth}
  \def\pgfpageoptionborder{0pt}
  \def\pgfpageoptionfirstshipout{1}
}%
{%
  \pgfpagesphysicalpageoptions
  {%
    logical pages=8,%
    physical pages=2,%
    physical height=\pgfpageoptionheight,%
    physical width=\pgfpageoptionwidth,%
    current logical shipout=\pgfpageoptionfirstshipout%
  }
  \pgfpagesphysicalpage{1}{}
    \pgfpageslogicalpageoptions{1}
  {%
    rotation=180,
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}%
    }%
    \pgfpageslogicalpageoptions{8}
  {%
    rotation=180,
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}%
    }%
    \pgfpageslogicalpageoptions{4}
    {%
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight},%
    }%
    \pgfpageslogicalpageoptions{5}
    {%
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight},%
    }%
  \pgfpagesphysicalpage{2}{}
    \pgfpageslogicalpageoptions{7}
    {%
      rotation=180,
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.25\pgfphysicalwidth}{.75\pgfphysicalheight}%
    }%
    \pgfpageslogicalpageoptions{2}
    {%
      rotation=180,
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.75\pgfphysicalwidth}{.75\pgfphysicalheight}%
    }%
    \pgfpageslogicalpageoptions{6}
    {%
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.25\pgfphysicalwidth}{.25\pgfphysicalheight},%
    }%
    \pgfpageslogicalpageoptions{3}
    {%
      border shrink=\pgfpageoptionborder,%
      resized width=.5\pgfphysicalwidth,%
      resized height=.5\pgfphysicalheight,%
      center=\pgfpoint{.75\pgfphysicalwidth}{.25\pgfphysicalheight},%
    }%
}


\pgfpagesuselayout{8 on 2, book format}

\newcommand\dopage{%
\noindent\resizebox{.99\linewidth}{!}{Page \thepage}
  \newpage}

\begin{document}
% The document goes here
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\dopage\dopage
\end{document}

First page Second page Third page Fourth page

(The different sizes of the text is due to the fact that on each page it is resized to the width of the page, but then that means that Page 1 and Page 11 resize by different scale factors.)