getting two A6 complete booklet sequences from an A4 page

倖福魔咒の 提交于 2020-01-02 19:19:07

问题


I have an a6 pdf book. I'd like to convert it to an a4 pdf so that when I print it, I can cut the a4 page in two (upside and downside will have the same content, so I'll end up with two copies of the book) and when putting together the pages, they can be read in sequence (I think this is called impose)

Supose A,B,C,D are 4 pages of the book. I want the resulting file to be:

DA
DA

and

CD
CD

Was I clear?

Sorry if I'm not using the correct terminology.


回答1:


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

  • http://minhateca.com.br/cixey/Documentos/Multivalent,584888318.jar(executable)
  • http://ge.tt/6fVll5H
  • http://dingodog.minus.com/mjhNX8Eiu (latest free version with tools included, current has no tools in itself)

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

  • http://ge.tt/92slb5Q/v/2 a pdf in A6 format, 16 pages long
  • http://ge.tt/92slb5Q/v/3 the resulting pdf output imposed with help of script above

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




回答2:


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



来源:https://stackoverflow.com/questions/13028724/getting-two-a6-complete-booklet-sequences-from-an-a4-page

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