summaryrefslogtreecommitdiff
path: root/glib/poppler-page.h
blob: 8f0d4d3c6cda8e6cd1604b731c5964e6b2eb96de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
/* poppler-page.h: glib interface to poppler
 * Copyright (C) 2004, Red Hat, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2, or (at your option)
 * any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 */

#ifndef __POPPLER_PAGE_H__
#define __POPPLER_PAGE_H__

#include <glib-object.h>
#include <gdk-pixbuf/gdk-pixbuf.h>

#include "poppler.h"

G_BEGIN_DECLS


#define POPPLER_TYPE_PAGE             (poppler_page_get_type ())
#define POPPLER_PAGE(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), POPPLER_TYPE_PAGE, PopplerPage))
#define POPPLER_IS_PAGE(obj)          (G_TYPE_CHECK_INSTANCE_TYPE ((obj), POPPLER_TYPE_PAGE))


GType      	    poppler_page_get_type           (void) G_GNUC_CONST;
void		    poppler_page_render_to_pixbuf   (PopplerPage        *page,
					             int                 src_x,
					             int                 src_y,
					             int                 src_width,
					             int                 src_height,
					             double              scale,
					             GdkPixbuf          *pixbuf,
					             int                 dest_x,
					             int                 dest_y);
void		    poppler_page_get_size           (PopplerPage        *page,
					    	     double             *width,
					             double             *height);
PopplerOrientation  poppler_page_get_orientation    (PopplerPage        *page);
void		    poppler_page_set_orientation    (PopplerPage        *page,
					             PopplerOrientation  orientation);
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);


/* A rectangle on a page, with coordinates in PDF points. */
#define POPPLER_TYPE_RECTANGLE             (poppler_rectangle_get_type ())
struct _PopplerRectangle
{
  gdouble x1;
  gdouble y1;
  gdouble x2;
  gdouble y2;
};

GType             poppler_rectangle_get_type (void) G_GNUC_CONST;
PopplerRectangle *poppler_rectangle_new      (void);
PopplerRectangle *poppler_rectangle_copy     (PopplerRectangle *rectangle);
void              poppler_rectangle_free     (PopplerRectangle *rectangle);



/* Mapping between areas on the current page and PopplerActions */
#define POPPLER_TYPE_LINK_MAPPING             (poppler_link_mapping_get_type ())
struct  _PopplerLinkMapping
{
  PopplerRectangle area;
  PopplerAction *action;
};

GType               poppler_link_mapping_get_type (void) G_GNUC_CONST;
PopplerLinkMapping *poppler_link_mapping_new      (void);
PopplerLinkMapping *poppler_link_mapping_copy     (PopplerLinkMapping *mapping);
void                poppler_link_mapping_free     (PopplerLinkMapping *mapping);

G_END_DECLS

#endif /* __POPPLER_PAGE_H__ */