1 | /* poppler-document.h: glib interface to poppler |
2 | * Copyright (C) 2004, Red Hat, Inc. |
3 | * |
4 | * Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com> |
5 | * Copyright (C) 2018, 2019, 2021, 2022 Marek Kasik <mkasik@redhat.com> |
6 | * Copyright (C) 2019 Masamichi Hosoda <trueroad@trueroad.jp> |
7 | * Copyright (C) 2021 André Guerreiro <aguerreiro1985@gmail.com> |
8 | * |
9 | * This program is free software; you can redistribute it and/or modify |
10 | * it under the terms of the GNU General Public License as published by |
11 | * the Free Software Foundation; either version 2, or (at your option) |
12 | * any later version. |
13 | * |
14 | * This program is distributed in the hope that it will be useful, |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
17 | * GNU General Public License for more details. |
18 | * |
19 | * You should have received a copy of the GNU General Public License |
20 | * along with this program; if not, write to the Free Software |
21 | * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. |
22 | */ |
23 | |
24 | #ifndef __POPPLER_DOCUMENT_H__ |
25 | #define __POPPLER_DOCUMENT_H__ |
26 | |
27 | #include <glib-object.h> |
28 | #include <gio/gio.h> |
29 | #include "poppler.h" |
30 | |
31 | G_BEGIN_DECLS |
32 | |
33 | #define POPPLER_TYPE_DOCUMENT (poppler_document_get_type()) |
34 | #define POPPLER_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_DOCUMENT, PopplerDocument)) |
35 | #define POPPLER_IS_DOCUMENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), POPPLER_TYPE_DOCUMENT)) |
36 | |
37 | /** |
38 | * PopplerPageLayout: |
39 | * @POPPLER_PAGE_LAYOUT_UNSET: no specific layout set |
40 | * @POPPLER_PAGE_LAYOUT_SINGLE_PAGE: one page at a time |
41 | * @POPPLER_PAGE_LAYOUT_ONE_COLUMN: pages in one column |
42 | * @POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT: pages in two columns with odd numbered pages on the left |
43 | * @POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT: pages in two columns with odd numbered pages on the right |
44 | * @POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT: two pages at a time with odd numbered pages on the left |
45 | * @POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT: two pages at a time with odd numbered pages on the right |
46 | * |
47 | * Page layout types |
48 | */ |
49 | typedef enum |
50 | { |
51 | POPPLER_PAGE_LAYOUT_UNSET, |
52 | POPPLER_PAGE_LAYOUT_SINGLE_PAGE, |
53 | POPPLER_PAGE_LAYOUT_ONE_COLUMN, |
54 | POPPLER_PAGE_LAYOUT_TWO_COLUMN_LEFT, |
55 | POPPLER_PAGE_LAYOUT_TWO_COLUMN_RIGHT, |
56 | POPPLER_PAGE_LAYOUT_TWO_PAGE_LEFT, |
57 | POPPLER_PAGE_LAYOUT_TWO_PAGE_RIGHT |
58 | } PopplerPageLayout; |
59 | |
60 | /** |
61 | * PopplerPageMode: |
62 | * @POPPLER_PAGE_MODE_UNSET: no specific mode set |
63 | * @POPPLER_PAGE_MODE_NONE: neither document outline nor thumbnails visible |
64 | * @POPPLER_PAGE_MODE_USE_OUTLINES: document outline visible |
65 | * @POPPLER_PAGE_MODE_USE_THUMBS: thumbnails visible |
66 | * @POPPLER_PAGE_MODE_FULL_SCREEN: full-screen mode |
67 | * @POPPLER_PAGE_MODE_USE_OC: layers panel visible |
68 | * @POPPLER_PAGE_MODE_USE_ATTACHMENTS: attachments panel visible |
69 | * |
70 | * Page modes |
71 | */ |
72 | typedef enum |
73 | { |
74 | POPPLER_PAGE_MODE_UNSET, |
75 | POPPLER_PAGE_MODE_NONE, |
76 | POPPLER_PAGE_MODE_USE_OUTLINES, |
77 | POPPLER_PAGE_MODE_USE_THUMBS, |
78 | POPPLER_PAGE_MODE_FULL_SCREEN, |
79 | POPPLER_PAGE_MODE_USE_OC, |
80 | POPPLER_PAGE_MODE_USE_ATTACHMENTS |
81 | } PopplerPageMode; |
82 | |
83 | /** |
84 | * PopplerFontType: |
85 | * @POPPLER_FONT_TYPE_UNKNOWN: unknown font type |
86 | * @POPPLER_FONT_TYPE_TYPE1: Type 1 font type |
87 | * @POPPLER_FONT_TYPE_TYPE1C: Type 1 font type embedded in Compact Font Format (CFF) font program |
88 | * @POPPLER_FONT_TYPE_TYPE1COT: Type 1 font type embedded in OpenType font program |
89 | * @POPPLER_FONT_TYPE_TYPE3: A font type that is defined with PDF graphics operators |
90 | * @POPPLER_FONT_TYPE_TRUETYPE: TrueType font type |
91 | * @POPPLER_FONT_TYPE_TRUETYPEOT: TrueType font type embedded in OpenType font program |
92 | * @POPPLER_FONT_TYPE_CID_TYPE0: CIDFont type based on Type 1 font technology |
93 | * @POPPLER_FONT_TYPE_CID_TYPE0C: CIDFont type based on Type 1 font technology embedded in CFF font program |
94 | * @POPPLER_FONT_TYPE_CID_TYPE0COT: CIDFont type based on Type 1 font technology embedded in OpenType font program |
95 | * @POPPLER_FONT_TYPE_CID_TYPE2: CIDFont type based on TrueType font technology |
96 | * @POPPLER_FONT_TYPE_CID_TYPE2OT: CIDFont type based on TrueType font technology embedded in OpenType font program |
97 | * |
98 | * Font types |
99 | */ |
100 | typedef enum |
101 | { |
102 | POPPLER_FONT_TYPE_UNKNOWN, |
103 | POPPLER_FONT_TYPE_TYPE1, |
104 | POPPLER_FONT_TYPE_TYPE1C, |
105 | POPPLER_FONT_TYPE_TYPE1COT, |
106 | POPPLER_FONT_TYPE_TYPE3, |
107 | POPPLER_FONT_TYPE_TRUETYPE, |
108 | POPPLER_FONT_TYPE_TRUETYPEOT, |
109 | POPPLER_FONT_TYPE_CID_TYPE0, |
110 | POPPLER_FONT_TYPE_CID_TYPE0C, |
111 | POPPLER_FONT_TYPE_CID_TYPE0COT, |
112 | POPPLER_FONT_TYPE_CID_TYPE2, |
113 | POPPLER_FONT_TYPE_CID_TYPE2OT |
114 | } PopplerFontType; |
115 | |
116 | /** |
117 | * PopplerViewerPreferences: |
118 | * @POPPLER_VIEWER_PREFERENCES_UNSET: no preferences set |
119 | * @POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR: hider toolbars when document is active |
120 | * @POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR: hide menu bar when document is active |
121 | * @POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI: hide UI elements in document's window |
122 | * @POPPLER_VIEWER_PREFERENCES_FIT_WINDOW: resize document's window to fit the size of the first displayed page |
123 | * @POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW: position the document's window in the center of the screen |
124 | * @POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE: display document title in window's title bar |
125 | * @POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL: the predominant reading order for text is right to left |
126 | * |
127 | * Viewer preferences |
128 | */ |
129 | typedef enum /*< flags >*/ |
130 | { |
131 | POPPLER_VIEWER_PREFERENCES_UNSET = 0, |
132 | POPPLER_VIEWER_PREFERENCES_HIDE_TOOLBAR = 1 << 0, |
133 | = 1 << 1, |
134 | POPPLER_VIEWER_PREFERENCES_HIDE_WINDOWUI = 1 << 2, |
135 | POPPLER_VIEWER_PREFERENCES_FIT_WINDOW = 1 << 3, |
136 | POPPLER_VIEWER_PREFERENCES_CENTER_WINDOW = 1 << 4, |
137 | POPPLER_VIEWER_PREFERENCES_DISPLAY_DOC_TITLE = 1 << 5, |
138 | POPPLER_VIEWER_PREFERENCES_DIRECTION_RTL = 1 << 6 |
139 | } PopplerViewerPreferences; |
140 | |
141 | /** |
142 | * PopplerPrintScaling: |
143 | * @POPPLER_PRINT_SCALING_APP_DEFAULT: application's default page scaling |
144 | * @POPPLER_PRINT_SCALING_NONE: no page scaling |
145 | * |
146 | * PrintScaling viewer preference |
147 | * |
148 | * Since: 0.73 |
149 | */ |
150 | typedef enum |
151 | { |
152 | POPPLER_PRINT_SCALING_APP_DEFAULT, |
153 | POPPLER_PRINT_SCALING_NONE |
154 | } PopplerPrintScaling; |
155 | |
156 | /** |
157 | * PopplerPrintDuplex: |
158 | * @POPPLER_PRINT_DUPLEX_NONE: No preference on duplex printing |
159 | * @POPPLER_PRINT_DUPLEX_SIMPLEX: Print single-sided |
160 | * @POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_SHORT_EDGE: Duplex and flip on the short edge of the sheet |
161 | * @POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_LONG_EDGE: Duplex and flip on the long edge of the sheet |
162 | * |
163 | * Duplex viewer preference |
164 | * |
165 | * Since: 0.80 |
166 | */ |
167 | typedef enum |
168 | { |
169 | POPPLER_PRINT_DUPLEX_NONE, |
170 | POPPLER_PRINT_DUPLEX_SIMPLEX, |
171 | POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_SHORT_EDGE, |
172 | POPPLER_PRINT_DUPLEX_DUPLEX_FLIP_LONG_EDGE |
173 | } PopplerPrintDuplex; |
174 | |
175 | /** |
176 | * PopplerPermissions: |
177 | * @POPPLER_PERMISSIONS_OK_TO_PRINT: document can be printer |
178 | * @POPPLER_PERMISSIONS_OK_TO_MODIFY: document contents can be modified |
179 | * @POPPLER_PERMISSIONS_OK_TO_COPY: document can be copied |
180 | * @POPPLER_PERMISSIONS_OK_TO_ADD_NOTES: annotations can added to the document |
181 | * @POPPLER_PERMISSIONS_OK_TO_FILL_FORM: interactive form fields can be filled in |
182 | * @POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS: extract text and graphics |
183 | * (in support of accessibility to users with disabilities or for other purposes). Since 0.18 |
184 | * @POPPLER_PERMISSIONS_OK_TO_ASSEMBLE: assemble the document (insert, rotate, or delete pages and create |
185 | * bookmarks or thumbnail images). Since 0.18 |
186 | * @POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION: document can be printer at high resolution. Since 0.18 |
187 | * @POPPLER_PERMISSIONS_FULL: document permits all operations |
188 | * |
189 | * Permissions |
190 | */ |
191 | /* clang-format off */ |
192 | typedef enum /*< flags >*/ |
193 | { |
194 | POPPLER_PERMISSIONS_OK_TO_PRINT = 1 << 0, |
195 | POPPLER_PERMISSIONS_OK_TO_MODIFY = 1 << 1, |
196 | POPPLER_PERMISSIONS_OK_TO_COPY = 1 << 2, |
197 | POPPLER_PERMISSIONS_OK_TO_ADD_NOTES = 1 << 3, |
198 | POPPLER_PERMISSIONS_OK_TO_FILL_FORM = 1 << 4, |
199 | = 1 << 5, |
200 | POPPLER_PERMISSIONS_OK_TO_ASSEMBLE = 1 << 6, |
201 | POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION = 1 << 7, |
202 | POPPLER_PERMISSIONS_FULL = (POPPLER_PERMISSIONS_OK_TO_PRINT | POPPLER_PERMISSIONS_OK_TO_MODIFY | POPPLER_PERMISSIONS_OK_TO_COPY | POPPLER_PERMISSIONS_OK_TO_ADD_NOTES | POPPLER_PERMISSIONS_OK_TO_FILL_FORM | POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS | POPPLER_PERMISSIONS_OK_TO_ASSEMBLE | POPPLER_PERMISSIONS_OK_TO_PRINT_HIGH_RESOLUTION) |
203 | |
204 | } PopplerPermissions; |
205 | /* clang-format on */ |
206 | |
207 | /** |
208 | * PopplerPDFSubtype: |
209 | * @POPPLER_PDF_SUBTYPE_UNSET: Null |
210 | * @POPPLER_PDF_SUBTYPE_PDF_A: ISO 19005 - Document management -- Electronic document file format for long-term preservation (PDF/A) |
211 | * @POPPLER_PDF_SUBTYPE_PDF_E: ISO 24517 - Document management -- Engineering document format using PDF (PDF/E) |
212 | * @POPPLER_PDF_SUBTYPE_PDF_UA: ISO 14289 - Document management applications -- Electronic document file format enhancement for accessibility (PDF/UA) |
213 | * @POPPLER_PDF_SUBTYPE_PDF_VT: ISO 16612 - Graphic technology -- Variable data exchange (PDF/VT) |
214 | * @POPPLER_PDF_SUBTYPE_PDF_X: ISO 15930 - Graphic technology -- Prepress digital data exchange (PDF/X) |
215 | * @POPPLER_PDF_SUBTYPE_NONE: Not compliant with the above standards |
216 | * |
217 | * PDF Subtype |
218 | * |
219 | * Since: 0.70 |
220 | */ |
221 | typedef enum |
222 | { |
223 | POPPLER_PDF_SUBTYPE_UNSET, |
224 | POPPLER_PDF_SUBTYPE_PDF_A, |
225 | POPPLER_PDF_SUBTYPE_PDF_E, |
226 | POPPLER_PDF_SUBTYPE_PDF_UA, |
227 | POPPLER_PDF_SUBTYPE_PDF_VT, |
228 | POPPLER_PDF_SUBTYPE_PDF_X, |
229 | POPPLER_PDF_SUBTYPE_NONE |
230 | } PopplerPDFSubtype; |
231 | |
232 | /** |
233 | * PopplerPDFPart: |
234 | * @POPPLER_PDF_SUBTYPE_PART_UNSET: Null |
235 | * @POPPLER_PDF_SUBTYPE_PART_1: 1 |
236 | * @POPPLER_PDF_SUBTYPE_PART_2: 2 |
237 | * @POPPLER_PDF_SUBTYPE_PART_3: 3 |
238 | * @POPPLER_PDF_SUBTYPE_PART_4: 4 |
239 | * @POPPLER_PDF_SUBTYPE_PART_5: 5 |
240 | * @POPPLER_PDF_SUBTYPE_PART_6: 6 |
241 | * @POPPLER_PDF_SUBTYPE_PART_7: 7 |
242 | * @POPPLER_PDF_SUBTYPE_PART_8: 8 |
243 | * @POPPLER_PDF_SUBTYPE_PART_NONE: No part available |
244 | * |
245 | * PDF Subtype Part |
246 | * |
247 | * Since: 0.70 |
248 | */ |
249 | typedef enum |
250 | { |
251 | POPPLER_PDF_SUBTYPE_PART_UNSET, |
252 | POPPLER_PDF_SUBTYPE_PART_1, |
253 | POPPLER_PDF_SUBTYPE_PART_2, |
254 | POPPLER_PDF_SUBTYPE_PART_3, |
255 | POPPLER_PDF_SUBTYPE_PART_4, |
256 | POPPLER_PDF_SUBTYPE_PART_5, |
257 | POPPLER_PDF_SUBTYPE_PART_6, |
258 | POPPLER_PDF_SUBTYPE_PART_7, |
259 | POPPLER_PDF_SUBTYPE_PART_8, |
260 | POPPLER_PDF_SUBTYPE_PART_NONE |
261 | } PopplerPDFPart; |
262 | |
263 | /** |
264 | * PopplerPDFConformance: |
265 | * @POPPLER_PDF_SUBTYPE_CONF_UNSET: Null |
266 | * @POPPLER_PDF_SUBTYPE_CONF_A: Level A (accessible) conformance (PDF/A) |
267 | * @POPPLER_PDF_SUBTYPE_CONF_B: Level B (basic) conformance (PDF/A) |
268 | * @POPPLER_PDF_SUBTYPE_CONF_G: Level G (external graphical content) (PDF/X) |
269 | * @POPPLER_PDF_SUBTYPE_CONF_N: Level N (external ICC Profile) (PDF/X) |
270 | * @POPPLER_PDF_SUBTYPE_CONF_P: Level P (ICC Profile) (PDF/X) |
271 | * @POPPLER_PDF_SUBTYPE_CONF_PG: Level PG (conjunction of P and G) (PDF/X) |
272 | * @POPPLER_PDF_SUBTYPE_CONF_U: Level U (Unicode) conformance (PDF/A) |
273 | * @POPPLER_PDF_SUBTYPE_CONF_NONE: No conformance level available |
274 | * |
275 | * PDF Subtype Conformance |
276 | * |
277 | * Since: 0.70 |
278 | */ |
279 | typedef enum |
280 | { |
281 | POPPLER_PDF_SUBTYPE_CONF_UNSET, |
282 | POPPLER_PDF_SUBTYPE_CONF_A, |
283 | POPPLER_PDF_SUBTYPE_CONF_B, |
284 | POPPLER_PDF_SUBTYPE_CONF_G, |
285 | POPPLER_PDF_SUBTYPE_CONF_N, |
286 | POPPLER_PDF_SUBTYPE_CONF_P, |
287 | POPPLER_PDF_SUBTYPE_CONF_PG, |
288 | POPPLER_PDF_SUBTYPE_CONF_U, |
289 | POPPLER_PDF_SUBTYPE_CONF_NONE |
290 | } PopplerPDFConformance; |
291 | |
292 | POPPLER_PUBLIC |
293 | GType poppler_document_get_type(void) G_GNUC_CONST; |
294 | |
295 | POPPLER_PUBLIC |
296 | PopplerDocument *poppler_document_new_from_file(const char *uri, const char *password, GError **error); |
297 | POPPLER_PUBLIC |
298 | PopplerDocument *poppler_document_new_from_data(char *data, int length, const char *password, GError **error) G_GNUC_DEPRECATED_FOR(poppler_document_new_from_bytes); |
299 | POPPLER_PUBLIC |
300 | PopplerDocument *poppler_document_new_from_bytes(GBytes *bytes, const char *password, GError **error); |
301 | POPPLER_PUBLIC |
302 | PopplerDocument *poppler_document_new_from_stream(GInputStream *stream, goffset length, const char *password, GCancellable *cancellable, GError **error); |
303 | POPPLER_PUBLIC |
304 | PopplerDocument *poppler_document_new_from_gfile(GFile *file, const char *password, GCancellable *cancellable, GError **error); |
305 | #ifndef G_OS_WIN32 |
306 | POPPLER_PUBLIC |
307 | PopplerDocument *poppler_document_new_from_fd(int fd, const char *password, GError **error); |
308 | #endif |
309 | POPPLER_PUBLIC |
310 | gboolean poppler_document_save(PopplerDocument *document, const char *uri, GError **error); |
311 | POPPLER_PUBLIC |
312 | gboolean poppler_document_save_a_copy(PopplerDocument *document, const char *uri, GError **error); |
313 | #ifndef G_OS_WIN32 |
314 | POPPLER_PUBLIC |
315 | gboolean poppler_document_save_to_fd(PopplerDocument *document, int fd, gboolean include_changes, GError **error); |
316 | #endif |
317 | POPPLER_PUBLIC |
318 | gboolean poppler_document_get_id(PopplerDocument *document, gchar **permanent_id, gchar **update_id); |
319 | POPPLER_PUBLIC |
320 | int poppler_document_get_n_pages(PopplerDocument *document); |
321 | POPPLER_PUBLIC |
322 | PopplerPage *poppler_document_get_page(PopplerDocument *document, int index); |
323 | POPPLER_PUBLIC |
324 | PopplerPage *poppler_document_get_page_by_label(PopplerDocument *document, const char *label); |
325 | POPPLER_PUBLIC |
326 | gchar *poppler_document_get_pdf_version_string(PopplerDocument *document); |
327 | POPPLER_PUBLIC |
328 | void poppler_document_get_pdf_version(PopplerDocument *document, guint *major_version, guint *minor_version); |
329 | POPPLER_PUBLIC |
330 | gchar *poppler_document_get_title(PopplerDocument *document); |
331 | POPPLER_PUBLIC |
332 | void poppler_document_set_title(PopplerDocument *document, const gchar *title); |
333 | POPPLER_PUBLIC |
334 | gchar *poppler_document_get_author(PopplerDocument *document); |
335 | POPPLER_PUBLIC |
336 | void poppler_document_set_author(PopplerDocument *document, const gchar *author); |
337 | POPPLER_PUBLIC |
338 | gchar *poppler_document_get_subject(PopplerDocument *document); |
339 | POPPLER_PUBLIC |
340 | void poppler_document_set_subject(PopplerDocument *document, const gchar *subject); |
341 | POPPLER_PUBLIC |
342 | gchar *poppler_document_get_keywords(PopplerDocument *document); |
343 | POPPLER_PUBLIC |
344 | void poppler_document_set_keywords(PopplerDocument *document, const gchar *keywords); |
345 | POPPLER_PUBLIC |
346 | gchar *poppler_document_get_creator(PopplerDocument *document); |
347 | POPPLER_PUBLIC |
348 | void poppler_document_set_creator(PopplerDocument *document, const gchar *creator); |
349 | POPPLER_PUBLIC |
350 | gchar *poppler_document_get_producer(PopplerDocument *document); |
351 | POPPLER_PUBLIC |
352 | void poppler_document_set_producer(PopplerDocument *document, const gchar *producer); |
353 | POPPLER_PUBLIC |
354 | time_t poppler_document_get_creation_date(PopplerDocument *document); |
355 | POPPLER_PUBLIC |
356 | void poppler_document_set_creation_date(PopplerDocument *document, time_t creation_date); |
357 | POPPLER_PUBLIC |
358 | GDateTime *poppler_document_get_creation_date_time(PopplerDocument *document); |
359 | POPPLER_PUBLIC |
360 | void poppler_document_set_creation_date_time(PopplerDocument *document, GDateTime *creation_datetime); |
361 | POPPLER_PUBLIC |
362 | time_t poppler_document_get_modification_date(PopplerDocument *document); |
363 | POPPLER_PUBLIC |
364 | void poppler_document_set_modification_date(PopplerDocument *document, time_t modification_date); |
365 | POPPLER_PUBLIC |
366 | GDateTime *poppler_document_get_modification_date_time(PopplerDocument *document); |
367 | POPPLER_PUBLIC |
368 | void poppler_document_set_modification_date_time(PopplerDocument *document, GDateTime *modification_datetime); |
369 | POPPLER_PUBLIC |
370 | gboolean poppler_document_is_linearized(PopplerDocument *document); |
371 | POPPLER_PUBLIC |
372 | PopplerPageLayout poppler_document_get_page_layout(PopplerDocument *document); |
373 | POPPLER_PUBLIC |
374 | PopplerPageMode poppler_document_get_page_mode(PopplerDocument *document); |
375 | POPPLER_PUBLIC |
376 | PopplerPermissions poppler_document_get_permissions(PopplerDocument *document); |
377 | POPPLER_PUBLIC |
378 | gchar *poppler_document_get_pdf_subtype_string(PopplerDocument *document); |
379 | POPPLER_PUBLIC |
380 | PopplerPDFSubtype poppler_document_get_pdf_subtype(PopplerDocument *document); |
381 | POPPLER_PUBLIC |
382 | PopplerPDFPart poppler_document_get_pdf_part(PopplerDocument *document); |
383 | POPPLER_PUBLIC |
384 | PopplerPDFConformance poppler_document_get_pdf_conformance(PopplerDocument *document); |
385 | POPPLER_PUBLIC |
386 | gchar *poppler_document_get_metadata(PopplerDocument *document); |
387 | POPPLER_PUBLIC |
388 | PopplerPrintScaling poppler_document_get_print_scaling(PopplerDocument *document); |
389 | POPPLER_PUBLIC |
390 | PopplerPrintDuplex poppler_document_get_print_duplex(PopplerDocument *document); |
391 | POPPLER_PUBLIC |
392 | gint poppler_document_get_print_n_copies(PopplerDocument *document); |
393 | POPPLER_PUBLIC |
394 | PopplerPageRange *poppler_document_get_print_page_ranges(PopplerDocument *document, int *n_ranges) G_GNUC_MALLOC; |
395 | |
396 | /* Attachments */ |
397 | POPPLER_PUBLIC |
398 | guint poppler_document_get_n_attachments(PopplerDocument *document); |
399 | POPPLER_PUBLIC |
400 | gboolean poppler_document_has_attachments(PopplerDocument *document); |
401 | POPPLER_PUBLIC |
402 | GList *poppler_document_get_attachments(PopplerDocument *document); |
403 | |
404 | /* Links */ |
405 | POPPLER_PUBLIC |
406 | PopplerDest *poppler_document_find_dest(PopplerDocument *document, const gchar *link_name); |
407 | POPPLER_PUBLIC |
408 | GTree *poppler_document_create_dests_tree(PopplerDocument *document); |
409 | |
410 | /* Form */ |
411 | POPPLER_PUBLIC |
412 | PopplerFormField *poppler_document_get_form_field(PopplerDocument *document, gint id); |
413 | |
414 | POPPLER_PUBLIC |
415 | void poppler_document_reset_form(PopplerDocument *document, GList *fields, gboolean exclude_fields); |
416 | /* Javascript */ |
417 | POPPLER_PUBLIC |
418 | gboolean poppler_document_has_javascript(PopplerDocument *document); |
419 | |
420 | /* Signatures */ |
421 | POPPLER_PUBLIC |
422 | GList *poppler_document_get_signature_fields(PopplerDocument *document); |
423 | POPPLER_PUBLIC |
424 | gint poppler_document_get_n_signatures(const PopplerDocument *document); |
425 | |
426 | /* Interface for getting the Index of a poppler_document */ |
427 | #define POPPLER_TYPE_INDEX_ITER (poppler_index_iter_get_type()) |
428 | POPPLER_PUBLIC |
429 | GType poppler_index_iter_get_type(void) G_GNUC_CONST; |
430 | POPPLER_PUBLIC |
431 | PopplerIndexIter *poppler_index_iter_new(PopplerDocument *document); |
432 | POPPLER_PUBLIC |
433 | PopplerIndexIter *poppler_index_iter_copy(PopplerIndexIter *iter); |
434 | POPPLER_PUBLIC |
435 | void poppler_index_iter_free(PopplerIndexIter *iter); |
436 | |
437 | POPPLER_PUBLIC |
438 | PopplerIndexIter *poppler_index_iter_get_child(PopplerIndexIter *parent); |
439 | POPPLER_PUBLIC |
440 | gboolean poppler_index_iter_is_open(PopplerIndexIter *iter); |
441 | POPPLER_PUBLIC |
442 | PopplerAction *poppler_index_iter_get_action(PopplerIndexIter *iter); |
443 | POPPLER_PUBLIC |
444 | gboolean poppler_index_iter_next(PopplerIndexIter *iter); |
445 | |
446 | /* Interface for getting the Fonts of a poppler_document */ |
447 | #define POPPLER_TYPE_FONT_INFO (poppler_font_info_get_type()) |
448 | #define POPPLER_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_FONT_INFO, PopplerFontInfo)) |
449 | #define POPPLER_IS_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), POPPLER_TYPE_FONT_INFO)) |
450 | POPPLER_PUBLIC |
451 | GType poppler_font_info_get_type(void) G_GNUC_CONST; |
452 | POPPLER_PUBLIC |
453 | PopplerFontInfo *poppler_font_info_new(PopplerDocument *document); |
454 | POPPLER_PUBLIC |
455 | gboolean poppler_font_info_scan(PopplerFontInfo *font_info, int n_pages, PopplerFontsIter **iter); |
456 | POPPLER_PUBLIC |
457 | void poppler_font_info_free(PopplerFontInfo *font_info); |
458 | |
459 | #define POPPLER_TYPE_FONTS_ITER (poppler_fonts_iter_get_type()) |
460 | POPPLER_PUBLIC |
461 | GType poppler_fonts_iter_get_type(void) G_GNUC_CONST; |
462 | POPPLER_PUBLIC |
463 | PopplerFontsIter *poppler_fonts_iter_copy(PopplerFontsIter *iter); |
464 | POPPLER_PUBLIC |
465 | void poppler_fonts_iter_free(PopplerFontsIter *iter); |
466 | POPPLER_PUBLIC |
467 | const char *poppler_fonts_iter_get_name(PopplerFontsIter *iter); |
468 | POPPLER_PUBLIC |
469 | const char *poppler_fonts_iter_get_full_name(PopplerFontsIter *iter); |
470 | POPPLER_PUBLIC |
471 | const char *poppler_fonts_iter_get_substitute_name(PopplerFontsIter *iter); |
472 | POPPLER_PUBLIC |
473 | const char *poppler_fonts_iter_get_file_name(PopplerFontsIter *iter); |
474 | POPPLER_PUBLIC |
475 | PopplerFontType poppler_fonts_iter_get_font_type(PopplerFontsIter *iter); |
476 | POPPLER_PUBLIC |
477 | const char *poppler_fonts_iter_get_encoding(PopplerFontsIter *iter); |
478 | POPPLER_PUBLIC |
479 | gboolean poppler_fonts_iter_is_embedded(PopplerFontsIter *iter); |
480 | POPPLER_PUBLIC |
481 | gboolean poppler_fonts_iter_is_subset(PopplerFontsIter *iter); |
482 | POPPLER_PUBLIC |
483 | gboolean poppler_fonts_iter_next(PopplerFontsIter *iter); |
484 | |
485 | /* Interface for getting the Layers of a poppler_document */ |
486 | #define POPPLER_TYPE_LAYERS_ITER (poppler_layers_iter_get_type()) |
487 | POPPLER_PUBLIC |
488 | GType poppler_layers_iter_get_type(void) G_GNUC_CONST; |
489 | POPPLER_PUBLIC |
490 | PopplerLayersIter *poppler_layers_iter_new(PopplerDocument *document); |
491 | POPPLER_PUBLIC |
492 | PopplerLayersIter *poppler_layers_iter_copy(PopplerLayersIter *iter); |
493 | POPPLER_PUBLIC |
494 | void poppler_layers_iter_free(PopplerLayersIter *iter); |
495 | |
496 | POPPLER_PUBLIC |
497 | PopplerLayersIter *poppler_layers_iter_get_child(PopplerLayersIter *parent); |
498 | POPPLER_PUBLIC |
499 | gchar *poppler_layers_iter_get_title(PopplerLayersIter *iter); |
500 | POPPLER_PUBLIC |
501 | PopplerLayer *poppler_layers_iter_get_layer(PopplerLayersIter *iter); |
502 | POPPLER_PUBLIC |
503 | gboolean poppler_layers_iter_next(PopplerLayersIter *iter); |
504 | |
505 | /* Export to ps */ |
506 | #define POPPLER_TYPE_PS_FILE (poppler_ps_file_get_type()) |
507 | #define POPPLER_PS_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_PS_FILE, PopplerPSFile)) |
508 | #define POPPLER_IS_PS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), POPPLER_TYPE_PS_FILE)) |
509 | POPPLER_PUBLIC |
510 | GType poppler_ps_file_get_type(void) G_GNUC_CONST; |
511 | POPPLER_PUBLIC |
512 | PopplerPSFile *poppler_ps_file_new(PopplerDocument *document, const char *filename, int first_page, int n_pages); |
513 | #ifndef G_OS_WIN32 |
514 | POPPLER_PUBLIC |
515 | PopplerPSFile *poppler_ps_file_new_fd(PopplerDocument *document, int fd, int first_page, int n_pages); |
516 | #endif |
517 | POPPLER_PUBLIC |
518 | void poppler_ps_file_set_paper_size(PopplerPSFile *ps_file, double width, double height); |
519 | POPPLER_PUBLIC |
520 | void poppler_ps_file_set_duplex(PopplerPSFile *ps_file, gboolean duplex); |
521 | POPPLER_PUBLIC |
522 | void poppler_ps_file_free(PopplerPSFile *ps_file); |
523 | |
524 | POPPLER_PUBLIC |
525 | void poppler_document_sign(PopplerDocument *document, const PopplerSigningData *signing_data, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data); |
526 | POPPLER_PUBLIC |
527 | gboolean poppler_document_sign_finish(PopplerDocument *document, GAsyncResult *result, GError **error); |
528 | |
529 | /** |
530 | * PopplerPageRange: |
531 | * @start_page: first page in the range of pages |
532 | * @end_page: last page in the range of pages |
533 | * |
534 | * A #PopplerPageRange is used to specify a range of pages. |
535 | * |
536 | * Since: 0.80 |
537 | */ |
538 | struct |
539 | { |
540 | gint ; |
541 | gint ; |
542 | }; |
543 | |
544 | G_END_DECLS |
545 | |
546 | #endif /* __POPPLER_DOCUMENT_H__ */ |
547 | |