implement strategy selection
This commit is contained in:
parent
6566830258
commit
1e97bb23cb
1 changed files with 6 additions and 0 deletions
|
|
@ -138,9 +138,15 @@ parser.add_argument("-a5", help="output as a5, reverse on short edge",
|
||||||
action="store_true")
|
action="store_true")
|
||||||
parser.add_argument("-fs", help="maximum folio size, in sheets",
|
parser.add_argument("-fs", help="maximum folio size, in sheets",
|
||||||
action="store", default=-1, type=int)
|
action="store", default=-1, type=int)
|
||||||
|
parser.add_argument("--strategy", help="greedy packing of pages into folios",
|
||||||
|
action="store", default="balanced")
|
||||||
|
|
||||||
|
stratnames_dict = {"balanced": find_partition_mink, "greedy": find_partition_greedy}
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
input_pdf = PdfReader(args.infile)
|
input_pdf = PdfReader(args.infile)
|
||||||
|
strategy = stratnames_dict[args.strategy]
|
||||||
a5 = foliate_A6(input_pdf, find_partition_greedy, args.fs)
|
a5 = foliate_A6(input_pdf, find_partition_greedy, args.fs)
|
||||||
if (args.a5):
|
if (args.a5):
|
||||||
a5.write(args.outfile)
|
a5.write(args.outfile)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue