OOXML Page size

Page Size dimensions, orientation and printer paper code.

class benker.parsers.ooxml.w_pg_sz.PgSz(w_pg_sz)

Bases: object

Page Size. – This element specifies the properties (size and orientation) for all pages in the current section.

Example: <w:pgSz w:w="11907" w:h="16839" />, for A4 portrait.

styles
w_code = None

Printer Paper Code

w_h = None

Page Height

w_orient = None

Page Orientation (Possible values are “landscape” and “portrait”).

w_w = None

Page Width

benker.parsers.ooxml.w_pg_sz.value_of(element, xpath, *, namespaces={'w': 'http://schemas.openxmlformats.org/wordprocessingml/2006/main'}, default=None)

Take the first value of a xpath evaluation.

Parameters:
  • element (etree._Element) – Root element used to evaluate the xpath expression.
  • xpath (str) – xpath expression. This expression will be evaluated using the namespaces namespaces.
  • namespaces (dict[str, str]) – Namespace map to use for the xpath evaluation.
  • default – default value used if the xpath evaluation returns no result.
Returns:

the first result or the default value.