mirror of
https://github.com/johnwhitington/cpdf-source.git
synced 2025-06-05 22:09:39 +02:00
Updating html_manual/splits
This commit is contained in:
@ -20,15 +20,6 @@ def fromMemoryLazy(data, userpw):
|
||||
""" Load a file from from a byte array and the user password (blank if
|
||||
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 blankDocumentPaper(papersize, pages):
|
||||
"""Create a blank document with pages of the given paper size, and number
|
||||
of pages. """
|
||||
|
||||
def ptOfCm(i):
|
||||
"""Convert a figure in centimetres to points (72 points to 1 inch)."""
|
||||
|
||||
@ -48,9 +39,9 @@ def inOfPt(i):
|
||||
"""Convert a figure in points to inches (72 points to 1 inch)."""
|
||||
|
||||
def parsePagespec(pdf, pagespec):
|
||||
"""Parse a page specification such as "1-3,8-end" to a range with reference to
|
||||
a given PDF (the PDF is supplied so that page ranges which reference pages
|
||||
which do not exist are rejected)."""
|
||||
"""Parse a page specification such as "1-3,8-end" to a range with reference
|
||||
to a given PDF (the PDF is supplied so that page ranges which reference
|
||||
pages which do not exist are rejected)."""
|
||||
|
||||
def validatePagespec(pagespec):
|
||||
"""Validate a page specification, returning True or False, so far as is
|
||||
@ -95,6 +86,7 @@ def rangeLength(r):
|
||||
|
||||
def rangeGet(r, n):
|
||||
"""Get the page number at position n in a range, where
|
||||
n runs from 0 to rangeLength - 1."""
|
||||
|
||||
def rangeAdd(r, p):
|
||||
"""Add the page to a range, if it is not already
|
||||
@ -105,9 +97,6 @@ def isInRange(r, p):
|
||||
|
||||
def pages(pdf):
|
||||
"""Return the number of pages in a PDF."""
|
||||
r = libc.pycpdf_pages(pdf.pdf)
|
||||
checkerror()
|
||||
return r
|
||||
|
||||
def pagesFast(userpw, filename):
|
||||
"""Return the number of pages in a given
|
||||
@ -129,16 +118,12 @@ def toFileExt(pdf, filename, linearize, make_id, preserve_objstm,
|
||||
will be compressed (what we usually want). WARNING: the pdf argument will
|
||||
be invalid after this call and should not be used again."""
|
||||
|
||||
|
||||
def toMemory(pdf, linearize, make_id):
|
||||
"""Write a file to memory, returning the buffer as a byte array of type
|
||||
bytes."""
|
||||
|
||||
def isEncrypted(pdf):
|
||||
"""Returns True if a documented is encrypted, False otherwise."""
|
||||
r = libc.pycpdf_isEncrypted(pdf.pdf)
|
||||
checkerror()
|
||||
return r
|
||||
|
||||
def toFileEncrypted(pdf, method, permissions, ownerpw, userpw, linearize,
|
||||
makeid, filename):
|
||||
|
Reference in New Issue
Block a user