poppler-document.h 21 KB

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