![]() |
![]() |
![]() |
Poppler Reference Manual | ![]() |
---|---|---|---|---|
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);
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);
First scale the document to match the specified pixels per point, then render the rectangle given by the upper left corner at (src_x, src_y) and src_width and src_height.
page : | the page to render from |
src_x : | x coordinate of upper left corner |
src_y : | y coordinate of upper left corner |
src_width : | width of rectangle to render |
src_height : | height of rectangle to render |
scale : | scale specified as pixels per point |
rotation : | rotate the document by the specified degree |
pixbuf : | pixbuf to render into |
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 |
int poppler_page_get_index (PopplerPage *page);
Returns the index of page
page : | a PopplerPage |
Returns : | index value of page |
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. |
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. |
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, |
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 |
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 |
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 |
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 |
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 |
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 |
typedef struct { gdouble x1; gdouble y1; gdouble x2; gdouble y2; } PopplerRectangle;
PopplerRectangle* poppler_rectangle_copy (PopplerRectangle *rectangle);
rectangle : | |
Returns : |
typedef struct { PopplerRectangle area; PopplerAction *action; } PopplerLinkMapping;
PopplerLinkMapping* poppler_link_mapping_copy (PopplerLinkMapping *mapping);
mapping : | |
Returns : |
void poppler_link_mapping_free (PopplerLinkMapping *mapping);
mapping : |