PapersDocument.Document
Description: Reference for PapersDocument.Document

### Class

# PapersDocumentDocument

#### Description

    abstract class PapersDocument.Document : GObject.Object
    {
      /* No available fields */
    }

No description available.

#### Ancestors

- GObject

#### Functions

###### pps_document_factory_add_filters

Adds some file filters to `dialog`.

###### pps_document_factory_get_document

Creates a `PpsDocument` for the document at `uri`; or, if no backend handling the document’s type is found, or an error occurred on opening the document, returns `NULL` and fills in `error`. If the document is encrypted, it is returned but also `error` is set to `PPS_DOCUMENT_ERROR_ENCRYPTED`.

###### pps_document_factory_get_document_for_fd

Synchronously creates a `PpsDocument` for the document from `fd` using the backend for loading documents of type `mime_type`; or, if the backend does not support loading from file descriptors, or an error occurred on opening the document, returns `NULL` and fills in `error`. If the document is encrypted, it is returned but also `error` is set to `PPS_DOCUMENT_ERROR_ENCRYPTED`.

since: 42.0

###### pps_document_misc_format_datetime

Determine the preferred date and time representation for the current locale for `dt`.

###### pps_document_misc_get_pointer_position

Get the pointer’s x and y position relative to `widget`.

###### pps_document_misc_get_widget_dpi

Returns sensible guess for DPI of monitor on which given widget has been realized. If HiDPI display, use 192, else 96. Returns 96 as fallback value.

###### pps_document_misc_pixbuf_from_surface

No description available.

###### pps_document_misc_surface_from_pixbuf

No description available.

###### pps_document_misc_surface_rotate_and_scale

No description available.

###### pps_document_misc_texture_from_surface

Convert a cairo_surface_t to `GdkTexture` object.

#### Instance methods

###### pps_document_check_dimensions

No description available.

###### pps_document_find_page_by_label

No description available.

###### pps_document_get_backend_info

No description available.

###### pps_document_get_info

Returns the `PpsDocumentInfo` for the document.

###### pps_document_get_max_label_len

No description available.

###### pps_document_get_max_page_size

No description available.

###### pps_document_get_min_page_size

No description available.

###### pps_document_get_modified

No description available.

###### pps_document_get_n_pages

No description available.

###### pps_document_get_page

No description available.

###### pps_document_get_page_label

No description available.

###### pps_document_get_page_size

No description available.

###### pps_document_get_page_size_uncached

Calls the `document`‘s backend to fetch the page size. This should only be used on very specific cases, where it is not desired that the cache should be loaded. Calling with a loaded cache is a programmers’ error.

since: 49.0

###### pps_document_get_size

No description available.

###### pps_document_get_thumbnail

No description available.

###### pps_document_get_thumbnail_surface

No description available.

###### pps_document_get_title

No description available.

###### pps_document_get_uri

No description available.

###### pps_document_has_text_page_labels

No description available.

###### pps_document_is_page_size_uniform

No description available.

###### pps_document_load

Loads `document` from `uri`.

###### pps_document_load_fd

Synchronously loads the document from `fd`, which must refer to a regular file.

since: 42.0

###### pps_document_render

No description available.

###### pps_document_save

Saves `document` to `uri`.

###### pps_document_set_modified

Set the `document` modification state as `modified`.

###### pps_document_setup_cache

No description available.

##### Methods inherited from GObject (43)

Please see GObject for a full list of methods.

#### Properties

###### PapersDocument.Document:modified

No description available.

#### Signals

##### Signals inherited from GObject (1)

###### GObject::notify

The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.

#### Class structure

    struct PapersDocumentDocumentClass {
      GObjectClass base_class;
      gboolean (* load) (
        PpsDocument* document,
        const char* uri,
        GError** error
      );
      gboolean (* load_fd) (
        PpsDocument* document,
        int fd,
        GError** error
      );
      gboolean (* save) (
        PpsDocument* document,
        const char* uri,
        GError** error
      );
      gint (* get_n_pages) (
        PpsDocument* document
      );
      PpsPage* (* get_page) (
        PpsDocument* document,
        gint index
      );
      void (* get_page_size) (
        PpsDocument* document,
        PpsPage* page_index,
        double* width,
        double* height
      );
      gchar* (* get_page_label) (
        PpsDocument* document,
        PpsPage* page
      );
      cairo_surface_t* (* render) (
        PpsDocument* document,
        PpsRenderContext* rc
      );
      GdkPixbuf* (* get_thumbnail) (
        PpsDocument* document,
        PpsRenderContext* rc
      );
      cairo_surface_t* (* get_thumbnail_surface) (
        PpsDocument* document,
        PpsRenderContext* rc
      );
      PpsDocumentInfo* (* get_info) (
        PpsDocument* document
      );
      gboolean (* get_backend_info) (
        PpsDocument* document,
        PpsDocumentBackendInfo* info
      );

    }

No description available.

###### Class members

`base_class: GObjectClass`

  No description available.

`load: gboolean (* load) ( PpsDocument* document, const char* uri, GError** error )`

  No description available.

`load_fd: gboolean (* load_fd) ( PpsDocument* document, int fd, GError** error )`

  No description available.

`save: gboolean (* save) ( PpsDocument* document, const char* uri, GError** error )`

  No description available.

`get_n_pages: gint (* get_n_pages) ( PpsDocument* document )`

  No description available.

`get_page: PpsPage* (* get_page) ( PpsDocument* document, gint index )`

  No description available.

`get_page_size: void (* get_page_size) ( PpsDocument* document, PpsPage* page_index, double* width, double* height )`

  No description available.

`get_page_label: gchar* (* get_page_label) ( PpsDocument* document, PpsPage* page )`

  No description available.

`render: cairo_surface_t* (* render) ( PpsDocument* document, PpsRenderContext* rc )`

  No description available.

`get_thumbnail: GdkPixbuf* (* get_thumbnail) ( PpsDocument* document, PpsRenderContext* rc )`

  No description available.

`get_thumbnail_surface: cairo_surface_t* (* get_thumbnail_surface) ( PpsDocument* document, PpsRenderContext* rc )`

  No description available.

`get_info: PpsDocumentInfo* (* get_info) ( PpsDocument* document )`

  No description available.

`get_backend_info: gboolean (* get_backend_info) ( PpsDocument* document, PpsDocumentBackendInfo* info )`

  No description available.

#### Virtual methods

###### PapersDocument.DocumentClass.get_backend_info

No description available.

###### PapersDocument.DocumentClass.get_info

Returns the `PpsDocumentInfo` for the document.

###### PapersDocument.DocumentClass.get_n_pages

No description available.

###### PapersDocument.DocumentClass.get_page

No description available.

###### PapersDocument.DocumentClass.get_page_label

No description available.

###### PapersDocument.DocumentClass.get_page_size

No description available.

###### PapersDocument.DocumentClass.get_thumbnail

No description available.

###### PapersDocument.DocumentClass.get_thumbnail_surface

No description available.

###### PapersDocument.DocumentClass.load

Loads `document` from `uri`.

###### PapersDocument.DocumentClass.load_fd

Synchronously loads the document from `fd`, which must refer to a regular file.

since: 42.0

###### PapersDocument.DocumentClass.render

No description available.

###### PapersDocument.DocumentClass.save

Saves `document` to `uri`.