poppler 2.2.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.
Files changed (185) hide show
  1. checksums.yaml +7 -0
  2. data/README +35 -0
  3. data/Rakefile +75 -0
  4. data/ext/poppler/depend +6 -0
  5. data/ext/poppler/extconf.rb +70 -0
  6. data/ext/poppler/poppler.def +2 -0
  7. data/ext/poppler/rbpoppler-action.c +372 -0
  8. data/ext/poppler/rbpoppler-annotation-callout-line.c +127 -0
  9. data/ext/poppler/rbpoppler-annotation-free-text.c +46 -0
  10. data/ext/poppler/rbpoppler-annotation-mapping.c +72 -0
  11. data/ext/poppler/rbpoppler-annotation-markup.c +98 -0
  12. data/ext/poppler/rbpoppler-annotation-text.c +53 -0
  13. data/ext/poppler/rbpoppler-annotation.c +74 -0
  14. data/ext/poppler/rbpoppler-attachment.c +124 -0
  15. data/ext/poppler/rbpoppler-button-field.c +56 -0
  16. data/ext/poppler/rbpoppler-choice-field.c +131 -0
  17. data/ext/poppler/rbpoppler-color.c +107 -0
  18. data/ext/poppler/rbpoppler-document.c +224 -0
  19. data/ext/poppler/rbpoppler-font-info.c +59 -0
  20. data/ext/poppler/rbpoppler-fonts-iter.c +127 -0
  21. data/ext/poppler/rbpoppler-form-field-mapping.c +44 -0
  22. data/ext/poppler/rbpoppler-form-field.c +98 -0
  23. data/ext/poppler/rbpoppler-image-mapping.c +48 -0
  24. data/ext/poppler/rbpoppler-index-iter.c +128 -0
  25. data/ext/poppler/rbpoppler-link-mapping.c +47 -0
  26. data/ext/poppler/rbpoppler-page-transition.c +59 -0
  27. data/ext/poppler/rbpoppler-page.c +322 -0
  28. data/ext/poppler/rbpoppler-private.h +77 -0
  29. data/ext/poppler/rbpoppler-ps-file.c +66 -0
  30. data/ext/poppler/rbpoppler-rectangle.c +92 -0
  31. data/ext/poppler/rbpoppler-text-field.c +91 -0
  32. data/ext/poppler/rbpoppler.c +111 -0
  33. data/ext/poppler/rbpoppler.h +61 -0
  34. data/ext/poppler/rbpopplerconversions.h +105 -0
  35. data/extconf.rb +49 -0
  36. data/lib/2.0/poppler.so +0 -0
  37. data/lib/2.1/poppler.so +0 -0
  38. data/lib/2.2/poppler.so +0 -0
  39. data/lib/poppler.rb +105 -0
  40. data/sample/number-pdf.rb +32 -0
  41. data/sample/pdf2.rb +132 -0
  42. data/sample/pdf2svg.rb +26 -0
  43. data/sample/pdf2text.rb +16 -0
  44. data/sample/pdfcrop.rb +32 -0
  45. data/sample/pdfdiv.rb +36 -0
  46. data/test/fixtures/image.pdf +0 -0
  47. data/test/fixtures/image.png +0 -0
  48. data/test/poppler-test-utils.rb +58 -0
  49. data/test/run-test.rb +32 -0
  50. data/test/test_annotation.rb +86 -0
  51. data/test/test_color.rb +26 -0
  52. data/test/test_constants.rb +30 -0
  53. data/test/test_document.rb +41 -0
  54. data/test/test_page.rb +42 -0
  55. data/vendor/local/bin/cjpeg.exe +0 -0
  56. data/vendor/local/bin/djpeg.exe +0 -0
  57. data/vendor/local/bin/jpegtran.exe +0 -0
  58. data/vendor/local/bin/libjpeg-9.dll +0 -0
  59. data/vendor/local/bin/libpoppler-48.dll +0 -0
  60. data/vendor/local/bin/libpoppler-cpp-0.dll +0 -0
  61. data/vendor/local/bin/libpoppler-glib-8.dll +0 -0
  62. data/vendor/local/bin/libsqlite3-0.dll +0 -0
  63. data/vendor/local/bin/pdfdetach.exe +0 -0
  64. data/vendor/local/bin/pdffonts.exe +0 -0
  65. data/vendor/local/bin/pdfimages.exe +0 -0
  66. data/vendor/local/bin/pdfinfo.exe +0 -0
  67. data/vendor/local/bin/pdfseparate.exe +0 -0
  68. data/vendor/local/bin/pdftocairo.exe +0 -0
  69. data/vendor/local/bin/pdftohtml.exe +0 -0
  70. data/vendor/local/bin/pdftoppm.exe +0 -0
  71. data/vendor/local/bin/pdftops.exe +0 -0
  72. data/vendor/local/bin/pdftotext.exe +0 -0
  73. data/vendor/local/bin/pdfunite.exe +0 -0
  74. data/vendor/local/bin/rdjpgcom.exe +0 -0
  75. data/vendor/local/bin/sqlite3.exe +0 -0
  76. data/vendor/local/bin/wrjpgcom.exe +0 -0
  77. data/vendor/local/include/jconfig.h +60 -0
  78. data/vendor/local/include/jerror.h +304 -0
  79. data/vendor/local/include/jmorecfg.h +446 -0
  80. data/vendor/local/include/jpeglib.h +1180 -0
  81. data/vendor/local/include/poppler/cpp/poppler-document.h +104 -0
  82. data/vendor/local/include/poppler/cpp/poppler-embedded-file.h +55 -0
  83. data/vendor/local/include/poppler/cpp/poppler-font.h +91 -0
  84. data/vendor/local/include/poppler/cpp/poppler-global.h +111 -0
  85. data/vendor/local/include/poppler/cpp/poppler-image.h +71 -0
  86. data/vendor/local/include/poppler/cpp/poppler-page-renderer.h +66 -0
  87. data/vendor/local/include/poppler/cpp/poppler-page-transition.h +82 -0
  88. data/vendor/local/include/poppler/cpp/poppler-page.h +76 -0
  89. data/vendor/local/include/poppler/cpp/poppler-rectangle.h +84 -0
  90. data/vendor/local/include/poppler/cpp/poppler-toc.h +74 -0
  91. data/vendor/local/include/poppler/cpp/poppler-version.h +39 -0
  92. data/vendor/local/include/poppler/glib/poppler-action.h +316 -0
  93. data/vendor/local/include/poppler/glib/poppler-annot.h +296 -0
  94. data/vendor/local/include/poppler/glib/poppler-attachment.h +87 -0
  95. data/vendor/local/include/poppler/glib/poppler-date.h +30 -0
  96. data/vendor/local/include/poppler/glib/poppler-document.h +299 -0
  97. data/vendor/local/include/poppler/glib/poppler-enums.h +116 -0
  98. data/vendor/local/include/poppler/glib/poppler-features.h +88 -0
  99. data/vendor/local/include/poppler/glib/poppler-form-field.h +111 -0
  100. data/vendor/local/include/poppler/glib/poppler-layer.h +43 -0
  101. data/vendor/local/include/poppler/glib/poppler-media.h +73 -0
  102. data/vendor/local/include/poppler/glib/poppler-movie.h +42 -0
  103. data/vendor/local/include/poppler/glib/poppler-page.h +377 -0
  104. data/vendor/local/include/poppler/glib/poppler-structure-element.h +357 -0
  105. data/vendor/local/include/poppler/glib/poppler.h +250 -0
  106. data/vendor/local/include/sqlite3.h +7494 -0
  107. data/vendor/local/include/sqlite3ext.h +487 -0
  108. data/vendor/local/lib/girepository-1.0/Poppler-0.18.typelib +0 -0
  109. data/vendor/local/lib/libjpeg.a +0 -0
  110. data/vendor/local/lib/libjpeg.dll.a +0 -0
  111. data/vendor/local/lib/libjpeg.la +41 -0
  112. data/vendor/local/lib/libpoppler-cpp.a +0 -0
  113. data/vendor/local/lib/libpoppler-cpp.dll.a +0 -0
  114. data/vendor/local/lib/libpoppler-cpp.la +41 -0
  115. data/vendor/local/lib/libpoppler-glib.a +0 -0
  116. data/vendor/local/lib/libpoppler-glib.dll.a +0 -0
  117. data/vendor/local/lib/libpoppler-glib.la +41 -0
  118. data/vendor/local/lib/libpoppler.a +0 -0
  119. data/vendor/local/lib/libpoppler.dll.a +0 -0
  120. data/vendor/local/lib/libpoppler.la +41 -0
  121. data/vendor/local/lib/libsqlite3.a +0 -0
  122. data/vendor/local/lib/libsqlite3.dll.a +0 -0
  123. data/vendor/local/lib/libsqlite3.la +41 -0
  124. data/vendor/local/lib/pkgconfig/poppler-cairo.pc +9 -0
  125. data/vendor/local/lib/pkgconfig/poppler-cpp.pc +13 -0
  126. data/vendor/local/lib/pkgconfig/poppler-glib.pc +13 -0
  127. data/vendor/local/lib/pkgconfig/poppler-splash.pc +9 -0
  128. data/vendor/local/lib/pkgconfig/poppler.pc +11 -0
  129. data/vendor/local/lib/pkgconfig/sqlite3.pc +13 -0
  130. data/vendor/local/share/gir-1.0/Poppler-0.18.gir +8281 -0
  131. data/vendor/local/share/gtk-doc/html/poppler/PopplerAnnot.html +3221 -0
  132. data/vendor/local/share/gtk-doc/html/poppler/PopplerAttachment.html +267 -0
  133. data/vendor/local/share/gtk-doc/html/poppler/PopplerDocument.html +3328 -0
  134. data/vendor/local/share/gtk-doc/html/poppler/PopplerFormField.html +1403 -0
  135. data/vendor/local/share/gtk-doc/html/poppler/PopplerLayer.html +307 -0
  136. data/vendor/local/share/gtk-doc/html/poppler/PopplerMedia.html +381 -0
  137. data/vendor/local/share/gtk-doc/html/poppler/PopplerMovie.html +197 -0
  138. data/vendor/local/share/gtk-doc/html/poppler/PopplerPage.html +3002 -0
  139. data/vendor/local/share/gtk-doc/html/poppler/PopplerStructureElement.html +3781 -0
  140. data/vendor/local/share/gtk-doc/html/poppler/annotation-glossary.html +63 -0
  141. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-12.html +123 -0
  142. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-14.html +102 -0
  143. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-16.html +180 -0
  144. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-18.html +72 -0
  145. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-20.html +39 -0
  146. data/vendor/local/share/gtk-doc/html/poppler/api-index-0-22.html +64 -0
  147. data/vendor/local/share/gtk-doc/html/poppler/api-index-deprecated.html +39 -0
  148. data/vendor/local/share/gtk-doc/html/poppler/api-index-full.html +1830 -0
  149. data/vendor/local/share/gtk-doc/html/poppler/ch01.html +74 -0
  150. data/vendor/local/share/gtk-doc/html/poppler/home.png +0 -0
  151. data/vendor/local/share/gtk-doc/html/poppler/index.html +85 -0
  152. data/vendor/local/share/gtk-doc/html/poppler/index.sgml +557 -0
  153. data/vendor/local/share/gtk-doc/html/poppler/left-insensitive.png +0 -0
  154. data/vendor/local/share/gtk-doc/html/poppler/left.png +0 -0
  155. data/vendor/local/share/gtk-doc/html/poppler/poppler-PDF-Utility-functions.html +107 -0
  156. data/vendor/local/share/gtk-doc/html/poppler/poppler-PopplerAction.html +796 -0
  157. data/vendor/local/share/gtk-doc/html/poppler/poppler-PopplerColor.html +201 -0
  158. data/vendor/local/share/gtk-doc/html/poppler/poppler-Version-and-Features-Information.html +254 -0
  159. data/vendor/local/share/gtk-doc/html/poppler/poppler-poppler.html +169 -0
  160. data/vendor/local/share/gtk-doc/html/poppler/poppler.devhelp2 +470 -0
  161. data/vendor/local/share/gtk-doc/html/poppler/right-insensitive.png +0 -0
  162. data/vendor/local/share/gtk-doc/html/poppler/right.png +0 -0
  163. data/vendor/local/share/gtk-doc/html/poppler/style.css +476 -0
  164. data/vendor/local/share/gtk-doc/html/poppler/up-insensitive.png +0 -0
  165. data/vendor/local/share/gtk-doc/html/poppler/up.png +0 -0
  166. data/vendor/local/share/license/poppler/AUTHORS +5 -0
  167. data/vendor/local/share/license/poppler/COPYING +339 -0
  168. data/vendor/local/share/man/man1/cjpeg.1 +387 -0
  169. data/vendor/local/share/man/man1/djpeg.1 +252 -0
  170. data/vendor/local/share/man/man1/jpegtran.1 +293 -0
  171. data/vendor/local/share/man/man1/pdfdetach.1 +86 -0
  172. data/vendor/local/share/man/man1/pdffonts.1 +119 -0
  173. data/vendor/local/share/man/man1/pdfimages.1 +260 -0
  174. data/vendor/local/share/man/man1/pdfinfo.1 +152 -0
  175. data/vendor/local/share/man/man1/pdfseparate.1 +49 -0
  176. data/vendor/local/share/man/man1/pdftocairo.1 +295 -0
  177. data/vendor/local/share/man/man1/pdftohtml.1 +107 -0
  178. data/vendor/local/share/man/man1/pdftoppm.1 +170 -0
  179. data/vendor/local/share/man/man1/pdftops.1 +217 -0
  180. data/vendor/local/share/man/man1/pdftotext.1 +137 -0
  181. data/vendor/local/share/man/man1/pdfunite.1 +33 -0
  182. data/vendor/local/share/man/man1/rdjpgcom.1 +63 -0
  183. data/vendor/local/share/man/man1/sqlite3.1 +279 -0
  184. data/vendor/local/share/man/man1/wrjpgcom.1 +103 -0
  185. metadata +254 -0
@@ -0,0 +1,104 @@
1
+ /*
2
+ * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
3
+ *
4
+ * This program is free software; you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation; either version 2, or (at your option)
7
+ * any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ #ifndef POPPLER_DOCUMENT_H
20
+ #define POPPLER_DOCUMENT_H
21
+
22
+ #include "poppler-global.h"
23
+ #include "poppler-font.h"
24
+
25
+ namespace poppler
26
+ {
27
+
28
+ class document_private;
29
+ class embedded_file;
30
+ class page;
31
+ class toc;
32
+
33
+ class POPPLER_CPP_EXPORT document : public poppler::noncopyable
34
+ {
35
+ public:
36
+ enum page_mode_enum {
37
+ use_none,
38
+ use_outlines,
39
+ use_thumbs,
40
+ fullscreen,
41
+ use_oc,
42
+ use_attach
43
+ };
44
+
45
+ enum page_layout_enum {
46
+ no_layout,
47
+ single_page,
48
+ one_column,
49
+ two_column_left,
50
+ two_column_right,
51
+ two_page_left,
52
+ two_page_right
53
+ };
54
+
55
+ ~document();
56
+
57
+ bool is_locked() const;
58
+ bool unlock(const std::string &owner_password, const std::string &user_password);
59
+
60
+ page_mode_enum page_mode() const;
61
+ page_layout_enum page_layout() const;
62
+ void get_pdf_version(int *major, int *minor) const;
63
+ std::vector<std::string> info_keys() const;
64
+ ustring info_key(const std::string &key) const;
65
+ time_type info_date(const std::string &key) const;
66
+ bool is_encrypted() const;
67
+ bool is_linearized() const;
68
+ bool has_permission(permission_enum which) const;
69
+ ustring metadata() const;
70
+ bool get_pdf_id(std::string *permanent_id, std::string *update_id) const;
71
+
72
+ int pages() const;
73
+ page* create_page(const ustring &label) const;
74
+ page* create_page(int index) const;
75
+
76
+ std::vector<font_info> fonts() const;
77
+ font_iterator* create_font_iterator(int start_page = 0) const;
78
+
79
+ toc* create_toc() const;
80
+
81
+ bool has_embedded_files() const;
82
+ std::vector<embedded_file *> embedded_files() const;
83
+
84
+ static document* load_from_file(const std::string &file_name,
85
+ const std::string &owner_password = std::string(),
86
+ const std::string &user_password = std::string());
87
+ static document* load_from_data(byte_array *file_data,
88
+ const std::string &owner_password = std::string(),
89
+ const std::string &user_password = std::string());
90
+ static document* load_from_raw_data(const char *file_data,
91
+ int file_data_length,
92
+ const std::string &owner_password = std::string(),
93
+ const std::string &user_password = std::string());
94
+
95
+ private:
96
+ document(document_private &dd);
97
+
98
+ document_private *d;
99
+ friend class document_private;
100
+ };
101
+
102
+ }
103
+
104
+ #endif
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
3
+ *
4
+ * This program is free software; you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation; either version 2, or (at your option)
7
+ * any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ #ifndef POPPLER_EMBEDDED_FILE_H
20
+ #define POPPLER_EMBEDDED_FILE_H
21
+
22
+ #include "poppler-global.h"
23
+
24
+ #include <vector>
25
+
26
+ namespace poppler
27
+ {
28
+
29
+ class embedded_file_private;
30
+
31
+ class POPPLER_CPP_EXPORT embedded_file : public poppler::noncopyable
32
+ {
33
+ public:
34
+ ~embedded_file();
35
+
36
+ bool is_valid() const;
37
+ std::string name() const;
38
+ ustring description() const;
39
+ int size() const;
40
+ time_type modification_date() const;
41
+ time_type creation_date() const;
42
+ byte_array checksum() const;
43
+ std::string mime_type() const;
44
+ byte_array data() const;
45
+
46
+ private:
47
+ embedded_file(embedded_file_private &dd);
48
+
49
+ embedded_file_private *d;
50
+ friend class embedded_file_private;
51
+ };
52
+
53
+ }
54
+
55
+ #endif
@@ -0,0 +1,91 @@
1
+ /*
2
+ * Copyright (C) 2009, Pino Toscano <pino@kde.org>
3
+ *
4
+ * This program is free software; you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation; either version 2, or (at your option)
7
+ * any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ #ifndef POPPLER_FONT_H
20
+ #define POPPLER_FONT_H
21
+
22
+ #include "poppler-global.h"
23
+
24
+ #include <vector>
25
+
26
+ namespace poppler
27
+ {
28
+
29
+ class document;
30
+ class document_private;
31
+ class font_info_private;
32
+ class font_iterator;
33
+ class font_iterator_private;
34
+
35
+ class POPPLER_CPP_EXPORT font_info
36
+ {
37
+ public:
38
+ enum type_enum {
39
+ unknown,
40
+ type1,
41
+ type1c,
42
+ type1c_ot,
43
+ type3,
44
+ truetype,
45
+ truetype_ot,
46
+ cid_type0,
47
+ cid_type0c,
48
+ cid_type0c_ot,
49
+ cid_truetype,
50
+ cid_truetype_ot
51
+ };
52
+
53
+ font_info();
54
+ font_info(const font_info &fi);
55
+ ~font_info();
56
+
57
+ std::string name() const;
58
+ std::string file() const;
59
+ bool is_embedded() const;
60
+ bool is_subset() const;
61
+ type_enum type() const;
62
+
63
+ font_info& operator=(const font_info &fi);
64
+
65
+ private:
66
+ font_info(font_info_private &dd);
67
+
68
+ font_info_private *d;
69
+ friend class font_iterator;
70
+ };
71
+
72
+
73
+ class POPPLER_CPP_EXPORT font_iterator : public poppler::noncopyable
74
+ {
75
+ public:
76
+ ~font_iterator();
77
+
78
+ std::vector<font_info> next();
79
+ bool has_next() const;
80
+ int current_page() const;
81
+
82
+ private:
83
+ font_iterator(int, document_private *dd);
84
+
85
+ font_iterator_private *d;
86
+ friend class document;
87
+ };
88
+
89
+ }
90
+
91
+ #endif
@@ -0,0 +1,111 @@
1
+ /*
2
+ * Copyright (C) 2009-2010, Pino Toscano <pino@kde.org>
3
+ * Copyright (C) 2010, Patrick Spendrin <ps_ml@gmx.de>
4
+ *
5
+ * This program is free software; you can redistribute it and/or modify
6
+ * it under the terms of the GNU General Public License as published by
7
+ * the Free Software Foundation; either version 2, or (at your option)
8
+ * any later version.
9
+ *
10
+ * This program is distributed in the hope that it will be useful,
11
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
+ * GNU General Public License for more details.
14
+ *
15
+ * You should have received a copy of the GNU General Public License
16
+ * along with this program; if not, write to the Free Software
17
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
18
+ */
19
+
20
+ #ifndef POPPLER_GLOBAL_H
21
+ #define POPPLER_GLOBAL_H
22
+
23
+ #if defined(_WIN32)
24
+ # define LIB_EXPORT __declspec(dllexport)
25
+ # define LIB_IMPORT __declspec(dllimport)
26
+ #else
27
+ # define LIB_EXPORT
28
+ # define LIB_IMPORT
29
+ #endif
30
+
31
+ #if defined(poppler_cpp_EXPORTS)
32
+ # define POPPLER_CPP_EXPORT LIB_EXPORT
33
+ #else
34
+ # define POPPLER_CPP_EXPORT LIB_IMPORT
35
+ #endif
36
+
37
+ #include <iosfwd>
38
+ #include <string>
39
+ #include <vector>
40
+
41
+ namespace poppler
42
+ {
43
+
44
+ /// \cond DOXYGEN_SKIP_THIS
45
+ namespace detail
46
+ {
47
+
48
+ class POPPLER_CPP_EXPORT noncopyable
49
+ {
50
+ protected:
51
+ noncopyable();
52
+ ~noncopyable();
53
+ private:
54
+ noncopyable(const noncopyable &);
55
+ const noncopyable& operator=(const noncopyable &);
56
+ };
57
+
58
+ }
59
+
60
+ typedef detail::noncopyable noncopyable;
61
+ /// \endcond
62
+
63
+ enum rotation_enum { rotate_0, rotate_90, rotate_180, rotate_270 };
64
+
65
+ enum page_box_enum { media_box, crop_box, bleed_box, trim_box, art_box };
66
+
67
+ enum permission_enum { perm_print, perm_change, perm_copy, perm_add_notes,
68
+ perm_fill_forms, perm_accessibility, perm_assemble,
69
+ perm_print_high_resolution };
70
+
71
+ enum case_sensitivity_enum { case_sensitive, case_insensitive };
72
+
73
+ typedef std::vector<char> byte_array;
74
+
75
+ typedef unsigned int /* time_t */ time_type;
76
+
77
+ // to disable warning only for this occurrence
78
+ #ifdef _MSC_VER
79
+ #pragma warning(push)
80
+ #pragma warning(disable: 4251) /* class 'A' needs to have dll interface for to be used by clients of class 'B'. */
81
+ #endif
82
+ class POPPLER_CPP_EXPORT ustring : public std::basic_string<unsigned short>
83
+ {
84
+ public:
85
+ ustring();
86
+ ustring(size_type len, value_type ch);
87
+ ~ustring();
88
+
89
+ byte_array to_utf8() const;
90
+ std::string to_latin1() const;
91
+
92
+ static ustring from_utf8(const char *str, int len = -1);
93
+ static ustring from_latin1(const std::string &str);
94
+
95
+ private:
96
+ // forbid implicit std::string conversions
97
+ ustring(const std::string &);
98
+ operator std::string() const;
99
+ ustring& operator=(const std::string &);
100
+ };
101
+ #ifdef _MSC_VER
102
+ #pragma warning(pop)
103
+ #endif
104
+
105
+ POPPLER_CPP_EXPORT time_type convert_date(const std::string &date);
106
+
107
+ POPPLER_CPP_EXPORT std::ostream& operator<<(std::ostream& stream, const byte_array &array);
108
+
109
+ }
110
+
111
+ #endif
@@ -0,0 +1,71 @@
1
+ /*
2
+ * Copyright (C) 2010, Pino Toscano <pino@kde.org>
3
+ *
4
+ * This program is free software; you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation; either version 2, or (at your option)
7
+ * any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ #ifndef POPPLER_IMAGE_H
20
+ #define POPPLER_IMAGE_H
21
+
22
+ #include "poppler-global.h"
23
+ #include "poppler-rectangle.h"
24
+
25
+ namespace poppler
26
+ {
27
+
28
+ class image_private;
29
+
30
+ class POPPLER_CPP_EXPORT image
31
+ {
32
+ public:
33
+ enum format_enum {
34
+ format_invalid,
35
+ format_mono,
36
+ format_rgb24,
37
+ format_argb32
38
+ };
39
+
40
+ image();
41
+ image(int iwidth, int iheight, format_enum iformat);
42
+ image(char *idata, int iwidth, int iheight, format_enum iformat);
43
+ image(const image &img);
44
+ ~image();
45
+
46
+ bool is_valid() const;
47
+ format_enum format() const;
48
+ int width() const;
49
+ int height() const;
50
+ char *data();
51
+ const char *const_data() const;
52
+ int bytes_per_row() const;
53
+
54
+ image copy(const rect &r = rect()) const;
55
+
56
+ bool save(const std::string &file_name, const std::string &out_format, int dpi = -1) const;
57
+
58
+ static std::vector<std::string> supported_image_formats();
59
+
60
+ image& operator=(const image &img);
61
+
62
+ private:
63
+ void detach();
64
+
65
+ image_private *d;
66
+ friend class image_private;
67
+ };
68
+
69
+ }
70
+
71
+ #endif
@@ -0,0 +1,66 @@
1
+ /*
2
+ * Copyright (C) 2010, Pino Toscano <pino@kde.org>
3
+ *
4
+ * This program is free software; you can redistribute it and/or modify
5
+ * it under the terms of the GNU General Public License as published by
6
+ * the Free Software Foundation; either version 2, or (at your option)
7
+ * any later version.
8
+ *
9
+ * This program is distributed in the hope that it will be useful,
10
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
+ * GNU General Public License for more details.
13
+ *
14
+ * You should have received a copy of the GNU General Public License
15
+ * along with this program; if not, write to the Free Software
16
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
17
+ */
18
+
19
+ #ifndef POPPLER_PAGE_RENDERER_H
20
+ #define POPPLER_PAGE_RENDERER_H
21
+
22
+ #include "poppler-global.h"
23
+ #include "poppler-image.h"
24
+
25
+ namespace poppler
26
+ {
27
+
28
+ typedef unsigned int argb;
29
+
30
+ class page;
31
+ class page_renderer_private;
32
+
33
+ class POPPLER_CPP_EXPORT page_renderer : public poppler::noncopyable
34
+ {
35
+ public:
36
+ enum render_hint {
37
+ antialiasing = 0x00000001,
38
+ text_antialiasing = 0x00000002,
39
+ text_hinting = 0x00000004
40
+ };
41
+
42
+ page_renderer();
43
+ ~page_renderer();
44
+
45
+ argb paper_color() const;
46
+ void set_paper_color(argb c);
47
+
48
+ unsigned int render_hints() const;
49
+ void set_render_hint(render_hint hint, bool on = true);
50
+ void set_render_hints(unsigned int hints);
51
+
52
+ image render_page(const page *p,
53
+ double xres = 72.0, double yres = 72.0,
54
+ int x = -1, int y = -1, int w = -1, int h = -1,
55
+ rotation_enum rotate = rotate_0) const;
56
+
57
+ static bool can_render();
58
+
59
+ private:
60
+ page_renderer_private *d;
61
+ friend class page_renderer_private;
62
+ };
63
+
64
+ }
65
+
66
+ #endif