odd_page = True
for page in pages_to_add:
if args.symmetry and odd_page:
- page.add_transformation(pypdf.Transformation().translate(tx=-crop_left, ty=-crop_bottom))
- else:
page.add_transformation(pypdf.Transformation().translate(tx=-crop_right, ty=-crop_bottom))
+ else:
+ page.add_transformation(pypdf.Transformation().translate(tx=-crop_left, ty=-crop_bottom))
page.add_transformation(pypdf.Transformation().scale(zoom, zoom))
page.mediabox.right = cropped_width * zoom
page.mediabox.top = cropped_height * zoom
page.add_transformation(pypdf.Transformation().translate(ty=(a4_height / zoom - (a4_height - crop_top))))
if i == 0 or i == 2:
if args.symmetry:
- page.add_transformation(pypdf.Transformation().translate(tx=-crop_right))
- else:
page.add_transformation(pypdf.Transformation().translate(tx=-crop_left))
+ else:
+ page.add_transformation(pypdf.Transformation().translate(tx=-crop_right))
elif i == 1 or i == 3:
- page.add_transformation(pypdf.Transformation().translate(tx=(a4_width / zoom - (a4_width - crop_right))))
+ if args.symmetry:
+ page.add_transformation(pypdf.Transformation().translate(tx=(a4_width / zoom - (a4_width - crop_left))))
+ else:
+ page.add_transformation(pypdf.Transformation().translate(tx=(a4_width / zoom - (a4_width - crop_right))))
page.add_transformation(pypdf.Transformation().scale(zoom * bonus_shrink_factor, zoom * bonus_shrink_factor))
if i == 2 or i == 3:
page.add_transformation(pypdf.Transformation().translate(ty=-2*printable_margin/printable_scale))