From 11228cb61ff01daa8074f829598bd2b4102a9617 Mon Sep 17 00:00:00 2001 From: John Whitington Date: Tue, 16 Apr 2024 10:14:14 +0800 Subject: [PATCH] Add section 20 to python docs --- cpdfmanual.tex | 2 +- docsplits/pysplits/c20.tex | 57 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 docsplits/pysplits/c20.tex diff --git a/cpdfmanual.tex b/cpdfmanual.tex index 303b972..ed26ba8 100644 --- a/cpdfmanual.tex +++ b/cpdfmanual.tex @@ -5437,7 +5437,7 @@ $ cpdf -extract-stream-decompress 2 hello.pdf -stdout \clearpage \section*{Python Interface} \begin{small}\tt -\lstinputlisting{pysplits/c19} +\lstinputlisting{pysplits/c20} \end{small} \end{pycpdflib} diff --git a/docsplits/pysplits/c20.tex b/docsplits/pysplits/c20.tex new file mode 100644 index 0000000..f3839b2 --- /dev/null +++ b/docsplits/pysplits/c20.tex @@ -0,0 +1,57 @@ +# CHAPTER 18. Miscellaneous + +def draft(pdf, r, boxes): + """Remove images on the given pages, replacing + them with crossed boxes if 'boxes' is True.""" + +def removeAllText(pdf, r): + """Remove all text from the given pages in a document.""" + +def blackText(pdf, r): + """Blacken all text on the given pages.""" + +def blackLines(pdf, r): + """Blacken all lines on the given pages.""" + +def blackFills(pdf, r): + """Blacken all fills on the given pages.""" + +def thinLines(pdf, r, linewidth): + """Thicken every line less than + linewidth to linewidth. Thickness given in points.""" + +def copyId(pdf, pdf2): + """Copy the /ID from one pdf to pdf2.""" + +def removeId(pdf): + """Remove a document's /ID""" + +def setVersion(pdf, version): + """Set the minor version number of a document.""" + +def setFullVersion(pdf, major, minor): + """Set the major and minor version number of + a document.""" + +def removeDictEntry(pdf, key): + """Remove any dictionary entry with the given + key anywhere in the document.""" + +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.""" + +def removeClipping(pdf, r): + """Remove all clipping from pages in the given range"""