getting two A6 complete booklet sequences from an A4 page

做~自己de王妃 提交于 2019-12-06 06:31:27

as suggested, the mighty Multivalent tools are the solution, but they need to be combined with my Script I attach to perform the task you desire

USAGE:

2copiesinA4 filename.pdf multivalent relative path

it needs 2 arguments to be specified:

  • 1 argument is the filename with the pdf extension,
  • 2 argument is the multivalent relative path

for instance, if you have Multivalent.jar in /mnt/home/, this will be the relative path you need to pass to script.

#!/bin/bash
file=$1
multivalentpath=$2
pages="`pdftk $file dump_data | grep NumberOfPages | cut -d : -f2`"
echo $pages
halfpages="`echo -n $(( $pages / 2 ))`"
echo $halfpages
h="$(pdfinfo $file | grep "Page size" | cut -d x -f1 | tr 'Page size:' ' ' | xargs)"
w="$(pdfinfo $file | grep "Page size" | cut -d x -f2  | tr 'pts' ' ' | xargs)"
echo $h
echo $w
doubleheight="`let MULTIPLICATION=$h*2; echo $MULTIPLICATION`"
doublewidth="`let MULTIPLICATION=$w*2; echo $MULTIPLICATION`" 
echo $doubleheight
echo $doublewidth
sequence="`for ((x=$pages, y=1;x>=$halfpages, y<=$halfpages;x--, y++)); do echo "$x $y "; done | awk 'NR %2==1 {print $1, $2, $1, $2 } NR % 2==0 { print $2, $1, $2, $1 }' | xargs | tr " " ","`"
echo $sequence
java -cp "$multivalentpath"Multivalent.jar tool.pdf.Impose -verbose -dim 2x2 -paper "$doubleheight"x"$doublewidth"pt -page "$sequence" $file
exit 0

STEPS

1. download latest free version of Multivalent with tools inside

Multivalent

put it somewhere on disk, take in mind its relative path


2. copy the script above in one file and allow to execute (you can name this file 2copiesina4.sh) and start script

IMPORTANT: CHECK CAREFULLY THAT YOUR PDF HAS A NUMBER OF PAGES *INTEGER MULTIPLE OF 4** (like 4,8, 12, 16...a nd so on)

I uploaded some sample files

the resulting IMPOSED file looks like this (see gif animation

STEP 3

once printing finished, you will have the last page that becomes the FIRST of mass of sheet papers you printed

you will cut this papers once in center of paper (at 14.8 cm) on ** A4 long edge** to separate the two block forming the 2 copies of book

and then cut again the two sheet papers blocks to be able to close every resulting sublock on another to have the book with the sequential pages order

NOTE

this is a REDUPLICATION of work normally done to get a so-called booklet (an A5 portrait book, printed 2 pages for sheet on an A4 landscape paper) Obviously, as in our case, the same can be done for an A6 book intended to be printed on A4 to get 2 copies of whole same book, modifying some thing but with the same logic

imposition sequence, needs that sequence of pages will be this:

last - first, second - penultimate, ante-penultimate -third ... and so on...

for a 16 pages book, the imposition sequence will be:

16 1, 2 15, 14 3, 4 13, 12 5, 6 11, 10 7, 8 9

in our case, since we want get TWO COMPLETE COPIES of same book on an A4 paper, we repeated this sequence two times in same sheet

I also developed a way to get ONE SINGLE A6 booklet copy, for my personal needs, on an A4 paper, if you need ONLY ONE A6 copy of your book printed using A4 sheet papers

You want to "impose" your PDF pages , multivalent can do that http://multivalent.sourceforge.net/Tools/pdf/Impose.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!