On Tue, 26 Aug 2014 21:03:19 +0100, Peter Flynn ci disse:
> Signatures must be 5 sheets of A3, with two A4 page-images on each side,
> so each signature folds to 20pp of A4. It's easy enough to select the
> pages in pdftk so that they can be printed double-sided, eg
>
> pdftk file.pdf cat 20 1 2 19 18 3 4 17 16 5 6 15 14 7 8 13 12 9 10 11
[...]
in case your document has many many pages (500 or more, for instance) it
is a very tedious task calculating manually the signatures, so this
shellscript can help you (I wrote for myself some time ago for the same
task)
so, if you have a 600 pages long document and you need to create 600/20=30
signatures, of 20 pages, you need to type, after saved the following
script in a file
named *signatures-maker*
for i in `seq 20 20 600`; do ./signatures-maker $i 20; done
you will have (in the first column with square brackets the progressive
number of signature: (since text can be wrapped, select and open in your
editor to see rightly)
1] 20 1 2 19 18 3 4 17 16 5 6 15 14 7 8 13 12 9 10 11
2] 40 21 22 39 38 23 24 37 36 25 26 35 34 27 28 33 32 29 30 31
3] 60 41 42 59 58 43 44 57 56 45 46 55 54 47 48 53 52 49 50 51
4] 80 61 62 79 78 63 64 77 76 65 66 75 74 67 68 73 72 69 70 71
5] 100 81 82 99 98 83 84 97 96 85 86 95 94 87 88 93 92 89 90 91
6] 120 101 102 119 118 103 104 117 116 105 106 115 114 107 108 113
112 109 110 111
7] 140 121 122 139 138 123 124 137 136 125 126 135 134 127 128 133
132 129 130 131
8] 160 141 142 159 158 143 144 157 156 145 146 155 154 147 148 153
152 149 150 151
9] 180 161 162 179 178 163 164 177 176 165 166 175 174 167 168 173
172 169 170 171
10] 200 181 182 199 198 183 184 197 196 185 186 195 194 187 188 193
192 189 190 191
11] 220 201 202 219 218 203 204 217 216 205 206 215 214 207 208 213
212 209 210 211
12] 240 221 222 239 238 223 224 237 236 225 226 235 234 227 228 233
232 229 230 231
13] 260 241 242 259 258 243 244 257 256 245 246 255 254 247 248 253
252 249 250 251
14] 280 261 262 279 278 263 264 277 276 265 266 275 274 267 268 273
272 269 270 271
15] 300 281 282 299 298 283 284 297 296 285 286 295 294 287 288 293
292 289 290 291
16] 320 301 302 319 318 303 304 317 316 305 306 315 314 307 308 313
312 309 310 311
17] 340 321 322 339 338 323 324 337 336 325 326 335 334 327 328 333
332 329 330 331
18] 360 341 342 359 358 343 344 357 356 345 346 355 354 347 348 353
352 349 350 351
19] 380 361 362 379 378 363 364 377 376 365 366 375 374 367 368 373
372 369 370 371
20] 400 381 382 399 398 383 384 397 396 385 386 395 394 387 388 393
392 389 390 391
21] 420 401 402 419 418 403 404 417 416 405 406 415 414 407 408 413
412 409 410 411
22] 440 421 422 439 438 423 424 437 436 425 426 435 434 427 428 433
432 429 430 431
23] 460 441 442 459 458 443 444 457 456 445 446 455 454 447 448 453
452 449 450 451
24] 480 461 462 479 478 463 464 477 476 465 466 475 474 467 468 473
472 469 470 471
25] 500 481 482 499 498 483 484 497 496 485 486 495 494 487 488 493
492 489 490 491
26] 520 501 502 519 518 503 504 517 516 505 506 515 514 507 508 513
512 509 510 511
27] 540 521 522 539 538 523 524 537 536 525 526 535 534 527 528 533
532 529 530 531
28] 560 541 542 559 558 543 544 557 556 545 546 555 554 547 548 553
552 549 550 551
29] 580 561 562 579 578 563 564 577 576 565 566 575 574 567 568 573
572 569 570 571
30] 600 581 582 599 598 583 584 597 596 585 586 595 594 587 588 593
592 589 590 591
============================================================
#!/bin/bash
#
# usage:
# for i in `seq 16 16 160`; do ./signatures-maker $i 16; done
# or:
# for i in `seq 32 32 160`; do ./signatures-maker $i 32; done
#
pages=$1
consecutivesheets=$2
if [ $(( $pages % 4 )) -eq 0 ]
then
pages4="$(( $pages-($consecutivesheets/2) ))"
first="$(( $pages-$consecutivesheets+1 ))"
#echo "first is $first"
for ((x=$pages, y=$first;x>=$pages4, y<=$pages4;x--, y++)); do echo "$x
$y"; done | awk 'NR %2==1 {print $1, $2} NR % 2==0 { print $2, $1 }' | tr
'\n' ' ' | xargs
elif
[ $(( $pages / 4 )) -eq 0 ]
then
#echo "number $pages is not a multiple of 4"
val0="$(( 4-$pages ))"
else val1="$(( $pages/4 ))"
#echo "number $pages is not a multiple of 4"
val2="$(( $val1+1 ))"
val3="$(( $val2*4 ))"
val4="$(( $val3-$pages ))"
blankandpages="$(( $pages+$val4 ))"
pages4="$(( $blankandpages/2 ))"
#echo "adding $val4 blank pages" ; sleep 1s
for ((x=$blankandpages, y=1;x>=$pages4, y<=$pages4;x--, y++)); do echo "$x
$y "; done | awk 'NR %2==1 {print $1, $2} NR % 2==0 { print $2, $1 }' | tr
'\n' ' '| xargs
fi
exit 0
=======================================================================
> I can't see how to make 20 and 1 into a single page of A3, 2 and 19
> into the next page, 10 and 3 into the next page, and so on, and output an
> A3 document.
[...]
"In many ways" (as Gandalf the Wizard said once to Bilbo and once again to
Frodo):
Mainly, you can use the power of
*Multivalent.jar"
- -
http://goo.gl/QGgvb (last free version with pdf tools included -
current Multivalent.jar hosted on sourceforge has no more pdf tools
inside)
you will pass to Multivalent the pdf file with pages reordered thaks to
pdftk (technically speaking: *shuffled for imposition*)
syntax:
java -cp path...to/Multivalent.jar tool.pdf.Impose -dim 2x1 -paper
42x29.7cm file.pdf
Impose tool will pick pages from pdf file with reordered pages, placing,
coupled, on an A3 horizontal sheet
this task, to say the truth, can be done also with the only Multivalent
tools (without pdftk, but I illustrated a way to obtain signatures of
pages automatically since you asked for a pdftk)
in fact Multivalent.jar can, at once, reorder and impose pages in
signatures:
syntax
assuming we want signatures of 20 pages (5 quarters) from a book of 100
pages:
java -cp path...to/Multivalent.jar tool.pdf.Impose -dim 2x1 -paper
42x29.7cm -verbose -layout
"20,1,2,19,18,3,4,17,16,5,6,15,14,7,8,13,12,9,10,11" file.pdf
sample input pdf file
-
http://snipr.com/297dd8c (short url)
-
http://www.pdfhost.net/index.php?
Action=Download&File=4687b84d2770bc5f67ab77e2322e9280
sample output with signatures of 20 pages (5 quarters) imposed in A3 format
-
http://snipr.com/297ddcq (short url)
-
http://www.pdfhost.net/index.php?
Action=Download&File=66070c985825e50daeb8aad18b9c5af1
as you can see, the 5 signatures are indeed:
20 1 2 19 18 3 4 17 16 5 6 15 14 7 8 13 12 9 10 11
40 21 22 39 38 23 24 37 36 25 26 35 34 27 28 33 32 29 30 31
60 41 42 59 58 43 44 57 56 45 46 55 54 47 48 53 52 49 50 51
80 61 62 79 78 63 64 77 76 65 66 75 74 67 68 73 72 69 70 71
100 81 82 99 98 83 84 97 96 85 86 95 94 87 88 93 92 89 90 91
the main advantage of Multivalent is its ability to add the needed blank
pages, if the total number of pages in pdf is not a multiple of choosen
signature
> Is this even possible?
[...]
it is possible as you can see
> or do I have to go back to using pstops?
[...]
no! it is a loss of time (and often of quality) passing from ps to return
to pdf from an existent pdf
--
Puppy Linux wiki:
http://dokupuppylinux.info
Puppy Linux Forum:
http://www.italianpuppy.org/
Windows me genuit, Ubuntu rapuere / tenet nunc Puppy Linux...
dropbox 2GB free -
http://db.tt/Vc6IeN4