Dadas as sugestões de Anthon , acompanhei este script. A idéia principal era primeiro exportar o pdf de volta para o svg-simples, compor o svg e exportá-lo como pdf novamente. Os tamanhos A4 são codificados, mas podem ser alterados no script.
#!/bin/bash
# If you modify/extend this script, it'd be cool if you post your improvements on
# https://unix.stackexchange.com/q/177263/9495
# This is A4 size
TARGET_WIDTH=744.09003
TARGET_HEIGHT=1052.3622
ext=".a4_4x3.pdf"
draw_border="1" # set to 0 to deactivate borders
TEMP_DIR="$(mktemp -d)"
pdftk A="$1" cat Aeast output "$TEMP_DIR/rot.pdf"
inkscape --export-plain-svg="$TEMP_DIR/rot.plain.svg" "$TEMP_DIR/rot.pdf"
psvg="$(cat "$TEMP_DIR/rot.plain.svg" | tr '\t' ' ' | tr -d '\n' | sed 's/</\n</g; s/>/>\n/g' | grep '.')"
W="$(echo "$psvg" | sed -n 's/^.*width="\([0-9.]\+\)".*$//p' | head -n 1)"
H="$(echo "$psvg" | sed -n 's/^.*height="\([0-9.]\+\)".*$//p' | head -n 1)"
orig_g="$(echo "$psvg" | sed -n '/^<g/,$p' | sed '$,$d')"
if [ "$draw_border" = "1" ]; then
main_g="$(echo '<rect style="stroke-width:1px; stroke:#000000; fill:#ffffff" width="'"$W"'" height="'"$H"'" />'; echo "$orig_g")"
else
main_g="$orig_g"
fi
husk_open="$(echo "$psvg" | sed '/^<g/,$d' \
| sed "s/width=\"$W\"/width=\"$TARGET_WIDTH\"/"\
| sed "s/height=\"$H\"/height=\"$TARGET_HEIGHT\"/")"
husk_close="</svg>"
move_right () {
echo "<g transform=\"translate($W,0)\">"
cat
echo "</g>"
}
move_down () {
echo "<g transform=\"translate(0,$H)\">"
cat
echo "</g>"
}
mk_row () {
echo "$1"
echo "$1" | move_right
echo "$1" | move_right | move_right
echo "$1" | move_right | move_right | move_right
}
mk_all () {
mk_row "$1"
mk_row "$1" | move_down
mk_row "$1" | move_down | move_down
}
margin_L="$(python -c "print ($TARGET_WIDTH - 4*$W)/2.")"
margin_H="$(python -c "print ($TARGET_HEIGHT - 3*$H)/2.")"
(
echo "$husk_open"
echo "<g transform=\"translate($margin_L,$margin_H)\">"
mk_all "$main_g"
echo "</g>"
echo "$husk_close"
) | tr -d '\n' > "$TEMP_DIR/out.svg"
inkscape --export-pdf="$1$ext" "$TEMP_DIR/out.svg"
rm -r "$TEMP_DIR"