PyMuPDF 1.26.6__cp310-abi3-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (112) hide show
  1. fitz/__init__.py +13 -0
  2. fitz/table.py +2 -0
  3. fitz/utils.py +2 -0
  4. pymupdf/__init__.py +25899 -0
  5. pymupdf/__main__.py +1140 -0
  6. pymupdf/_apply_pages.py +253 -0
  7. pymupdf/_build.py +8 -0
  8. pymupdf/_extra.pyd +0 -0
  9. pymupdf/_mupdf.pyd +0 -0
  10. pymupdf/_wxcolors.py +562 -0
  11. pymupdf/extra.py +220 -0
  12. pymupdf/mupdf-devel/include/mupdf/classes.h +19999 -0
  13. pymupdf/mupdf-devel/include/mupdf/classes2.h +12244 -0
  14. pymupdf/mupdf-devel/include/mupdf/exceptions.h +118 -0
  15. pymupdf/mupdf-devel/include/mupdf/extra.h +189 -0
  16. pymupdf/mupdf-devel/include/mupdf/fitz/archive.h +444 -0
  17. pymupdf/mupdf-devel/include/mupdf/fitz/band-writer.h +117 -0
  18. pymupdf/mupdf-devel/include/mupdf/fitz/barcode.h +138 -0
  19. pymupdf/mupdf-devel/include/mupdf/fitz/bidi.h +90 -0
  20. pymupdf/mupdf-devel/include/mupdf/fitz/bitmap.h +188 -0
  21. pymupdf/mupdf-devel/include/mupdf/fitz/buffer.h +250 -0
  22. pymupdf/mupdf-devel/include/mupdf/fitz/color.h +433 -0
  23. pymupdf/mupdf-devel/include/mupdf/fitz/compress.h +132 -0
  24. pymupdf/mupdf-devel/include/mupdf/fitz/compressed-buffer.h +194 -0
  25. pymupdf/mupdf-devel/include/mupdf/fitz/config.h +302 -0
  26. pymupdf/mupdf-devel/include/mupdf/fitz/context.h +1064 -0
  27. pymupdf/mupdf-devel/include/mupdf/fitz/crypt.h +270 -0
  28. pymupdf/mupdf-devel/include/mupdf/fitz/deskew.h +46 -0
  29. pymupdf/mupdf-devel/include/mupdf/fitz/device.h +652 -0
  30. pymupdf/mupdf-devel/include/mupdf/fitz/display-list.h +142 -0
  31. pymupdf/mupdf-devel/include/mupdf/fitz/document.h +1103 -0
  32. pymupdf/mupdf-devel/include/mupdf/fitz/export.h +52 -0
  33. pymupdf/mupdf-devel/include/mupdf/fitz/filter.h +269 -0
  34. pymupdf/mupdf-devel/include/mupdf/fitz/font.h +858 -0
  35. pymupdf/mupdf-devel/include/mupdf/fitz/geometry.h +885 -0
  36. pymupdf/mupdf-devel/include/mupdf/fitz/getopt.h +134 -0
  37. pymupdf/mupdf-devel/include/mupdf/fitz/glyph-cache.h +96 -0
  38. pymupdf/mupdf-devel/include/mupdf/fitz/glyph.h +81 -0
  39. pymupdf/mupdf-devel/include/mupdf/fitz/hash.h +126 -0
  40. pymupdf/mupdf-devel/include/mupdf/fitz/heap-imp.h +190 -0
  41. pymupdf/mupdf-devel/include/mupdf/fitz/heap.h +143 -0
  42. pymupdf/mupdf-devel/include/mupdf/fitz/image.h +451 -0
  43. pymupdf/mupdf-devel/include/mupdf/fitz/json.h +98 -0
  44. pymupdf/mupdf-devel/include/mupdf/fitz/link.h +130 -0
  45. pymupdf/mupdf-devel/include/mupdf/fitz/log.h +61 -0
  46. pymupdf/mupdf-devel/include/mupdf/fitz/outline.h +254 -0
  47. pymupdf/mupdf-devel/include/mupdf/fitz/output-svg.h +64 -0
  48. pymupdf/mupdf-devel/include/mupdf/fitz/output.h +448 -0
  49. pymupdf/mupdf-devel/include/mupdf/fitz/path.h +477 -0
  50. pymupdf/mupdf-devel/include/mupdf/fitz/pixmap.h +516 -0
  51. pymupdf/mupdf-devel/include/mupdf/fitz/pool.h +102 -0
  52. pymupdf/mupdf-devel/include/mupdf/fitz/separation.h +138 -0
  53. pymupdf/mupdf-devel/include/mupdf/fitz/shade.h +233 -0
  54. pymupdf/mupdf-devel/include/mupdf/fitz/store.h +465 -0
  55. pymupdf/mupdf-devel/include/mupdf/fitz/story-writer.h +209 -0
  56. pymupdf/mupdf-devel/include/mupdf/fitz/story.h +232 -0
  57. pymupdf/mupdf-devel/include/mupdf/fitz/stream.h +646 -0
  58. pymupdf/mupdf-devel/include/mupdf/fitz/string-util.h +335 -0
  59. pymupdf/mupdf-devel/include/mupdf/fitz/structured-text.h +924 -0
  60. pymupdf/mupdf-devel/include/mupdf/fitz/system.h +495 -0
  61. pymupdf/mupdf-devel/include/mupdf/fitz/text.h +210 -0
  62. pymupdf/mupdf-devel/include/mupdf/fitz/track-usage.h +57 -0
  63. pymupdf/mupdf-devel/include/mupdf/fitz/transition.h +76 -0
  64. pymupdf/mupdf-devel/include/mupdf/fitz/tree.h +62 -0
  65. pymupdf/mupdf-devel/include/mupdf/fitz/types.h +41 -0
  66. pymupdf/mupdf-devel/include/mupdf/fitz/util.h +159 -0
  67. pymupdf/mupdf-devel/include/mupdf/fitz/version.h +31 -0
  68. pymupdf/mupdf-devel/include/mupdf/fitz/write-pixmap.h +507 -0
  69. pymupdf/mupdf-devel/include/mupdf/fitz/writer.h +269 -0
  70. pymupdf/mupdf-devel/include/mupdf/fitz/xml.h +435 -0
  71. pymupdf/mupdf-devel/include/mupdf/fitz.h +101 -0
  72. pymupdf/mupdf-devel/include/mupdf/functions.h +13819 -0
  73. pymupdf/mupdf-devel/include/mupdf/helpers/mu-office-lib.h +666 -0
  74. pymupdf/mupdf-devel/include/mupdf/helpers/mu-threads.h +280 -0
  75. pymupdf/mupdf-devel/include/mupdf/helpers/pkcs7-openssl.h +48 -0
  76. pymupdf/mupdf-devel/include/mupdf/html.h +53 -0
  77. pymupdf/mupdf-devel/include/mupdf/internal.h +29 -0
  78. pymupdf/mupdf-devel/include/mupdf/memento.h +425 -0
  79. pymupdf/mupdf-devel/include/mupdf/pdf/annot.h +1015 -0
  80. pymupdf/mupdf-devel/include/mupdf/pdf/clean.h +68 -0
  81. pymupdf/mupdf-devel/include/mupdf/pdf/cmap.h +145 -0
  82. pymupdf/mupdf-devel/include/mupdf/pdf/crypt.h +108 -0
  83. pymupdf/mupdf-devel/include/mupdf/pdf/document.h +902 -0
  84. pymupdf/mupdf-devel/include/mupdf/pdf/event.h +167 -0
  85. pymupdf/mupdf-devel/include/mupdf/pdf/font.h +168 -0
  86. pymupdf/mupdf-devel/include/mupdf/pdf/form.h +381 -0
  87. pymupdf/mupdf-devel/include/mupdf/pdf/image-rewriter.h +78 -0
  88. pymupdf/mupdf-devel/include/mupdf/pdf/interpret.h +518 -0
  89. pymupdf/mupdf-devel/include/mupdf/pdf/javascript.h +43 -0
  90. pymupdf/mupdf-devel/include/mupdf/pdf/name-table.h +621 -0
  91. pymupdf/mupdf-devel/include/mupdf/pdf/object.h +445 -0
  92. pymupdf/mupdf-devel/include/mupdf/pdf/page.h +327 -0
  93. pymupdf/mupdf-devel/include/mupdf/pdf/parse.h +61 -0
  94. pymupdf/mupdf-devel/include/mupdf/pdf/recolor.h +49 -0
  95. pymupdf/mupdf-devel/include/mupdf/pdf/resource.h +144 -0
  96. pymupdf/mupdf-devel/include/mupdf/pdf/xref.h +300 -0
  97. pymupdf/mupdf-devel/include/mupdf/pdf/zugferd.h +49 -0
  98. pymupdf/mupdf-devel/include/mupdf/pdf.h +59 -0
  99. pymupdf/mupdf-devel/include/mupdf/ucdn.h +464 -0
  100. pymupdf/mupdf-devel/lib/libmuthreads.lib +0 -0
  101. pymupdf/mupdf-devel/lib/mupdfcpp64.lib +0 -0
  102. pymupdf/mupdf.py +63667 -0
  103. pymupdf/mupdfcpp64.dll +0 -0
  104. pymupdf/pymupdf.py +2 -0
  105. pymupdf/table.py +2697 -0
  106. pymupdf/utils.py +1169 -0
  107. pymupdf-1.26.6.dist-info/COPYING +1 -0
  108. pymupdf-1.26.6.dist-info/METADATA +83 -0
  109. pymupdf-1.26.6.dist-info/README.md +60 -0
  110. pymupdf-1.26.6.dist-info/RECORD +112 -0
  111. pymupdf-1.26.6.dist-info/WHEEL +4 -0
  112. pymupdf-1.26.6.dist-info/entry_points.txt +3 -0
@@ -0,0 +1,118 @@
1
+ /**
2
+ This file was auto-generated by mupdfwrap.py.
3
+ */
4
+
5
+ #ifndef MUPDF_EXCEPTIONS_H
6
+ #define MUPDF_EXCEPTIONS_H
7
+
8
+
9
+ #include <stdexcept>
10
+ #include <string>
11
+
12
+ #include "mupdf/fitz.h"
13
+
14
+
15
+ namespace mupdf
16
+ {
17
+
18
+ /** Base class for exceptions. */
19
+ struct FzErrorBase : std::exception
20
+ {
21
+ int m_code;
22
+ std::string m_text;
23
+ mutable std::string m_what;
24
+ FZ_FUNCTION const char* what() const throw();
25
+ FZ_FUNCTION FzErrorBase(int code, const char* text);
26
+ };
27
+
28
+ /** For `FZ_ERROR_NONE`. */
29
+ struct FzErrorNone : FzErrorBase
30
+ {
31
+ FZ_FUNCTION FzErrorNone(const char* message);
32
+ };
33
+
34
+
35
+ /** For `FZ_ERROR_GENERIC`. */
36
+ struct FzErrorGeneric : FzErrorBase
37
+ {
38
+ FZ_FUNCTION FzErrorGeneric(const char* message);
39
+ };
40
+
41
+
42
+ /** For `FZ_ERROR_SYSTEM`. */
43
+ struct FzErrorSystem : FzErrorBase
44
+ {
45
+ FZ_FUNCTION FzErrorSystem(const char* message);
46
+ };
47
+
48
+
49
+ /** For `FZ_ERROR_LIBRARY`. */
50
+ struct FzErrorLibrary : FzErrorBase
51
+ {
52
+ FZ_FUNCTION FzErrorLibrary(const char* message);
53
+ };
54
+
55
+
56
+ /** For `FZ_ERROR_ARGUMENT`. */
57
+ struct FzErrorArgument : FzErrorBase
58
+ {
59
+ FZ_FUNCTION FzErrorArgument(const char* message);
60
+ };
61
+
62
+
63
+ /** For `FZ_ERROR_LIMIT`. */
64
+ struct FzErrorLimit : FzErrorBase
65
+ {
66
+ FZ_FUNCTION FzErrorLimit(const char* message);
67
+ };
68
+
69
+
70
+ /** For `FZ_ERROR_UNSUPPORTED`. */
71
+ struct FzErrorUnsupported : FzErrorBase
72
+ {
73
+ FZ_FUNCTION FzErrorUnsupported(const char* message);
74
+ };
75
+
76
+
77
+ /** For `FZ_ERROR_FORMAT`. */
78
+ struct FzErrorFormat : FzErrorBase
79
+ {
80
+ FZ_FUNCTION FzErrorFormat(const char* message);
81
+ };
82
+
83
+
84
+ /** For `FZ_ERROR_SYNTAX`. */
85
+ struct FzErrorSyntax : FzErrorBase
86
+ {
87
+ FZ_FUNCTION FzErrorSyntax(const char* message);
88
+ };
89
+
90
+
91
+ /** For `FZ_ERROR_TRYLATER`. */
92
+ struct FzErrorTrylater : FzErrorBase
93
+ {
94
+ FZ_FUNCTION FzErrorTrylater(const char* message);
95
+ };
96
+
97
+
98
+ /** For `FZ_ERROR_ABORT`. */
99
+ struct FzErrorAbort : FzErrorBase
100
+ {
101
+ FZ_FUNCTION FzErrorAbort(const char* message);
102
+ };
103
+
104
+
105
+ /** For `FZ_ERROR_REPAIRED`. */
106
+ struct FzErrorRepaired : FzErrorBase
107
+ {
108
+ FZ_FUNCTION FzErrorRepaired(const char* message);
109
+ };
110
+
111
+
112
+ /** Throw exception appropriate for error in `ctx`. */
113
+ FZ_FUNCTION void internal_throw_exception(fz_context* ctx);
114
+
115
+
116
+ } /* End of namespace mupdf. */
117
+
118
+ #endif
@@ -0,0 +1,189 @@
1
+ /**
2
+ This file was auto-generated by mupdfwrap.py.
3
+ */
4
+
5
+ #ifndef MUPDF_EXTRA_H
6
+ #define MUPDF_EXTRA_H
7
+
8
+
9
+
10
+ #ifdef MUPDF_WRAP_LIBCLANG
11
+
12
+ namespace std
13
+ {
14
+ template<typename T>
15
+ struct vector
16
+ {
17
+ };
18
+
19
+ struct string
20
+ {
21
+ };
22
+ }
23
+
24
+ #else
25
+
26
+ #include <string>
27
+ #include <vector>
28
+
29
+ #endif
30
+
31
+ #include "mupdf/fitz.h"
32
+ #include "mupdf/pdf.h"
33
+
34
+ /**
35
+ C++ alternative to `fz_lookup_metadata()` that returns a `std::string`
36
+ or calls `fz_throw()` if not found.
37
+ */
38
+ FZ_FUNCTION std::string fz_lookup_metadata2(fz_context* ctx, fz_document* doc, const char* key);
39
+
40
+ /**
41
+ C++ alternative to `pdf_lookup_metadata()` that returns a `std::string`
42
+ or calls `fz_throw()` if not found.
43
+ */
44
+ FZ_FUNCTION std::string pdf_lookup_metadata2(fz_context* ctx, pdf_document* doc, const char* key);
45
+
46
+ /**
47
+ C++ alternative to `fz_md5_pixmap()` that returns the digest by value.
48
+ */
49
+ FZ_FUNCTION std::vector<unsigned char> fz_md5_pixmap2(fz_context* ctx, fz_pixmap* pixmap);
50
+
51
+ /**
52
+ C++ alternative to fz_md5_final() that returns the digest by value.
53
+ */
54
+ FZ_FUNCTION std::vector<unsigned char> fz_md5_final2(fz_md5* md5);
55
+
56
+ /** */
57
+ FZ_FUNCTION long long fz_pixmap_samples_int(fz_context* ctx, fz_pixmap* pixmap);
58
+
59
+ /**
60
+ Provides simple (but slow) access to pixmap data from Python and C#.
61
+ */
62
+ FZ_FUNCTION int fz_samples_get(fz_pixmap* pixmap, int offset);
63
+
64
+ /**
65
+ Provides simple (but slow) write access to pixmap data from Python and
66
+ C#.
67
+ */
68
+ FZ_FUNCTION void fz_samples_set(fz_pixmap* pixmap, int offset, int value);
69
+
70
+ /**
71
+ C++ alternative to fz_highlight_selection() that returns quads in a
72
+ std::vector.
73
+ */
74
+ FZ_FUNCTION std::vector<fz_quad> fz_highlight_selection2(fz_context* ctx, fz_stext_page* page, fz_point a, fz_point b, int max_quads);
75
+
76
+ struct fz_search_page2_hit
77
+ {
78
+ fz_quad quad;
79
+ int mark;
80
+ };
81
+
82
+ /**
83
+ C++ alternative to fz_search_page() that returns information in a std::vector.
84
+ */
85
+ FZ_FUNCTION std::vector<fz_search_page2_hit> fz_search_page2(fz_context* ctx, fz_document* doc, int number, const char* needle, int hit_max);
86
+
87
+ /**
88
+ C++ alternative to fz_string_from_text_language() that returns information in a std::string.
89
+ */
90
+ FZ_FUNCTION std::string fz_string_from_text_language2(fz_text_language lang);
91
+
92
+ /**
93
+ C++ alternative to fz_get_glyph_name() that returns information in a std::string.
94
+ */
95
+ FZ_FUNCTION std::string fz_get_glyph_name2(fz_context* ctx, fz_font* font, int glyph);
96
+
97
+ /**
98
+ Extra struct containing fz_install_load_system_font_funcs()'s args,
99
+ which we wrap with virtual_fnptrs set to allow use from Python/C# via
100
+ Swig Directors.
101
+ */
102
+ typedef struct fz_install_load_system_font_funcs_args
103
+ {
104
+ fz_load_system_font_fn* f;
105
+ fz_load_system_cjk_font_fn* f_cjk;
106
+ fz_load_system_fallback_font_fn* f_fallback;
107
+ } fz_install_load_system_font_funcs_args;
108
+
109
+ /**
110
+ Alternative to fz_install_load_system_font_funcs() that takes args in a
111
+ struct, to allow use from Python/C# via Swig Directors.
112
+ */
113
+ FZ_FUNCTION void fz_install_load_system_font_funcs2(fz_context* ctx, fz_install_load_system_font_funcs_args* args);
114
+
115
+ /** Internal singleton state to allow Swig Director class to find
116
+ fz_install_load_system_font_funcs_args class wrapper instance. */
117
+ FZ_DATA extern void* fz_install_load_system_font_funcs2_state;
118
+
119
+ /** Helper for calling `fz_document_handler::open` function pointer via
120
+ Swig from Python/C#. */
121
+ FZ_FUNCTION fz_document* fz_document_handler_open(fz_context* ctx, const fz_document_handler *handler, fz_stream* stream, fz_stream* accel, fz_archive* dir, void* recognize_state);
122
+
123
+ /** Helper for calling a `fz_document_handler::recognize` function
124
+ pointer via Swig from Python/C#. */
125
+ FZ_FUNCTION int fz_document_handler_recognize(fz_context* ctx, const fz_document_handler *handler, const char *magic);
126
+
127
+ /** Swig-friendly wrapper for pdf_choice_widget_options(), returns the
128
+ options directly in a vector. */
129
+ FZ_FUNCTION std::vector<std::string> pdf_choice_widget_options2(fz_context* ctx, pdf_annot* tw, int exportval);
130
+
131
+ /** Swig-friendly wrapper for fz_new_image_from_compressed_buffer(),
132
+ uses specified `decode` and `colorkey` if they are not null (in which
133
+ case we assert that they have size `2*fz_colorspace_n(colorspace)`). */
134
+ FZ_FUNCTION fz_image* fz_new_image_from_compressed_buffer2(
135
+ fz_context* ctx,
136
+ int w,
137
+ int h,
138
+ int bpc,
139
+ fz_colorspace* colorspace,
140
+ int xres,
141
+ int yres,
142
+ int interpolate,
143
+ int imagemask,
144
+ const std::vector<float>& decode,
145
+ const std::vector<int>& colorkey,
146
+ fz_compressed_buffer* buffer,
147
+ fz_image* mask
148
+ );
149
+
150
+ /** Swig-friendly wrapper for pdf_rearrange_pages(). */
151
+ void pdf_rearrange_pages2(
152
+ fz_context* ctx,
153
+ pdf_document* doc,
154
+ const std::vector<int>& pages,
155
+ pdf_clean_options_structure structure
156
+ );
157
+
158
+ /** Swig-friendly wrapper for pdf_subset_fonts(). */
159
+ void pdf_subset_fonts2(fz_context *ctx, pdf_document *doc, const std::vector<int>& pages);
160
+
161
+ /** Swig-friendly and typesafe way to do fz_snprintf(fmt, value). `fmt`
162
+ must end with one of 'efg' otherwise we throw an exception. */
163
+ std::string fz_format_double(fz_context* ctx, const char* fmt, double value);
164
+
165
+ struct fz_font_ucs_gid
166
+ {
167
+ unsigned long ucs;
168
+ unsigned int gid;
169
+ };
170
+
171
+ /** SWIG-friendly wrapper for fz_enumerate_font_cmap(). */
172
+ std::vector<fz_font_ucs_gid> fz_enumerate_font_cmap2(fz_context* ctx, fz_font* font);
173
+
174
+ /** SWIG-friendly wrapper for pdf_set_annot_callout_line(). */
175
+ void pdf_set_annot_callout_line2(fz_context *ctx, pdf_annot *annot, std::vector<fz_point>& callout);
176
+
177
+ /** SWIG-friendly wrapper for fz_decode_barcode_from_display_list(),
178
+ avoiding leak of the returned string. */
179
+ std::string fz_decode_barcode_from_display_list2(fz_context *ctx, fz_barcode_type *type, fz_display_list *list, fz_rect subarea, int rotate);
180
+
181
+ /** SWIG-friendly wrapper for fz_decode_barcode_from_pixmap(), avoiding
182
+ leak of the returned string. */
183
+ std::string fz_decode_barcode_from_pixmap2(fz_context *ctx, fz_barcode_type *type, fz_pixmap *pix, int rotate);
184
+
185
+ /** SWIG-friendly wrapper for fz_decode_barcode_from_page(), avoiding
186
+ leak of the returned string. */
187
+ std::string fz_decode_barcode_from_page2(fz_context *ctx, fz_barcode_type *type, fz_page *page, fz_rect subarea, int rotate);
188
+
189
+ #endif