cpdf-source/docsplits/pysplits/c10.tex

35 lines
1.2 KiB
TeX
Raw Normal View History

2022-01-23 14:06:53 +01:00
# CHAPTER 9. Multipage 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
2022-01-23 14:06:53 +01:00
def impose(pdf, x, y, fit, columns, rtl, btt, center, margin, spacing, linewidth):
"""impose(pdf, x, y, fit, columns, rtl, btt, center, margin, spacing,
linewidth) imposes a PDF. There are two modes: imposing x * y, or imposing
to fit a page of size x * y. This is controlled by fit. Columns imposes by
columns rather than rows. rtl is right-to-left, btt bottom-to-top. Center
is unused for now. Margin is the margin around the output, spacing the
spacing between imposed inputs."""
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."""