GXPS.Document

g GObject.GInterface GObject.GInterface Gio.Initable Gio.Initable GObject.GInterface->Gio.Initable GObject.Object GObject.Object GXPS.Document GXPS.Document GObject.Object->GXPS.Document Gio.Initable->GXPS.Document

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gio.Initable (2)

Structs:

GObject.ObjectClass (5)

get_n_pages ()

get_page (n_page)

get_page_for_anchor (anchor)

get_page_size (n_page)

get_structure ()

Virtual Methods

Inherited:

GObject.Object (7), Gio.Initable (1)

Properties

Name

Type

Flags

Short Description

source

str

w/co

The Document Source File

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

Class Details

class GXPS.Document(**kwargs)
Bases:

GObject.Object, Gio.Initable

Abstract:

No

Structure:

GXPS.DocumentClass

The GXPS.Document struct contains only private fields and should not be directly accessed.

get_n_pages()
Returns:

the number of pages.

Return type:

int

Gets the number of pages in self.

get_page(n_page)
Parameters:

n_page (int) – the index of the page to get

Raises:

GLib.Error

Returns:

a new GXPS.Page or None on error. Free the returned object with GObject.Object.unref().

Return type:

GXPS.Page

Creates a new GXPS.Page representing the page at index n_doc in self document.

get_page_for_anchor(anchor)
Parameters:

anchor (str) – the name of an anchor

Returns:

the page index of the given anchor.

Return type:

int

Gets the index of the page in self where the given anchor is.

get_page_size(n_page)
Parameters:

n_page (int) – the index of a page in self

Returns:

True if the page size information is available in self, False otherwise.

width:

return location for the width of n_page

height:

return location for the height of n_page

Return type:

(bool, width: float, height: float)

Gets the typical size of the page at index n_page in self document. This function is useful to get the advisory size of pages in a document without creating GXPS.Page objects. This page size might be different than the actual page size so page dimension might need to be updated once the page is loaded. Advisory page sizes are not always available in self, in which case this function returns False. To get the authoritative size of a page you should use GXPS.Page.get_size() instead.

get_structure()
Returns:

a new GXPS.DocumentStructure or None if document doesn’t have a structure. Free the returned object with GObject.Object.unref().

Return type:

GXPS.DocumentStructure

Creates a new GXPS.DocumentStructure representing the document structure of self.

Property Details

GXPS.Document.props.source
Name:

source

Type:

str

Default Value:

None

Flags:

WRITABLE, CONSTRUCT_ONLY

The Document Source File