forked from benkuhn/carols
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmake_booklet.py
More file actions
executable file
·36 lines (27 loc) · 901 Bytes
/
make_booklet.py
File metadata and controls
executable file
·36 lines (27 loc) · 901 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#! /usr/bin/env python
"""
Command line util that, given a path to a pdf (input file), interleaves the
pages in the order needed to make a booklet, saving the result as
<output_file>.pdf. (You should then print this document with 2 pages per sheet.)
"""
import argparse
from utils import make_booklet
def argument_parser():
parser = argparse.ArgumentParser()
parser.add_argument(
'input_file',
type=str,
help='path of pdf to booklet-ify'
)
parser.add_argument(
'--output_file',
type=str,
default='booklet',
help='name of the file to write output to (<output_file>.pdf)'
)
return parser
if __name__ == '__main__':
parser = argument_parser()
args = parser.parse_args()
make_booklet(args.input_file, args.output_file)
print('Successfully wrote to file: {}.pdf'.format(args.output_file))