LeenO computo metrico con LibreOffice  3.22.0
Il software libero per la gestione di computi metrici e contabilità lavori.
Membri pubblici | Attributi pubblici | Attributi pubblici statici | Elenco di tutti i membri
Riferimenti per la classe pdf.PageObject

Membri pubblici

def __init__ (self, pdf=None, indirectRef=None)
 
def createBlankPage (pdf=None, width=None, height=None)
 
def rotateClockwise (self, angle)
 
def rotateCounterClockwise (self, angle)
 
def getContents (self)
 
def mergePage (self, page2)
 
def mergeTransformedPage (self, page2, ctm, expand=False)
 
def mergeScaledPage (self, page2, scale, expand=False)
 
def mergeRotatedPage (self, page2, rotation, expand=False)
 
def mergeTranslatedPage (self, page2, tx, ty, expand=False)
 
def mergeRotatedTranslatedPage (self, page2, rotation, tx, ty, expand=False)
 
def mergeRotatedScaledPage (self, page2, rotation, scale, expand=False)
 
def mergeScaledTranslatedPage (self, page2, scale, tx, ty, expand=False)
 
def mergeRotatedScaledTranslatedPage (self, page2, rotation, scale, tx, ty, expand=False)
 
def addTransformation (self, ctm)
 Applys a transformation matrix the page. Continua...
 
def scale (self, sx, sy)
 
def scaleBy (self, factor)
 
def scaleTo (self, width, height)
 
def compressContentStreams (self)
 
def extractText (self)
 
- Membri pubblici ereditati da generic.DictionaryObject
def raw_get (self, key)
 
def __setitem__ (self, key, value)
 
def setdefault (self, key, value=None)
 
def __getitem__ (self, key)
 
def getXmpMetadata (self)
 Retrieves XMP (Extensible Metadata Platform) data relevant to the this object, if available. Continua...
 
def writeToStream (self, stream, encryption_key)
 
def readFromStream (stream, pdf)
 
- Membri pubblici ereditati da generic.PdfObject
def getObject (self)
 

Attributi pubblici

 pdf
 
 indirectRef
 

Attributi pubblici statici

 createBlankPage = staticmethod(createBlankPage)
 
 mediaBox = createRectangleAccessor("/MediaBox", ())
 
 cropBox = createRectangleAccessor("/CropBox", ("/MediaBox",))
 
 bleedBox = createRectangleAccessor("/BleedBox", ("/CropBox", "/MediaBox"))
 
 trimBox = createRectangleAccessor("/TrimBox", ("/CropBox", "/MediaBox"))
 
 artBox = createRectangleAccessor("/ArtBox", ("/CropBox", "/MediaBox"))
 
- Attributi pubblici statici ereditati da generic.DictionaryObject
 readFromStream = staticmethod(readFromStream)
 

Altri membri ereditati

- Proprietà ereditati da generic.DictionaryObject
 xmpMetadata = property(lambda self: self.getXmpMetadata(), None, None)
 Read-only property that accesses the {getXmpData} function. Continua...
 

Descrizione dettagliata

This class represents a single page within a PDF file.  Typically this
object will be created by accessing the
:meth:`getPage()<PyPDF2.PdfFileReader.getPage>` method of the
:class:`PdfFileReader<PyPDF2.PdfFileReader>` class, but it is
also possible to create an empty page with the
:meth:`createBlankPage()<PageObject.createBlankPage>` static method.

:param pdf: PDF file the page belongs to.
:param indirectRef: Stores the original indirect reference to
    this object in its source PDF

Definizione alla linea 2089 del file pdf.py.

Documentazione dei costruttori e dei distruttori

◆ __init__()

def pdf.PageObject.__init__ (   self,
  pdf = None,
  indirectRef = None 
)

Definizione alla linea 2102 del file pdf.py.

Documentazione delle funzioni membro

◆ addTransformation()

def pdf.PageObject.addTransformation (   self,
  ctm 
)

Applys a transformation matrix the page.

Parametri
ctmA 6 elements tuple containing the operands of the transformation matrix
Applies a transformation matrix to the page.

:param tuple ctm: A 6-element tuple containing the operands of the
    transformation matrix.

Definizione alla linea 2498 del file pdf.py.

◆ compressContentStreams()

def pdf.PageObject.compressContentStreams (   self)
Compresses the size of this page by joining all content streams and
applying a FlateDecode filter.

However, it is possible that this function will perform no action if
content stream compression becomes "automatic" for some reason.

Definizione alla linea 2567 del file pdf.py.

◆ createBlankPage()

def pdf.PageObject.createBlankPage (   pdf = None,
  width = None,
  height = None 
)
Returns a new blank page.
If ``width`` or ``height`` is ``None``, try to get the page size
from the last page of *pdf*.

:param pdf: PDF file the page belongs to
:param float width: The width of the new page expressed in default user
    space units.
:param float height: The height of the new page expressed in default user
    space units.
:return: the new blank page:
:rtype: :class:`PageObject<PageObject>`
:raises PageSizeNotDefinedError: if ``pdf`` is ``None`` or contains
    no page

Definizione alla linea 2107 del file pdf.py.

◆ extractText()

def pdf.PageObject.extractText (   self)
Locate all text drawing commands, in the order they are provided in the
content stream, and extract the text.  This works well for some PDF
files, but poorly for others, depending on the generator used.  This will
be refined in the future.  Do not rely on the order of text coming out of
this function, as it will change if this function is made more
sophisticated.

:return: a unicode string object.

Definizione alla linea 2581 del file pdf.py.

◆ getContents()

def pdf.PageObject.getContents (   self)
Accesses the page contents.

:return: the ``/Contents`` object, or ``None`` if it doesn't exist.
    ``/Contents`` is optional, as described in PDF Reference  7.7.3.3

Definizione alla linea 2216 del file pdf.py.

◆ mergePage()

def pdf.PageObject.mergePage (   self,
  page2 
)
Merges the content streams of two pages into one.  Resource references
(i.e. fonts) are maintained from both pages.  The mediabox/cropbox/etc
of this page are not altered.  The parameter page's content stream will
be added to the end of this page's content stream, meaning that it will
be drawn after, or "on top" of this page.

:param PageObject page2: The page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.

Definizione alla linea 2228 del file pdf.py.

◆ mergeRotatedPage()

def pdf.PageObject.mergeRotatedPage (   self,
  page2,
  rotation,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is rotated
by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float rotation: The angle of the rotation, in degrees
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2346 del file pdf.py.

◆ mergeRotatedScaledPage()

def pdf.PageObject.mergeRotatedScaledPage (   self,
  page2,
  rotation,
  scale,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is rotated
and scaled by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float rotation: The angle of the rotation, in degrees
:param float scale: The scaling factor
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2410 del file pdf.py.

◆ mergeRotatedScaledTranslatedPage()

def pdf.PageObject.mergeRotatedScaledTranslatedPage (   self,
  page2,
  rotation,
  scale,
  tx,
  ty,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is translated,
rotated and scaled by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float tx: The translation on X axis
:param float ty: The translation on Y axis
:param float rotation: The angle of the rotation, in degrees
:param float scale: The scaling factor
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2462 del file pdf.py.

◆ mergeRotatedTranslatedPage()

def pdf.PageObject.mergeRotatedTranslatedPage (   self,
  page2,
  rotation,
  tx,
  ty,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is rotated
and translated by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float tx: The translation on X axis
:param float ty: The translation on Y axis
:param float rotation: The angle of the rotation, in degrees
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2379 del file pdf.py.

◆ mergeScaledPage()

def pdf.PageObject.mergeScaledPage (   self,
  page2,
  scale,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is scaled
by appling a transformation matrix.

:param PageObject page2: The page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float scale: The scaling factor
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2330 del file pdf.py.

◆ mergeScaledTranslatedPage()

def pdf.PageObject.mergeScaledTranslatedPage (   self,
  page2,
  scale,
  tx,
  ty,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is translated
and scaled by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float scale: The scaling factor
:param float tx: The translation on X axis
:param float ty: The translation on Y axis
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2436 del file pdf.py.

◆ mergeTransformedPage()

def pdf.PageObject.mergeTransformedPage (   self,
  page2,
  ctm,
  expand = False 
)
This is similar to mergePage, but a transformation matrix is
applied to the merged stream.

:param PageObject page2: The page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param tuple ctm: a 6-element tuple containing the operands of the
    transformation matrix
:param bool expand: Whether the page should be expanded to fit the dimensions
    of the page to be merged.

Definizione alla linea 2315 del file pdf.py.

◆ mergeTranslatedPage()

def pdf.PageObject.mergeTranslatedPage (   self,
  page2,
  tx,
  ty,
  expand = False 
)
This is similar to mergePage, but the stream to be merged is translated
by appling a transformation matrix.

:param PageObject page2: the page to be merged into this one. Should be
    an instance of :class:`PageObject<PageObject>`.
:param float tx: The translation on X axis
:param float ty: The translation on Y axis
:param bool expand: Whether the page should be expanded to fit the
    dimensions of the page to be merged.

Definizione alla linea 2363 del file pdf.py.

◆ rotateClockwise()

def pdf.PageObject.rotateClockwise (   self,
  angle 
)
Rotates a page clockwise by increments of 90 degrees.

:param int angle: Angle to rotate the page.  Must be an increment
    of 90 deg.

Definizione alla linea 2142 del file pdf.py.

◆ rotateCounterClockwise()

def pdf.PageObject.rotateCounterClockwise (   self,
  angle 
)
Rotates a page counter-clockwise by increments of 90 degrees.

:param int angle: Angle to rotate the page.  Must be an increment
    of 90 deg.

Definizione alla linea 2153 del file pdf.py.

◆ scale()

def pdf.PageObject.scale (   self,
  sx,
  sy 
)
Scales a page by the given factors by appling a transformation
matrix to its content and updating the page size.

:param float sx: The scaling factor on horizontal axis.
:param float sy: The scaling factor on vertical axis.

Definizione alla linea 2512 del file pdf.py.

◆ scaleBy()

def pdf.PageObject.scaleBy (   self,
  factor 
)
Scales a page by the given factor by appling a transformation
matrix to its content and updating the page size.

:param float factor: The scaling factor (for both X and Y axis).

Definizione alla linea 2544 del file pdf.py.

◆ scaleTo()

def pdf.PageObject.scaleTo (   self,
  width,
  height 
)
Scales a page to the specified dimentions by appling a
transformation matrix to its content and updating the page size.

:param float width: The new width.
:param float height: The new heigth.

Definizione alla linea 2553 del file pdf.py.

Documentazione dei membri dato

◆ artBox

pdf.PageObject.artBox = createRectangleAccessor("/ArtBox", ("/CropBox", "/MediaBox"))
static

Definizione alla linea 2652 del file pdf.py.

◆ bleedBox

pdf.PageObject.bleedBox = createRectangleAccessor("/BleedBox", ("/CropBox", "/MediaBox"))
static

Definizione alla linea 2639 del file pdf.py.

◆ createBlankPage

pdf.PageObject.createBlankPage = staticmethod(createBlankPage)
static

Definizione alla linea 2140 del file pdf.py.

◆ cropBox

pdf.PageObject.cropBox = createRectangleAccessor("/CropBox", ("/MediaBox",))
static

Definizione alla linea 2630 del file pdf.py.

◆ indirectRef

pdf.PageObject.indirectRef

Definizione alla linea 2105 del file pdf.py.

◆ mediaBox

pdf.PageObject.mediaBox = createRectangleAccessor("/MediaBox", ())
static

Definizione alla linea 2623 del file pdf.py.

◆ pdf

pdf.PageObject.pdf

Definizione alla linea 2104 del file pdf.py.

◆ trimBox

pdf.PageObject.trimBox = createRectangleAccessor("/TrimBox", ("/CropBox", "/MediaBox"))
static

Definizione alla linea 2646 del file pdf.py.


La documentazione per questa classe è stata generata a partire dal seguente file: