more
This commit is contained in:
parent
0f52366328
commit
cda631fd7c
BIN
cpdfmanual.pdf
BIN
cpdfmanual.pdf
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
\documentclass{book}
|
\documentclass{book}
|
||||||
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf etc.
|
% Edit here to produce cpdfmanual.pdf, cpdflibmanual.pdf, pycpdfmanual.pdf etc.
|
||||||
\usepackage{comment}\excludecomment{cpdflib}\excludecomment{pycpdflib}
|
\usepackage{comment}\excludecomment{cpdflib}\includecomment{pycpdflib}
|
||||||
\usepackage{palatino}
|
\usepackage{palatino}
|
||||||
\usepackage{listings}
|
\usepackage{listings}
|
||||||
\usepackage{microtype}
|
\usepackage{microtype}
|
||||||
|
@ -3266,7 +3266,7 @@ It is not required that \texttt{/Length} entries in CPDFJSON stream dictionaries
|
||||||
\end{pycpdflib}
|
\end{pycpdflib}
|
||||||
|
|
||||||
\clearpage\pagestyle{empty}
|
\clearpage\pagestyle{empty}
|
||||||
\chapter{Optional Content Groups}\label{chap:16}\pagestyle{fancy}\index{Optional Content Group}
|
\chapter{Optional Content Groups}\label{chap:16}\pagestyle{fancy}\index{optional content group}
|
||||||
|
|
||||||
{\small\begin{framed}
|
{\small\begin{framed}
|
||||||
\noindent\verb!cpdf -ocg-list in.pdf!
|
\noindent\verb!cpdf -ocg-list in.pdf!
|
||||||
|
|
|
@ -20,25 +20,6 @@ def fromMemoryLazy(data, userpw):
|
||||||
""" Load a file from from a byte array and the user password (blank if
|
""" Load a file from from a byte array and the user password (blank if
|
||||||
none), but lazily like fromFileLazy."""
|
none), but lazily like fromFileLazy."""
|
||||||
|
|
||||||
def blankDocument(w, h, pages):
|
|
||||||
""" Create a blank document
|
|
||||||
with pages of the given width (in points), height (in points), and number
|
|
||||||
of pages."""
|
|
||||||
|
|
||||||
def textToPDF(w, h, font, fontsize, filename):
|
|
||||||
"""textToPDF(w, h, font, fontsize, filename) typesets a UTF8 text file
|
|
||||||
ragged right on a page of size w * h in points in the given font and font
|
|
||||||
size."""
|
|
||||||
|
|
||||||
def textToPDFPaper(papersize, font, fontsize, filename):
|
|
||||||
"""textToPDF(papersize font, fontsize, filename) typesets a UTF8 text file
|
|
||||||
ragged right on a page of the given size in the given font and font
|
|
||||||
size."""
|
|
||||||
|
|
||||||
def blankDocumentPaper(papersize, pages):
|
|
||||||
"""Create a blank document with pages of the given paper size, and number
|
|
||||||
of pages. """
|
|
||||||
|
|
||||||
def ptOfCm(i):
|
def ptOfCm(i):
|
||||||
"""Convert a figure in centimetres to points (72 points to 1 inch)."""
|
"""Convert a figure in centimetres to points (72 points to 1 inch)."""
|
||||||
|
|
||||||
|
|
|
@ -1,57 +1,20 @@
|
||||||
# CHAPTER 17. Miscellaneous
|
# CHAPTER 17. Creating New PDFs
|
||||||
|
|
||||||
def draft(pdf, r, boxes):
|
def blankDocument(w, h, pages):
|
||||||
"""Remove images on the given pages, replacing
|
""" Create a blank document
|
||||||
them with crossed boxes if 'boxes' is True."""
|
with pages of the given width (in points), height (in points), and number
|
||||||
|
of pages."""
|
||||||
|
|
||||||
def removeAllText(pdf, r):
|
def blankDocumentPaper(papersize, pages):
|
||||||
"""Remove all text from the given pages in a document."""
|
"""Create a blank document with pages of the given paper size, and number
|
||||||
|
of pages. """
|
||||||
|
|
||||||
def blackText(pdf, r):
|
def textToPDF(w, h, font, fontsize, filename):
|
||||||
"""Blacken all text on the given pages."""
|
"""textToPDF(w, h, font, fontsize, filename) typesets a UTF8 text file
|
||||||
|
ragged right on a page of size w * h in points in the given font and font
|
||||||
|
size."""
|
||||||
|
|
||||||
def blackLines(pdf, r):
|
def textToPDFPaper(papersize, font, fontsize, filename):
|
||||||
"""Blacken all lines on the given pages."""
|
"""textToPDF(papersize font, fontsize, filename) typesets a UTF8 text file
|
||||||
|
ragged right on a page of the given size in the given font and font
|
||||||
def blackFills(pdf, r):
|
size."""
|
||||||
"""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"""
|
|
||||||
|
|
|
@ -0,0 +1,57 @@
|
||||||
|
# CHAPTER 17. 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"""
|
Loading…
Reference in New Issue