From: Christian Heller Date: Sat, 23 Sep 2023 22:00:01 +0000 (+0200) Subject: To Bookmaker, add margin definition. X-Git-Url: https://plomlompom.com/repos/%7B%7Bdb.prefix%7D%7D/%7B%7B%20web_path%20%7D%7D/pick_tasks?a=commitdiff_plain;h=991ded8d059e5b05f112a2b783e3d8263b7c14f6;p=misc To Bookmaker, add margin definition. --- diff --git a/bookmaker.py b/bookmaker.py index 0e35820..2e5085f 100755 --- a/bookmaker.py +++ b/bookmaker.py @@ -15,6 +15,7 @@ parser.add_argument("-a", "--analyze", dest="analyze", action="store_true", help parser.add_argument("-t", "--symmetry", dest="symmetry", action="store_true", help="alternate horizontal crops between odd and even pages") parser.add_argument("-s", "--second", dest="second", help="append second file as input to append") parser.add_argument("-r", "--rotate", dest="rotate", help="rotate page of number by 90°") +parser.add_argument("-m", "--margin", type=float, default=4.3, help="print margin (default 4.3)") args = parser.parse_args() with open(args.input_file, 'rb') as file: @@ -96,7 +97,7 @@ with open(args.input_file, 'rb') as file: else: n_pages_per_axis = 2 points_per_mm = 2.83465 - printable_margin = 4.3 * points_per_mm + printable_margin = args.margin * points_per_mm printable_scale = (a4_width - 2*printable_margin)/a4_width spine_limit = 10 * points_per_mm half_width = a4_width / n_pages_per_axis