2021-08-10 15:41:18 +02:00
|
|
|
# CHAPTER 17. Miscellaneous
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def draft(pdf, r, boxes):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove images on the given pages, replacing
|
|
|
|
them with crossed boxes if 'boxes' is True."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def removeAllText(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove all text from the given pages in a document."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def blackText(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Blacken all text on the given pages."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def blackLines(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Blacken all lines on the given pages."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def blackFills(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Blacken all fills on the given pages."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def thinLines(pdf, r, linewidth):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Thicken every line less than
|
|
|
|
linewidth to linewidth. Thickness given in points."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def copyId(pdf, pdf2):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Copy the /ID from one pdf to pdf2."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def removeId(pdf):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove a document's /ID"""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def setVersion(pdf, version):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Set the minor version number of a document."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def setFullVersion(pdf, major, minor):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Set the major and minor version number of
|
2021-08-10 15:41:18 +02:00
|
|
|
a document."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def removeDictEntry(pdf, key):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove any dictionary entry with the given
|
|
|
|
key anywhere in the document."""
|
2021-07-26 20:50:33 +02:00
|
|
|
|
2022-01-23 14:06:53 +01:00
|
|
|
def removeDictEntrySearch(pdf, key, searchterm):
|
|
|
|
"""Remove any dictionary entry with the given
|
|
|
|
key anywhere in the document, if its value matches the given search term."""
|
|
|
|
|
|
|
|
def replaceDictEntry(pdf, key, newvalue):
|
|
|
|
"""Replace any dictionary entry with the given
|
|
|
|
key anywhere in the document using the new value given."""
|
|
|
|
|
|
|
|
def replaceDictEntrySearch(pdf, key, newvalue, searchterm):
|
|
|
|
"""Replace any dictionary entry with the given key anywhere in the
|
|
|
|
document, if its value matches the given search term, with the new value
|
|
|
|
given."""
|
|
|
|
|
|
|
|
def getDictEntries(pdf, key):
|
|
|
|
"""Return JSON of any dict entries with the given key."""
|
|
|
|
|
2021-08-10 15:41:18 +02:00
|
|
|
def removeClipping(pdf, r):
|
2021-09-01 19:41:10 +02:00
|
|
|
"""Remove all clipping from pages in the given range"""
|