PyMuPDF 1.24.11__cp38-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 (99) hide show
  1. PyMuPDF-1.24.11.dist-info/COPYING +1 -0
  2. PyMuPDF-1.24.11.dist-info/METADATA +83 -0
  3. PyMuPDF-1.24.11.dist-info/README.md +60 -0
  4. PyMuPDF-1.24.11.dist-info/RECORD +99 -0
  5. PyMuPDF-1.24.11.dist-info/WHEEL +4 -0
  6. PyMuPDF-1.24.11.dist-info/entry_points.txt +3 -0
  7. fitz/__init__.py +11 -0
  8. fitz/table.py +2 -0
  9. fitz/utils.py +2 -0
  10. pymupdf/__init__.py +22122 -0
  11. pymupdf/__main__.py +1146 -0
  12. pymupdf/_apply_pages.py +253 -0
  13. pymupdf/_build.py +1 -0
  14. pymupdf/_extra.pyd +0 -0
  15. pymupdf/_mupdf.pyd +0 -0
  16. pymupdf/extra.py +214 -0
  17. pymupdf/mupdf-devel/include/mupdf/fitz/archive.h +444 -0
  18. pymupdf/mupdf-devel/include/mupdf/fitz/band-writer.h +117 -0
  19. pymupdf/mupdf-devel/include/mupdf/fitz/bidi.h +90 -0
  20. pymupdf/mupdf-devel/include/mupdf/fitz/bitmap.h +175 -0
  21. pymupdf/mupdf-devel/include/mupdf/fitz/buffer.h +250 -0
  22. pymupdf/mupdf-devel/include/mupdf/fitz/color.h +427 -0
  23. pymupdf/mupdf-devel/include/mupdf/fitz/compress.h +88 -0
  24. pymupdf/mupdf-devel/include/mupdf/fitz/compressed-buffer.h +185 -0
  25. pymupdf/mupdf-devel/include/mupdf/fitz/config.h +223 -0
  26. pymupdf/mupdf-devel/include/mupdf/fitz/context.h +1006 -0
  27. pymupdf/mupdf-devel/include/mupdf/fitz/crypt.h +270 -0
  28. pymupdf/mupdf-devel/include/mupdf/fitz/device.h +654 -0
  29. pymupdf/mupdf-devel/include/mupdf/fitz/display-list.h +142 -0
  30. pymupdf/mupdf-devel/include/mupdf/fitz/document.h +1108 -0
  31. pymupdf/mupdf-devel/include/mupdf/fitz/export.h +52 -0
  32. pymupdf/mupdf-devel/include/mupdf/fitz/filter.h +263 -0
  33. pymupdf/mupdf-devel/include/mupdf/fitz/font.h +815 -0
  34. pymupdf/mupdf-devel/include/mupdf/fitz/geometry.h +818 -0
  35. pymupdf/mupdf-devel/include/mupdf/fitz/getopt.h +128 -0
  36. pymupdf/mupdf-devel/include/mupdf/fitz/glyph-cache.h +96 -0
  37. pymupdf/mupdf-devel/include/mupdf/fitz/glyph.h +81 -0
  38. pymupdf/mupdf-devel/include/mupdf/fitz/hash.h +126 -0
  39. pymupdf/mupdf-devel/include/mupdf/fitz/heap-imp.h +163 -0
  40. pymupdf/mupdf-devel/include/mupdf/fitz/heap.h +140 -0
  41. pymupdf/mupdf-devel/include/mupdf/fitz/image.h +443 -0
  42. pymupdf/mupdf-devel/include/mupdf/fitz/link.h +130 -0
  43. pymupdf/mupdf-devel/include/mupdf/fitz/log.h +61 -0
  44. pymupdf/mupdf-devel/include/mupdf/fitz/outline.h +228 -0
  45. pymupdf/mupdf-devel/include/mupdf/fitz/output-svg.h +64 -0
  46. pymupdf/mupdf-devel/include/mupdf/fitz/output.h +415 -0
  47. pymupdf/mupdf-devel/include/mupdf/fitz/path.h +447 -0
  48. pymupdf/mupdf-devel/include/mupdf/fitz/pixmap.h +501 -0
  49. pymupdf/mupdf-devel/include/mupdf/fitz/pool.h +68 -0
  50. pymupdf/mupdf-devel/include/mupdf/fitz/separation.h +138 -0
  51. pymupdf/mupdf-devel/include/mupdf/fitz/shade.h +233 -0
  52. pymupdf/mupdf-devel/include/mupdf/fitz/store.h +456 -0
  53. pymupdf/mupdf-devel/include/mupdf/fitz/story-writer.h +209 -0
  54. pymupdf/mupdf-devel/include/mupdf/fitz/story.h +232 -0
  55. pymupdf/mupdf-devel/include/mupdf/fitz/stream.h +646 -0
  56. pymupdf/mupdf-devel/include/mupdf/fitz/string-util.h +286 -0
  57. pymupdf/mupdf-devel/include/mupdf/fitz/structured-text.h +365 -0
  58. pymupdf/mupdf-devel/include/mupdf/fitz/system.h +459 -0
  59. pymupdf/mupdf-devel/include/mupdf/fitz/text.h +209 -0
  60. pymupdf/mupdf-devel/include/mupdf/fitz/track-usage.h +57 -0
  61. pymupdf/mupdf-devel/include/mupdf/fitz/transition.h +76 -0
  62. pymupdf/mupdf-devel/include/mupdf/fitz/tree.h +62 -0
  63. pymupdf/mupdf-devel/include/mupdf/fitz/types.h +41 -0
  64. pymupdf/mupdf-devel/include/mupdf/fitz/util.h +151 -0
  65. pymupdf/mupdf-devel/include/mupdf/fitz/version.h +31 -0
  66. pymupdf/mupdf-devel/include/mupdf/fitz/write-pixmap.h +499 -0
  67. pymupdf/mupdf-devel/include/mupdf/fitz/writer.h +266 -0
  68. pymupdf/mupdf-devel/include/mupdf/fitz/xml.h +397 -0
  69. pymupdf/mupdf-devel/include/mupdf/fitz.h +97 -0
  70. pymupdf/mupdf-devel/include/mupdf/helpers/mu-office-lib.h +666 -0
  71. pymupdf/mupdf-devel/include/mupdf/helpers/mu-threads.h +280 -0
  72. pymupdf/mupdf-devel/include/mupdf/helpers/pkcs7-openssl.h +48 -0
  73. pymupdf/mupdf-devel/include/mupdf/html.h +53 -0
  74. pymupdf/mupdf-devel/include/mupdf/memento.h +423 -0
  75. pymupdf/mupdf-devel/include/mupdf/pdf/annot.h +965 -0
  76. pymupdf/mupdf-devel/include/mupdf/pdf/clean.h +48 -0
  77. pymupdf/mupdf-devel/include/mupdf/pdf/cmap.h +145 -0
  78. pymupdf/mupdf-devel/include/mupdf/pdf/crypt.h +107 -0
  79. pymupdf/mupdf-devel/include/mupdf/pdf/document.h +842 -0
  80. pymupdf/mupdf-devel/include/mupdf/pdf/event.h +167 -0
  81. pymupdf/mupdf-devel/include/mupdf/pdf/font.h +168 -0
  82. pymupdf/mupdf-devel/include/mupdf/pdf/form.h +380 -0
  83. pymupdf/mupdf-devel/include/mupdf/pdf/image-rewriter.h +78 -0
  84. pymupdf/mupdf-devel/include/mupdf/pdf/interpret.h +492 -0
  85. pymupdf/mupdf-devel/include/mupdf/pdf/javascript.h +43 -0
  86. pymupdf/mupdf-devel/include/mupdf/pdf/name-table.h +596 -0
  87. pymupdf/mupdf-devel/include/mupdf/pdf/object.h +435 -0
  88. pymupdf/mupdf-devel/include/mupdf/pdf/page.h +316 -0
  89. pymupdf/mupdf-devel/include/mupdf/pdf/parse.h +61 -0
  90. pymupdf/mupdf-devel/include/mupdf/pdf/resource.h +133 -0
  91. pymupdf/mupdf-devel/include/mupdf/pdf/xref.h +300 -0
  92. pymupdf/mupdf-devel/include/mupdf/pdf.h +57 -0
  93. pymupdf/mupdf-devel/include/mupdf/ucdn.h +452 -0
  94. pymupdf/mupdf-devel/lib/mupdfcpp64.lib +0 -0
  95. pymupdf/mupdf.py +58506 -0
  96. pymupdf/mupdfcpp64.dll +0 -0
  97. pymupdf/pymupdf.py +2 -0
  98. pymupdf/table.py +2355 -0
  99. pymupdf/utils.py +5880 -0
@@ -0,0 +1,280 @@
1
+ // Copyright (C) 2004-2021 Artifex Software, Inc.
2
+ //
3
+ // This file is part of MuPDF.
4
+ //
5
+ // MuPDF is free software: you can redistribute it and/or modify it under the
6
+ // terms of the GNU Affero General Public License as published by the Free
7
+ // Software Foundation, either version 3 of the License, or (at your option)
8
+ // any later version.
9
+ //
10
+ // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ // details.
14
+ //
15
+ // You should have received a copy of the GNU Affero General Public License
16
+ // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17
+ //
18
+ // Alternative licensing terms are available from the licensor.
19
+ // For commercial licensing, see <https://www.artifex.com/> or contact
20
+ // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21
+ // CA 94129, USA, for further information.
22
+
23
+ #ifndef MUPDF_HELPERS_MU_THREADS_H
24
+ #define MUPDF_HELPERS_MU_THREADS_H
25
+
26
+ /*
27
+ Simple threading helper library.
28
+ Includes implementations for Windows, pthreads,
29
+ and "no threads".
30
+
31
+ The "no threads" implementation simply provides types
32
+ and stub functions so that things will build, but abort
33
+ if we try to call them. This simplifies the job for
34
+ calling functions.
35
+
36
+ To build this library on a platform with no threading,
37
+ define DISABLE_MUTHREADS (or extend the ifdeffery below
38
+ so that it does so).
39
+
40
+ To build this library on a platform that uses a
41
+ threading model other than windows threads or pthreads,
42
+ extend the #ifdeffery below to set MUTHREAD_IMPL_TYPE
43
+ to an unused value, and modify mu-threads.c
44
+ appropriately.
45
+ */
46
+
47
+ #if !defined(DISABLE_MUTHREADS)
48
+ #ifdef _WIN32
49
+ #define MU_THREAD_IMPL_TYPE 1
50
+ #elif defined(HAVE_PTHREAD)
51
+ #define MU_THREAD_IMPL_TYPE 2
52
+ #else
53
+ #define DISABLE_MUTHREADS
54
+ #endif
55
+ #endif
56
+
57
+ /*
58
+ Types
59
+ */
60
+ typedef struct mu_thread mu_thread;
61
+ typedef struct mu_semaphore mu_semaphore;
62
+ typedef struct mu_mutex mu_mutex;
63
+
64
+ /*
65
+ Semaphores
66
+
67
+ Created with a value of 0. Triggering a semaphore
68
+ increments the value. Waiting on a semaphore reduces
69
+ the value, blocking if it would become negative.
70
+
71
+ Never increment the value of a semaphore above 1, as
72
+ this has undefined meaning in this implementation.
73
+ */
74
+
75
+ /*
76
+ Create a semaphore.
77
+
78
+ sem: Pointer to a mu_semaphore to populate.
79
+
80
+ Returns non-zero for error.
81
+ */
82
+ int mu_create_semaphore(mu_semaphore *sem);
83
+
84
+ /*
85
+ Destroy a semaphore.
86
+ Semaphores may safely be destroyed multiple
87
+ times. Any semaphore initialised to zeros is
88
+ safe to destroy.
89
+
90
+ Never destroy a semaphore that may be being waited
91
+ upon, as this has undefined meaning in this
92
+ implementation.
93
+
94
+ sem: Pointer to a mu_semaphore to destroy.
95
+ */
96
+ void mu_destroy_semaphore(mu_semaphore *sem);
97
+
98
+ /*
99
+ Increment the value of the
100
+ semaphore. Never blocks.
101
+
102
+ sem: The semaphore to increment.
103
+
104
+ Returns non-zero on error.
105
+ */
106
+ int mu_trigger_semaphore(mu_semaphore *sem);
107
+
108
+ /*
109
+ Decrement the value of the
110
+ semaphore, blocking if this would involve making
111
+ the value negative.
112
+
113
+ sem: The semaphore to decrement.
114
+
115
+ Returns non-zero on error.
116
+ */
117
+ int mu_wait_semaphore(mu_semaphore *sem);
118
+
119
+ /*
120
+ Threads
121
+ */
122
+
123
+ /*
124
+ The type for the function that a thread runs.
125
+
126
+ arg: User supplied data.
127
+ */
128
+ typedef void (mu_thread_fn)(void *arg);
129
+
130
+ /*
131
+ Create a thread to run the
132
+ supplied function with the supplied argument.
133
+
134
+ th: Pointer to mu_thread to populate with created
135
+ threads information.
136
+
137
+ fn: The function for the thread to run.
138
+
139
+ arg: The argument to pass to fn.
140
+ */
141
+ int mu_create_thread(mu_thread *th, mu_thread_fn *fn, void *arg);
142
+
143
+ /*
144
+ Destroy a thread. This function
145
+ blocks until a thread has terminated normally, and
146
+ destroys its storage. A mu_thread may safely be destroyed
147
+ multiple times, as may any mu_thread initialised with
148
+ zeros.
149
+
150
+ th: Pointer to mu_thread to destroy.
151
+ */
152
+ void mu_destroy_thread(mu_thread *th);
153
+
154
+ /*
155
+ Mutexes
156
+
157
+ This implementation does not specify whether
158
+ mutexes are recursive or not.
159
+ */
160
+
161
+ /*
162
+ Create a mutex.
163
+
164
+ mutex: pointer to a mu_mutex to populate.
165
+
166
+ Returns non-zero on error.
167
+ */
168
+ int mu_create_mutex(mu_mutex *mutex);
169
+
170
+ /*
171
+ Destroy a mutex. A mu_mutex may
172
+ safely be destroyed several times, as may a mu_mutex
173
+ initialised with zeros. Never destroy locked mu_mutex.
174
+
175
+ mutex: Pointer to mu_mutex to destroy.
176
+ */
177
+ void mu_destroy_mutex(mu_mutex *mutex);
178
+
179
+ /*
180
+ Lock a mutex.
181
+
182
+ mutex: Mutex to lock.
183
+ */
184
+ void mu_lock_mutex(mu_mutex *mutex);
185
+
186
+ /*
187
+ Unlock a mutex.
188
+
189
+ mutex: Mutex to unlock.
190
+ */
191
+ void mu_unlock_mutex(mu_mutex *mutex);
192
+
193
+ /*
194
+ Everything under this point is implementation specific.
195
+ Only people looking to extend the capabilities of this
196
+ helper module should need to look below here.
197
+ */
198
+
199
+ #ifdef DISABLE_MUTHREADS
200
+
201
+ /* Null implementation */
202
+ struct mu_semaphore
203
+ {
204
+ int dummy;
205
+ };
206
+
207
+ struct mu_thread
208
+ {
209
+ int dummy;
210
+ };
211
+
212
+ struct mu_mutex
213
+ {
214
+ int dummy;
215
+ };
216
+
217
+ #elif MU_THREAD_IMPL_TYPE == 1
218
+
219
+ #include <windows.h>
220
+
221
+ /* Windows threads */
222
+ struct mu_semaphore
223
+ {
224
+ HANDLE handle;
225
+ };
226
+
227
+ struct mu_thread
228
+ {
229
+ HANDLE handle;
230
+ mu_thread_fn *fn;
231
+ void *arg;
232
+ };
233
+
234
+ struct mu_mutex
235
+ {
236
+ CRITICAL_SECTION mutex;
237
+ };
238
+
239
+ #elif MU_THREAD_IMPL_TYPE == 2
240
+
241
+ /*
242
+ PThreads - without working unnamed semaphores.
243
+
244
+ Neither ios nor OSX supports unnamed semaphores.
245
+ Named semaphores are a pain to use, so we implement
246
+ our own semaphores using condition variables and
247
+ mutexes.
248
+ */
249
+
250
+ #include <pthread.h>
251
+
252
+ struct mu_semaphore
253
+ {
254
+ int count;
255
+ pthread_mutex_t mutex;
256
+ pthread_cond_t cond;
257
+ };
258
+
259
+ struct mu_thread
260
+ {
261
+ pthread_t thread;
262
+ mu_thread_fn *fn;
263
+ void *arg;
264
+ };
265
+
266
+ struct mu_mutex
267
+ {
268
+ pthread_mutex_t mutex;
269
+ };
270
+
271
+ /*
272
+ Add new threading implementations here, with
273
+ #elif MU_THREAD_IMPL_TYPE == 3... etc.
274
+ */
275
+
276
+ #else
277
+ #error Unknown MU_THREAD_IMPL_TYPE setting
278
+ #endif
279
+
280
+ #endif /* MUPDF_HELPERS_MU_THREADS_H */
@@ -0,0 +1,48 @@
1
+ // Copyright (C) 2004-2021 Artifex Software, Inc.
2
+ //
3
+ // This file is part of MuPDF.
4
+ //
5
+ // MuPDF is free software: you can redistribute it and/or modify it under the
6
+ // terms of the GNU Affero General Public License as published by the Free
7
+ // Software Foundation, either version 3 of the License, or (at your option)
8
+ // any later version.
9
+ //
10
+ // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ // details.
14
+ //
15
+ // You should have received a copy of the GNU Affero General Public License
16
+ // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17
+ //
18
+ // Alternative licensing terms are available from the licensor.
19
+ // For commercial licensing, see <https://www.artifex.com/> or contact
20
+ // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21
+ // CA 94129, USA, for further information.
22
+
23
+ #ifndef MUPDF_PKCS7_OPENSSL_H
24
+ #define MUPDF_PKCS7_OPENSSL_H
25
+
26
+ #include "mupdf/pdf/document.h"
27
+ #include "mupdf/pdf/form.h"
28
+
29
+ /* This an example pkcs7 implementation using openssl. These are the types of functions that you
30
+ * will likely need to sign documents and check signatures within documents. In particular, to
31
+ * sign a document, you need a function that derives a pdf_pkcs7_signer object from a certificate
32
+ * stored by the operating system or within a file. */
33
+
34
+ /* Check a signature's digest against ranges of bytes drawn from a stream */
35
+ pdf_signature_error pkcs7_openssl_check_digest(fz_context *ctx, fz_stream *stm, char *sig, size_t sig_len);
36
+
37
+ /* Check a signature's certificate is trusted */
38
+ pdf_signature_error pkcs7_openssl_check_certificate(char *sig, size_t sig_len);
39
+
40
+ /* Obtain the distinguished name information from signature's certificate */
41
+ pdf_pkcs7_distinguished_name *pkcs7_openssl_distinguished_name(fz_context *ctx, char *sig, size_t sig_len);
42
+
43
+ /* Read the certificate and private key from a pfx file, holding it as an opaque structure */
44
+ pdf_pkcs7_signer *pkcs7_openssl_read_pfx(fz_context *ctx, const char *pfile, const char *pw);
45
+
46
+ pdf_pkcs7_verifier *pkcs7_openssl_new_verifier(fz_context *ctx);
47
+
48
+ #endif
@@ -0,0 +1,53 @@
1
+ // Copyright (C) 2023 Artifex Software, Inc.
2
+ //
3
+ // This file is part of MuPDF.
4
+ //
5
+ // MuPDF is free software: you can redistribute it and/or modify it under the
6
+ // terms of the GNU Affero General Public License as published by the Free
7
+ // Software Foundation, either version 3 of the License, or (at your option)
8
+ // any later version.
9
+ //
10
+ // MuPDF is distributed in the hope that it will be useful, but WITHOUT ANY
11
+ // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12
+ // FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
13
+ // details.
14
+ //
15
+ // You should have received a copy of the GNU Affero General Public License
16
+ // along with MuPDF. If not, see <https://www.gnu.org/licenses/agpl-3.0.en.html>
17
+ //
18
+ // Alternative licensing terms are available from the licensor.
19
+ // For commercial licensing, see <https://www.artifex.com/> or contact
20
+ // Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco,
21
+ // CA 94129, USA, for further information.
22
+
23
+ // This header allows people to easily build HTML-based document handlers.
24
+
25
+ #ifndef MUPDF_HTML_HTML_H
26
+ #define MUPDF_HTML_HTML_H
27
+
28
+ #include "mupdf/fitz/system.h"
29
+ #include "mupdf/fitz/context.h"
30
+ #include "mupdf/fitz/document.h"
31
+
32
+ /*
33
+ HTML types required
34
+ */
35
+ typedef struct fz_html_s fz_html;
36
+ typedef struct fz_html_font_set_s fz_html_font_set;
37
+
38
+ typedef struct
39
+ {
40
+ const char *format_name;
41
+ fz_buffer *(*convert_to_html)(fz_context *ctx, fz_html_font_set *set, fz_buffer *buf, fz_archive *dir, const char *user_css);
42
+ int try_xml;
43
+ int try_html5;
44
+ int patch_mobi;
45
+ } fz_htdoc_format_t;
46
+
47
+ fz_document *fz_htdoc_open_document_with_buffer(fz_context *ctx, fz_archive *dir, fz_buffer *buf, const fz_htdoc_format_t *format);
48
+
49
+ fz_document *fz_htdoc_open_document_with_stream_and_dir(fz_context *ctx, fz_stream *stm, fz_archive *dir, const fz_htdoc_format_t *format);
50
+
51
+
52
+
53
+ #endif /* MUPDF_HTML_HTML_H */