parser.add_argument("-n", "--nup4", dest="nup4", action='store_true', help="puts 4 input pages onto 1 output page")
parser.add_argument("-a", "--analyze", dest="analyze", action="store_true", help="print lines identifying spine, page borders")
parser.add_argument("-t", "--symmetry", dest="symmetry", action="store_true", help="alternate horizontal crops between odd and even pages")
-parser.add_argument("-r", "--rotate", dest="rotate", help="rotate page of number by 90°")
+parser.add_argument("-r", "--rotate", dest="rotate", type=int, action="append", help="rotate page of number by 90° (usable multiple times on same page!)")
parser.add_argument("-m", "--margin", type=float, default=4.3, help="print margin (default 4.3)")
args = parser.parse_args()
# rotate page canvas
if args.rotate:
- page = pages_to_add[int(args.rotate) - 1]
- page.add_transformation(pypdf.Transformation().translate(tx=-a4_width/2, ty=-a4_height/2))
- page.add_transformation(pypdf.Transformation().rotate(-90))
- page.add_transformation(pypdf.Transformation().translate(tx=a4_width/2, ty=a4_height/2))
+ for rotate in args.rotate:
+ page = pages_to_add[rotate - 1]
+ page.add_transformation(pypdf.Transformation().translate(tx=-a4_width/2, ty=-a4_height/2))
+ page.add_transformation(pypdf.Transformation().rotate(-90))
+ page.add_transformation(pypdf.Transformation().translate(tx=a4_width/2, ty=a4_height/2))
# normalize all pages to portrait A4
for page in pages_to_add: