GXPS Reference Manual: GXPSPage

## GXPSPage GXPSPage — Page of XPS document |

## Functions

#define | GXPS_PAGE_ERROR
void | gxps_page_get_size ()
gboolean | gxps_page_render ()
GList * | gxps_page_get_links ()
gboolean | gxps_page_get_anchor_destination ()

## Properties

GXPSArchive * | archive | Write / Construct Only
gchar * | source | Write / Construct Only

## Types and Values

struct | GXPSPage
enum | GXPSPageError

## Object Hierarchy

        GObject
        ╰── GXPSPage

## Implemented Interfaces

GXPSPage implements GInitable.

## Includes

    #include <libgxps/gxps.h>

## Description

GXPSPage represents a page in a XPS document. GXPSPages can be rendered into a cairo context with `gxps_page_render()`. GXPSPage objects can not be created directly, they are retrieved from a GXPSDocument with `gxps_document_get_page()`.

## Functions

### GXPS_PAGE_ERROR

    #define GXPS_PAGE_ERROR          (gxps_page_error_quark ())

Error domain for GXPSPage. Errors in this domain will be from GXPSPageError enumeration. See GError for more information on error domains.

### gxps_page_get_size ()

    void
    gxps_page_get_size (GXPSPage *page,
                        gdouble *width,
                        gdouble *height);

Gets the size of the page.

#### Parameters

page | a GXPSPage |
width | return location for the page width. | [out][allow-none]
height | return location for the page height. | [out][allow-none]

### gxps_page_render ()

    gboolean
    gxps_page_render (GXPSPage *page,
                      cairo_t *cr,
                      GError **error);

Render the page to the given cairo context. In case of error, `FALSE` is returned and `error` is filled with information about error.

#### Parameters

page | a GXPSPage |
cr | a cairo context to render to |
error | GError for error reporting, or `NULL` to ignore |

#### Returns

`TRUE` if page was successfully rendered, `FALSE` otherwise.

### gxps_page_get_links ()

    GList *
    gxps_page_get_links (GXPSPage *page,
                         GError **error);

Gets a list of GXPSLink items that map from a location in `page` to a GXPSLinkTarget. Items in the list should be freed with `gxps_link_free()` and the list itself with `g_list_free()` when done.

#### Parameters

page | a GXPSPage |
error | GError for error reporting, or `NULL` to ignore |

#### Returns

a GList of GXPSLink items.

[element-type GXPS.Link][transfer full]

### gxps_page_get_anchor_destination ()

    gboolean
    gxps_page_get_anchor_destination (GXPSPage *page,
                                      const gchar *anchor,
                                      cairo_rectangle_t *area,
                                      GError **error);

Gets the rectangle of `page` corresponding to the destination of the given anchor. If `anchor` is not found in `page` , `FALSE` will be returned and `error` will contain `GXPS_PAGE_ERROR_INVALID_ANCHOR`

#### Parameters

page | a GXPSPage |
anchor | the name of an anchor in `page` |
area | return location for page area of `anchor` . | [out]
error | GError for error reporting, or `NULL` to ignore |

#### Returns

`TRUE` if the destination for the anchor was found in page and `area` contains the rectangle, `FALSE` otherwise.

## Types and Values

### struct GXPSPage

    struct GXPSPage;

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

### enum GXPSPageError

Error codes returned by GXPSPage functions

#### Members

GXPS_PAGE_ERROR_INVALID | The page is invalid. |
GXPS_PAGE_ERROR_RENDER | Error rendering the page. |
GXPS_PAGE_ERROR_INVALID_ANCHOR | Anchor is invalid for the page. |

## Property Details

### The `“archive”` property

      “archive”                  GXPSArchive *

The document archive.

Flags: Write / Construct Only

### The `“source”` property

      “source”                   gchar *

The Page Source File.

Flags: Write / Construct Only

Default value: NULL

## See Also

GXPSDocument, GXPSLink, GXPSLinkTarget