Folio size reporting
This commit is contained in:
parent
1e97bb23cb
commit
eaf3acd4f5
1 changed files with 12 additions and 0 deletions
12
foliator.py
12
foliator.py
|
|
@ -88,11 +88,23 @@ def foliate_A6(input_pdf, strat_func, max_folio_size, append_to=PdfWriter()):
|
|||
|
||||
folio_page_size = 0
|
||||
current_page = 0
|
||||
|
||||
print("Folio sizes, in order")
|
||||
old_l = L[0]
|
||||
old_l_run = 0
|
||||
for l in L:
|
||||
if l != old_l:
|
||||
print(old_l, "a5 sheet(s), x", old_l_run)
|
||||
old_l = l
|
||||
old_l_run = 1
|
||||
else:
|
||||
old_l_run += 1
|
||||
|
||||
# l is a number of _sheets_, each containing 4 pages
|
||||
folio_page_size = min(doc_length - current_page, 4*l)
|
||||
append_folio_A6(input_pdf, current_page, folio_page_size, append_to)
|
||||
current_page += folio_page_size
|
||||
print(old_l, "a5 sheet(s), x", old_l_run)
|
||||
|
||||
return writer
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue