## PopplerPage

PopplerPage — Information about a page in a document

## Synopsis

    void        poppler_page_render_to_pixbuf   (PopplerPage *page,
                                                 int src_x,
                                                 int src_y,
                                                 int src_width,
                                                 int src_height,
                                                 double scale,
                                                 int rotation,
                                                 GdkPixbuf *pixbuf);
    void        poppler_page_get_size           (PopplerPage *page,
                                                 double *width,
                                                 double *height);
    int         poppler_page_get_index          (PopplerPage *page);
    GdkPixbuf*  poppler_page_get_thumbnail      (PopplerPage *page);
    gboolean    poppler_page_get_thumbnail_size (PopplerPage *page,
                                                 int *width,
                                                 int *height);
    GList*      poppler_page_find_text          (PopplerPage *page,
                                                 const char *text);
    void        poppler_page_render_to_ps       (PopplerPage *page,
                                                 PopplerPSFile *ps_file);
    char*       poppler_page_get_text           (PopplerPage *page,
                                                 PopplerRectangle *rect);
    GList*      poppler_page_get_link_mapping   (PopplerPage *page);
    void        poppler_page_free_link_mapping  (GList *list);
    GdkRegion*  poppler_page_get_selection_region
                                                (PopplerPage *page,
                                                 gdouble scale,
                                                 PopplerRectangle *selection);
    void        poppler_page_render_selection   (PopplerPage *page,
                                                 gdouble scale,
                                                 int rotation,
                                                 GdkPixbuf *pixbuf,
                                                 PopplerRectangle *selection,
                                                 PopplerRectangle *old_selection,
                                                 GdkColor *glyph_color,
                                                 GdkColor *background_color);
    #define     POPPLER_TYPE_RECTANGLE
                PopplerRectangle;
    GType       poppler_rectangle_get_type      (void);
    PopplerRectangle* poppler_rectangle_new     (void);
    PopplerRectangle* poppler_rectangle_copy    (PopplerRectangle *rectangle);
    void        poppler_rectangle_free          (PopplerRectangle *rectangle);
    #define     POPPLER_TYPE_LINK_MAPPING
                PopplerLinkMapping;
    GType       poppler_link_mapping_get_type   (void);
    PopplerLinkMapping* poppler_link_mapping_new
                                                (void);
    PopplerLinkMapping* poppler_link_mapping_copy
                                                (PopplerLinkMapping *mapping);
    void        poppler_link_mapping_free       (PopplerLinkMapping *mapping);

## Description

## Details

### poppler_page_render_to_pixbuf ()

    void        poppler_page_render_to_pixbuf   (PopplerPage *page,
                                                 int src_x,
                                                 int src_y,
                                                 int src_width,
                                                 int src_height,
                                                 double scale,
                                                 int rotation,
                                                 GdkPixbuf *pixbuf);

`page` : |
`src_x` : |
`src_y` : |
`src_width` : |
`src_height` : |
`scale` : |
`rotation` : |
`pixbuf` : |

### poppler_page_get_size ()

    void        poppler_page_get_size           (PopplerPage *page,
                                                 double *width,
                                                 double *height);

Gets the size of `page` at the current scale and rotation.

`page` : | A PopplerPage
`width` : | return location for the width of `page`
`height` : | return location for the height of `page`

### poppler_page_get_index ()

    int         poppler_page_get_index          (PopplerPage *page);

Returns the index of `page`

`page` : | a PopplerPage
Returns : | index value of `page`

### poppler_page_get_thumbnail ()

    GdkPixbuf*  poppler_page_get_thumbnail      (PopplerPage *page);

Get the embedded thumbnail for the specified page. If the document doesn't have an embedded thumbnail for the page, this function returns `NULL`.

`page` : | the PopperPage to get the thumbnail for
Returns : | the tumbnail as a GdkPixbuf or `NULL` if the document doesn't have a thumbnail for this page.

### poppler_page_get_thumbnail_size ()

    gboolean    poppler_page_get_thumbnail_size (PopplerPage *page,
                                                 int *width,
                                                 int *height);

Returns `TRUE` if `page` has a thumbnail associated with it. It also fills in `width` and `height` with the width and height of the thumbnail. The values of width and height are not changed if no appropriate thumbnail exists.

`page` : | A PopplerPage
`width` : | return location for width
`height` : | return location for height
Returns : | `TRUE`, if `page` has a thumbnail associated with it.

### poppler_page_find_text ()

    GList*      poppler_page_find_text          (PopplerPage *page,
                                                 const char *text);

A GList of rectangles for each occurance of the text on the page. The coordinates are in PDF points.

`page` : | a PopplerPage
`text` : | the text to search for (UTF-8 encoded)
Returns : | a GList of PopplerRectangle,

### poppler_page_render_to_ps ()

    void        poppler_page_render_to_ps       (PopplerPage *page,
                                                 PopplerPSFile *ps_file);

Render the page on a postscript file

`page` : | a PopplerPage
`ps_file` : | the PopplerPSFile to render to

### poppler_page_get_text ()

    char*       poppler_page_get_text           (PopplerPage *page,
                                                 PopplerRectangle *rect);

Retrieves the contents of the specified rectangle as text

`page` : | a PopplerPage
`rect` : | the rectangle including the text
Returns : | a pointer to the contents of the rectangle as a string

### poppler_page_get_link_mapping ()

    GList*      poppler_page_get_link_mapping   (PopplerPage *page);

Returns a list of PopplerLinkMapping items that map from a location on `page` to a PopplerAction. This list must be freed with `poppler_page_free_link_mapping()` when done.

`page` : | A PopplerPage
Returns : | A GList of PopplerLinkMapping

### poppler_page_free_link_mapping ()

    void        poppler_page_free_link_mapping  (GList *list);

Frees a list of PopplerLinkMappings allocated by `poppler_page_get_link_mapping()`. It also frees the PopplerActions that each mapping contains, so if you want to keep them around, you need to copy them with `poppler_action_copy()`.

`list` : | A list of PopplerLinkMappings

### poppler_page_get_selection_region ()

    GdkRegion*  poppler_page_get_selection_region
                                                (PopplerPage *page,
                                                 gdouble scale,
                                                 PopplerRectangle *selection);

Returns a region containing the area that would be rendered by `poppler_page_render_selection()`. The returned region must be freed with `gdk_region_destroy()`.

`page` : | a PopplerPage
`scale` : | scale specified as pixels per point
`selection` : | start and end point of selection as a rectangle
Returns : | a newly allocated GdkRegion

### poppler_page_render_selection ()

    void        poppler_page_render_selection   (PopplerPage *page,
                                                 gdouble scale,
                                                 int rotation,
                                                 GdkPixbuf *pixbuf,
                                                 PopplerRectangle *selection,
                                                 PopplerRectangle *old_selection,
                                                 GdkColor *glyph_color,
                                                 GdkColor *background_color);

Render the selection specified by `selection` for `page` into `pixbuf`. The selection will be rendered at `scale`, using `glyph_color` for the glyphs and `background_color` for the selection background.

If non-NULL, `old_selection` specifies the selection that is already rendered in `pixbuf`, in which case this function will (some day) only render the changed part of the selection.

`page` : | the PopplerPage for which to render selection
`scale` : | scale specified as pixels per point
`rotation` : | rotate the document by the specified degree
`pixbuf` : | pixbuf to render to
`selection` : | start and end point of selection as a rectangle
`old_selection` : | previous selection
`glyph_color` : | color to use for drawing glyphs
`background_color` : | color to use for the selection background

### POPPLER_TYPE_RECTANGLE

    #define POPPLER_TYPE_RECTANGLE             (poppler_rectangle_get_type ())

### PopplerRectangle

    typedef struct {
      gdouble x1;
      gdouble y1;
      gdouble x2;
      gdouble y2;
    } PopplerRectangle;

### poppler_rectangle_get_type ()

    GType       poppler_rectangle_get_type      (void);

Returns : |

### poppler_rectangle_new ()

    PopplerRectangle* poppler_rectangle_new     (void);

Returns : |

### poppler_rectangle_copy ()

    PopplerRectangle* poppler_rectangle_copy    (PopplerRectangle *rectangle);

`rectangle` : |
Returns : |

### poppler_rectangle_free ()

    void        poppler_rectangle_free          (PopplerRectangle *rectangle);

`rectangle` : |

### POPPLER_TYPE_LINK_MAPPING

    #define POPPLER_TYPE_LINK_MAPPING             (poppler_link_mapping_get_type ())

### PopplerLinkMapping

    typedef struct {
      PopplerRectangle area;
      PopplerAction *action;
    } PopplerLinkMapping;

### poppler_link_mapping_get_type ()

    GType       poppler_link_mapping_get_type   (void);

Returns : |

### poppler_link_mapping_new ()

    PopplerLinkMapping* poppler_link_mapping_new
                                                (void);

Returns : |

### poppler_link_mapping_copy ()

    PopplerLinkMapping* poppler_link_mapping_copy
                                                (PopplerLinkMapping *mapping);

`mapping` : |
Returns : |

### poppler_link_mapping_free ()

    void        poppler_link_mapping_free       (PopplerLinkMapping *mapping);

`mapping` : |