2021-08-10 15:41:18 +02:00
|
|
|
# CHAPTER 9. Mulitpage facilities
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def twoUp(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Impose a document two up by retaining the existing page
|
|
|
|
size, scaling pages down."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def twoUpStack(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Impose a document two up by doubling the page size,
|
2021-08-10 15:41:18 +02:00
|
|
|
to fit two pages on one."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def padBefore(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Adds a blank page before each page in the given range."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def padAfter(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Adds a blank page after each page in the given range."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def padEvery(pdf, n):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Adds a blank page after every n pages."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def padMultiple(pdf, n):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Adds pages at the end to pad the file to a multiple of n pages in
|
|
|
|
length."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def padMultipleBefore(pdf, n):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Adds pages at the beginning to pad the file to a
|
2021-08-10 15:41:18 +02:00
|
|
|
multiple of n pages in length."""
|