![]() |
![]() |
![]() |
Poppler Reference Manual | ![]() |
---|---|---|---|---|
void poppler_page_render (PopplerPage *page, cairo_t *cairo); 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); void poppler_page_render_to_ps (PopplerPage *page, PopplerPSFile *ps_file); GList* poppler_page_find_text (PopplerPage *page, const char *text); char* poppler_page_get_text (PopplerPage *page, PopplerSelectionStyle style, PopplerRectangle *rect); double poppler_page_get_duration (PopplerPage *page); PopplerPageTransition* poppler_page_get_transition (PopplerPage *page); GList* poppler_page_get_link_mapping (PopplerPage *page); void poppler_page_free_link_mapping (GList *list); GList* poppler_page_get_image_mapping (PopplerPage *page); void poppler_page_free_image_mapping (GList *list); GList* poppler_page_get_form_field_mapping (PopplerPage *page); void poppler_page_free_form_field_mapping (GList *list); GdkRegion* poppler_page_get_selection_region (PopplerPage *page, gdouble scale, PopplerSelectionStyle style, PopplerRectangle *selection); void poppler_page_render_selection (PopplerPage *page, cairo_t *cairo, PopplerRectangle *selection, PopplerRectangle *old_selection, PopplerSelectionStyle style, GdkColor *glyph_color, GdkColor *background_color); void poppler_page_render_selection_to_pixbuf (PopplerPage *page, gdouble scale, int rotation, GdkPixbuf *pixbuf, PopplerRectangle *selection, PopplerRectangle *old_selection, PopplerSelectionStyle style, 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_PAGE_TRANSITION PopplerPageTransition; GType poppler_page_transition_get_type (void); PopplerPageTransition* poppler_page_transition_new (void); PopplerPageTransition* poppler_page_transition_copy (PopplerPageTransition *transition); void poppler_page_transition_free (PopplerPageTransition *transition); #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); #define POPPLER_TYPE_IMAGE_MAPPING PopplerImageMapping; GType poppler_image_mapping_get_type (void); PopplerImageMapping* poppler_image_mapping_new (void); PopplerImageMapping* poppler_image_mapping_copy (PopplerImageMapping *mapping); void poppler_image_mapping_free (PopplerImageMapping *mapping); #define POPPLER_TYPE_FORM_FIELD_MAPPING PopplerFormFieldMapping; GType poppler_form_field_mapping_get_type (void); PopplerFormFieldMapping* poppler_form_field_mapping_new (void); PopplerFormFieldMapping* poppler_form_field_mapping_copy (PopplerFormFieldMapping *mapping); void poppler_form_field_mapping_free (PopplerFormFieldMapping *mapping);
void poppler_page_render (PopplerPage *page, cairo_t *cairo);
Render the page to the given cairo context.
page : |
the page to render from |
cairo : |
cairo context to render to |
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.
|
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 |
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, |
char* poppler_page_get_text (PopplerPage *page, PopplerSelectionStyle style, PopplerRectangle *rect);
Retrieves the contents of the specified selection
as text.
page : |
a PopplerPage |
style : |
a PopplerSelectionStyle |
rect : |
|
Returns : | a pointer to the contents of the selection
as a string
|
double poppler_page_get_duration (PopplerPage *page);
Returns the duration of page
page : |
a PopplerPage |
Returns : | duration in seconds of page or -1.
|
PopplerPageTransition* poppler_page_get_transition (PopplerPage *page);
Returns the transition effect of page
page : |
a PopplerPage |
Returns : | a PopplerPageTransition or NULL. |
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 |
GList* poppler_page_get_image_mapping (PopplerPage *page);
Returns a list of PopplerImageMapping items that map from a
location on page
to a GdkPixbuf. This list must be freed
with poppler_page_free_image_mapping()
when done.
page : |
A PopplerPage |
Returns : | A GList of PopplerImageMapping |
void poppler_page_free_image_mapping (GList *list);
Frees a list of PopplerImageMappings allocated by
poppler_page_get_image_mapping()
.
list : |
A list of PopplerImageMappings |
GList* poppler_page_get_form_field_mapping (PopplerPage *page);
Returns a list of PopplerFormFieldMapping items that map from a
location on page
to a form field. This list must be freed
with poppler_page_free_form_field_mapping()
when done.
page : |
A PopplerPage |
Returns : | A GList of PopplerFormFieldMapping |
void poppler_page_free_form_field_mapping (GList *list);
Frees a list of PopplerFormFieldMappings allocated by
poppler_page_get_form_field_mapping()
.
list : |
A list of PopplerFormFieldMappings |
GdkRegion* poppler_page_get_selection_region (PopplerPage *page, gdouble scale, PopplerSelectionStyle style, PopplerRectangle *selection);
Returns a region containing the area that would be rendered by
poppler_page_render_selection()
or
poppler_page_render_selection_to_pixbuf()
. The returned
region must be freed with gdk_region_destroy()
.
page : |
a PopplerPage |
scale : |
scale specified as pixels per point |
style : |
a PopplerSelectionStyle |
selection : |
start and end point of selection as a rectangle |
Returns : | a newly allocated GdkRegion |
void poppler_page_render_selection (PopplerPage *page, cairo_t *cairo, PopplerRectangle *selection, PopplerRectangle *old_selection, PopplerSelectionStyle style, GdkColor *glyph_color, GdkColor *background_color);
Render the selection specified by selection
for page
to
the given cairo context. The selection will be rendered, 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 to cairo
, in which case this function will (some day)
only render the changed part of the selection.
page : |
the PopplerPage for which to render selection |
cairo : |
cairo context to render to |
selection : |
start and end point of selection as a rectangle |
old_selection : |
previous selection |
style : |
a PopplerSelectionStyle |
glyph_color : |
color to use for drawing glyphs |
background_color : |
color to use for the selection background |
void poppler_page_render_selection_to_pixbuf (PopplerPage *page, gdouble scale, int rotation, GdkPixbuf *pixbuf, PopplerRectangle *selection, PopplerRectangle *old_selection, PopplerSelectionStyle style, 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 |
style : |
a PopplerSelectionStyle |
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 : |
#define POPPLER_TYPE_PAGE_TRANSITION (poppler_page_transition_get_type ())
typedef struct { PopplerPageTransitionType type; PopplerPageTransitionAlignment alignment; PopplerPageTransitionDirection direction; gint duration; gint angle; gdouble scale; gboolean rectangular; } PopplerPageTransition;
PopplerPageTransition* poppler_page_transition_copy (PopplerPageTransition *transition);
transition : |
|
Returns : |
void poppler_page_transition_free (PopplerPageTransition *transition);
transition : |
typedef struct { PopplerRectangle area; PopplerAction *action; } PopplerLinkMapping;
PopplerLinkMapping* poppler_link_mapping_copy (PopplerLinkMapping *mapping);
mapping : |
|
Returns : |
void poppler_link_mapping_free (PopplerLinkMapping *mapping);
mapping : |
typedef struct { PopplerRectangle area; GdkPixbuf *image; } PopplerImageMapping;
PopplerImageMapping* poppler_image_mapping_copy (PopplerImageMapping *mapping);
mapping : |
|
Returns : |
void poppler_image_mapping_free (PopplerImageMapping *mapping);
mapping : |
#define POPPLER_TYPE_FORM_FIELD_MAPPING (poppler_form_field_mapping_get_type ())
typedef struct { PopplerRectangle area; PopplerFormField *field; } PopplerFormFieldMapping;
PopplerFormFieldMapping* poppler_form_field_mapping_new (void);
Returns : |
PopplerFormFieldMapping* poppler_form_field_mapping_copy (PopplerFormFieldMapping *mapping);
mapping : |
|
Returns : |
void poppler_form_field_mapping_free (PopplerFormFieldMapping *mapping);
mapping : |