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 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 POPPLER_VIEWER_PREFERENCES_HIDE_MENUBAR = 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 POPPLER_PERMISSIONS_OK_TO_EXTRACT_CONTENTS = 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 POPPLER_PUBLIC 306 PopplerDocument *poppler_document_new_from_fd(int fd, const char *password, GError **error); 307 POPPLER_PUBLIC 308 gboolean poppler_document_save(PopplerDocument *document, const char *uri, GError **error); 309 POPPLER_PUBLIC 310 gboolean poppler_document_save_a_copy(PopplerDocument *document, const char *uri, GError **error); 311 POPPLER_PUBLIC 312 gboolean poppler_document_save_to_fd(PopplerDocument *document, int fd, gboolean include_changes, GError **error); 313 POPPLER_PUBLIC 314 gboolean poppler_document_get_id(PopplerDocument *document, gchar **permanent_id, gchar **update_id); 315 POPPLER_PUBLIC 316 int poppler_document_get_n_pages(PopplerDocument *document); 317 POPPLER_PUBLIC 318 PopplerPage *poppler_document_get_page(PopplerDocument *document, int index); 319 POPPLER_PUBLIC 320 PopplerPage *poppler_document_get_page_by_label(PopplerDocument *document, const char *label); 321 POPPLER_PUBLIC 322 gchar *poppler_document_get_pdf_version_string(PopplerDocument *document); 323 POPPLER_PUBLIC 324 void poppler_document_get_pdf_version(PopplerDocument *document, guint *major_version, guint *minor_version); 325 POPPLER_PUBLIC 326 gchar *poppler_document_get_title(PopplerDocument *document); 327 POPPLER_PUBLIC 328 void poppler_document_set_title(PopplerDocument *document, const gchar *title); 329 POPPLER_PUBLIC 330 gchar *poppler_document_get_author(PopplerDocument *document); 331 POPPLER_PUBLIC 332 void poppler_document_set_author(PopplerDocument *document, const gchar *author); 333 POPPLER_PUBLIC 334 gchar *poppler_document_get_subject(PopplerDocument *document); 335 POPPLER_PUBLIC 336 void poppler_document_set_subject(PopplerDocument *document, const gchar *subject); 337 POPPLER_PUBLIC 338 gchar *poppler_document_get_keywords(PopplerDocument *document); 339 POPPLER_PUBLIC 340 void poppler_document_set_keywords(PopplerDocument *document, const gchar *keywords); 341 POPPLER_PUBLIC 342 gchar *poppler_document_get_creator(PopplerDocument *document); 343 POPPLER_PUBLIC 344 void poppler_document_set_creator(PopplerDocument *document, const gchar *creator); 345 POPPLER_PUBLIC 346 gchar *poppler_document_get_producer(PopplerDocument *document); 347 POPPLER_PUBLIC 348 void poppler_document_set_producer(PopplerDocument *document, const gchar *producer); 349 POPPLER_PUBLIC 350 time_t poppler_document_get_creation_date(PopplerDocument *document); 351 POPPLER_PUBLIC 352 void poppler_document_set_creation_date(PopplerDocument *document, time_t creation_date); 353 POPPLER_PUBLIC 354 GDateTime *poppler_document_get_creation_date_time(PopplerDocument *document); 355 POPPLER_PUBLIC 356 void poppler_document_set_creation_date_time(PopplerDocument *document, GDateTime *creation_datetime); 357 POPPLER_PUBLIC 358 time_t poppler_document_get_modification_date(PopplerDocument *document); 359 POPPLER_PUBLIC 360 void poppler_document_set_modification_date(PopplerDocument *document, time_t modification_date); 361 POPPLER_PUBLIC 362 GDateTime *poppler_document_get_modification_date_time(PopplerDocument *document); 363 POPPLER_PUBLIC 364 void poppler_document_set_modification_date_time(PopplerDocument *document, GDateTime *modification_datetime); 365 POPPLER_PUBLIC 366 gboolean poppler_document_is_linearized(PopplerDocument *document); 367 POPPLER_PUBLIC 368 PopplerPageLayout poppler_document_get_page_layout(PopplerDocument *document); 369 POPPLER_PUBLIC 370 PopplerPageMode poppler_document_get_page_mode(PopplerDocument *document); 371 POPPLER_PUBLIC 372 PopplerPermissions poppler_document_get_permissions(PopplerDocument *document); 373 POPPLER_PUBLIC 374 gchar *poppler_document_get_pdf_subtype_string(PopplerDocument *document); 375 POPPLER_PUBLIC 376 PopplerPDFSubtype poppler_document_get_pdf_subtype(PopplerDocument *document); 377 POPPLER_PUBLIC 378 PopplerPDFPart poppler_document_get_pdf_part(PopplerDocument *document); 379 POPPLER_PUBLIC 380 PopplerPDFConformance poppler_document_get_pdf_conformance(PopplerDocument *document); 381 POPPLER_PUBLIC 382 gchar *poppler_document_get_metadata(PopplerDocument *document); 383 POPPLER_PUBLIC 384 PopplerPrintScaling poppler_document_get_print_scaling(PopplerDocument *document); 385 POPPLER_PUBLIC 386 PopplerPrintDuplex poppler_document_get_print_duplex(PopplerDocument *document); 387 POPPLER_PUBLIC 388 gint poppler_document_get_print_n_copies(PopplerDocument *document); 389 POPPLER_PUBLIC 390 PopplerPageRange *poppler_document_get_print_page_ranges(PopplerDocument *document, int *n_ranges) G_GNUC_MALLOC; 391 392 /* Attachments */ 393 POPPLER_PUBLIC 394 guint poppler_document_get_n_attachments(PopplerDocument *document); 395 POPPLER_PUBLIC 396 gboolean poppler_document_has_attachments(PopplerDocument *document); 397 POPPLER_PUBLIC 398 GList *poppler_document_get_attachments(PopplerDocument *document); 399 400 /* Links */ 401 POPPLER_PUBLIC 402 PopplerDest *poppler_document_find_dest(PopplerDocument *document, const gchar *link_name); 403 POPPLER_PUBLIC 404 GTree *poppler_document_create_dests_tree(PopplerDocument *document); 405 406 /* Form */ 407 POPPLER_PUBLIC 408 PopplerFormField *poppler_document_get_form_field(PopplerDocument *document, gint id); 409 410 POPPLER_PUBLIC 411 void poppler_document_reset_form(PopplerDocument *document, GList *fields, gboolean exclude_fields); 412 /* Javascript */ 413 POPPLER_PUBLIC 414 gboolean poppler_document_has_javascript(PopplerDocument *document); 415 416 /* Signatures */ 417 POPPLER_PUBLIC 418 gint poppler_document_get_n_signatures(const PopplerDocument *document); 419 420 /* Interface for getting the Index of a poppler_document */ 421 #define POPPLER_TYPE_INDEX_ITER (poppler_index_iter_get_type()) 422 POPPLER_PUBLIC 423 GType poppler_index_iter_get_type(void) G_GNUC_CONST; 424 POPPLER_PUBLIC 425 PopplerIndexIter *poppler_index_iter_new(PopplerDocument *document); 426 POPPLER_PUBLIC 427 PopplerIndexIter *poppler_index_iter_copy(PopplerIndexIter *iter); 428 POPPLER_PUBLIC 429 void poppler_index_iter_free(PopplerIndexIter *iter); 430 431 POPPLER_PUBLIC 432 PopplerIndexIter *poppler_index_iter_get_child(PopplerIndexIter *parent); 433 POPPLER_PUBLIC 434 gboolean poppler_index_iter_is_open(PopplerIndexIter *iter); 435 POPPLER_PUBLIC 436 PopplerAction *poppler_index_iter_get_action(PopplerIndexIter *iter); 437 POPPLER_PUBLIC 438 gboolean poppler_index_iter_next(PopplerIndexIter *iter); 439 440 /* Interface for getting the Fonts of a poppler_document */ 441 #define POPPLER_TYPE_FONT_INFO (poppler_font_info_get_type()) 442 #define POPPLER_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_FONT_INFO, PopplerFontInfo)) 443 #define POPPLER_IS_FONT_INFO(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), POPPLER_TYPE_FONT_INFO)) 444 POPPLER_PUBLIC 445 GType poppler_font_info_get_type(void) G_GNUC_CONST; 446 POPPLER_PUBLIC 447 PopplerFontInfo *poppler_font_info_new(PopplerDocument *document); 448 POPPLER_PUBLIC 449 gboolean poppler_font_info_scan(PopplerFontInfo *font_info, int n_pages, PopplerFontsIter **iter); 450 POPPLER_PUBLIC 451 void poppler_font_info_free(PopplerFontInfo *font_info); 452 453 #define POPPLER_TYPE_FONTS_ITER (poppler_fonts_iter_get_type()) 454 POPPLER_PUBLIC 455 GType poppler_fonts_iter_get_type(void) G_GNUC_CONST; 456 POPPLER_PUBLIC 457 PopplerFontsIter *poppler_fonts_iter_copy(PopplerFontsIter *iter); 458 POPPLER_PUBLIC 459 void poppler_fonts_iter_free(PopplerFontsIter *iter); 460 POPPLER_PUBLIC 461 const char *poppler_fonts_iter_get_name(PopplerFontsIter *iter); 462 POPPLER_PUBLIC 463 const char *poppler_fonts_iter_get_full_name(PopplerFontsIter *iter); 464 POPPLER_PUBLIC 465 const char *poppler_fonts_iter_get_substitute_name(PopplerFontsIter *iter); 466 POPPLER_PUBLIC 467 const char *poppler_fonts_iter_get_file_name(PopplerFontsIter *iter); 468 POPPLER_PUBLIC 469 PopplerFontType poppler_fonts_iter_get_font_type(PopplerFontsIter *iter); 470 POPPLER_PUBLIC 471 const char *poppler_fonts_iter_get_encoding(PopplerFontsIter *iter); 472 POPPLER_PUBLIC 473 gboolean poppler_fonts_iter_is_embedded(PopplerFontsIter *iter); 474 POPPLER_PUBLIC 475 gboolean poppler_fonts_iter_is_subset(PopplerFontsIter *iter); 476 POPPLER_PUBLIC 477 gboolean poppler_fonts_iter_next(PopplerFontsIter *iter); 478 479 /* Interface for getting the Layers of a poppler_document */ 480 #define POPPLER_TYPE_LAYERS_ITER (poppler_layers_iter_get_type()) 481 POPPLER_PUBLIC 482 GType poppler_layers_iter_get_type(void) G_GNUC_CONST; 483 POPPLER_PUBLIC 484 PopplerLayersIter *poppler_layers_iter_new(PopplerDocument *document); 485 POPPLER_PUBLIC 486 PopplerLayersIter *poppler_layers_iter_copy(PopplerLayersIter *iter); 487 POPPLER_PUBLIC 488 void poppler_layers_iter_free(PopplerLayersIter *iter); 489 490 POPPLER_PUBLIC 491 PopplerLayersIter *poppler_layers_iter_get_child(PopplerLayersIter *parent); 492 POPPLER_PUBLIC 493 gchar *poppler_layers_iter_get_title(PopplerLayersIter *iter); 494 POPPLER_PUBLIC 495 PopplerLayer *poppler_layers_iter_get_layer(PopplerLayersIter *iter); 496 POPPLER_PUBLIC 497 gboolean poppler_layers_iter_next(PopplerLayersIter *iter); 498 499 /* Export to ps */ 500 #define POPPLER_TYPE_PS_FILE (poppler_ps_file_get_type()) 501 #define POPPLER_PS_FILE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), POPPLER_TYPE_PS_FILE, PopplerPSFile)) 502 #define POPPLER_IS_PS_FILE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), POPPLER_TYPE_PS_FILE)) 503 POPPLER_PUBLIC 504 GType poppler_ps_file_get_type(void) G_GNUC_CONST; 505 POPPLER_PUBLIC 506 PopplerPSFile *poppler_ps_file_new(PopplerDocument *document, const char *filename, int first_page, int n_pages); 507 POPPLER_PUBLIC 508 PopplerPSFile *poppler_ps_file_new_fd(PopplerDocument *document, int fd, int first_page, int n_pages); 509 POPPLER_PUBLIC 510 void poppler_ps_file_set_paper_size(PopplerPSFile *ps_file, double width, double height); 511 POPPLER_PUBLIC 512 void poppler_ps_file_set_duplex(PopplerPSFile *ps_file, gboolean duplex); 513 POPPLER_PUBLIC 514 void poppler_ps_file_free(PopplerPSFile *ps_file); 515 516 /** 517 * PopplerPageRange: 518 * @start_page: first page in the range of pages 519 * @end_page: last page in the range of pages 520 * 521 * A #PopplerPageRange is used to specify a range of pages. 522 * 523 * Since: 0.80 524 */ 525 struct _PopplerPageRange 526 { 527 gint start_page; 528 gint end_page; 529 }; 530 531 G_END_DECLS 532 533 #endif /* __POPPLER_DOCUMENT_H__ */ 534