As a follow-up, just in case someone will search the archive for a
similar problem, this is my “solution”, regardless of the question if
the imposition scheme is really suitable for binding or not. It's quite
an hack, but it seems to work and is way simpler for a profane like me
to create a custom imposition schema (code below). I dropped the
ConTeXt-based solution with layers because of the amount of work
required to bootstrap it.

As a side note, I stumbled in a psutils bug (no surprise, the version on
the CTAN is *12* years old), where the %%BoundingBox and %%DocumentMedia
header where inserted correctly, but the original preserved, leading to
viewer (and even printer?) to believe the PS had still the old
dimensions (so I removed them with sed before passing it to pstops).

Cheers

#!/bin/bash

set -e
set -o pipefail
# avoid to use polluted path, or the debug will be impossible
export PATH=/usr/bin:/bin

# the input document should have exactly the width set to half of
# this, and the height set to half too, which means 16cmx22cm. Paper
# is 32cm x 44cm
width=907
height=1247

# usual check
if [ ! -f "$1" ]; then
    echo "$1 is not a file, exiting"
    exit
fi

# naming convention
input=$1
output=${input%%.pdf}-imposed.pdf

# the scheme: U means rotated 180°, the parens indicate the shifting
# after the rotation. We use the w and h flag to avoid math :-)
# pages are numbered from 0.

p1="15(0,0)+0(0.5w,0)+12U(0.5w,1h)+3U(1w,1h)"
p2="1(0,0)+14(0.5w,0)+2U(0.5w,1h)+13U(1w,1h)"
p3="11(0,0)+4(0.5w,0)+8U(0.5w,1h)+7U(1w,1h)"
p4="5(0,0)+10(0.5w,0)+6U(0.5w,1h)+9U(1w,1h)"


# the sed string is needed to avoid a broken DSC

pdftops -level3 "$input" - | \
    sed -e '/^%%BoundingBox:/d' -e '/^%%DocumentMedia:/d' | \
    pstops -b -w$width -h$height \
    "16:$p1,$p2,$p3,$p4" | \
    ps2pdf -dPDFSETTINGS=/prepress \
    -dDEVICEWIDTHPOINTS=$width -dDEVICEHEIGHTPOINTS=$height \
    - "$output"
pdfinfo "$output"
pdffonts "$output"
echo "$input => $output"
exit 0

-- 
Marco

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to