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,232 @@
1
+ // Copyright (C) 2004-2025 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_FITZ_STORY_H
24
+ #define MUPDF_FITZ_STORY_H
25
+
26
+ #include "mupdf/fitz/system.h"
27
+ #include "mupdf/fitz/context.h"
28
+ #include "mupdf/fitz/buffer.h"
29
+ #include "mupdf/fitz/device.h"
30
+ #include "mupdf/fitz/xml.h"
31
+ #include "mupdf/fitz/archive.h"
32
+
33
+ /*
34
+ This header file provides an API for laying out and placing styled
35
+ text on a page, or pages.
36
+
37
+ First a text story is created from some styled HTML.
38
+
39
+ Next, this story can be laid out into a given rectangle (possibly
40
+ retrying several times with updated rectangles as required).
41
+
42
+ Next, the laid out story can be drawn to a given device.
43
+
44
+ In the case where the text story cannot be fitted into the given
45
+ areas all at once, these two steps can be repeated multiple
46
+ times until the text story is completely consumed.
47
+
48
+ Finally, the text story can be dropped in the usual fashion.
49
+ */
50
+
51
+
52
+ typedef struct fz_story fz_story;
53
+
54
+ /*
55
+ Create a text story using styled html.
56
+
57
+ Passing a NULL buffer will be treated as an empty document.
58
+ Passing a NULL user_css will be treated as an empty CSS string.
59
+ A non-NULL dir will allow images etc to be loaded. The
60
+ story keeps its own reference, so the caller can drop its
61
+ reference after this call.
62
+ */
63
+ fz_story *fz_new_story(fz_context *ctx, fz_buffer *buf, const char *user_css, float em, fz_archive *dir);
64
+
65
+ /*
66
+ Retrieve the warnings given from parsing this story.
67
+
68
+ If there are warnings, this will be returned as a NULL terminated
69
+ C string. If there are no warnings, this will return NULL.
70
+
71
+ These warnings will not be complete until AFTER any DOM manipulations
72
+ have been completed.
73
+
74
+ This function does not need to be called, but once it has been
75
+ the DOM is no longer accessible, and any fz_xml pointer
76
+ retrieved from fz_story_document is no longer valid.
77
+ */
78
+ const char *fz_story_warnings(fz_context *ctx, fz_story *story);
79
+
80
+ /*
81
+ Equivalent to fz_place_story_flags with flags being 0.
82
+ */
83
+ int fz_place_story(fz_context *ctx, fz_story *story, fz_rect where, fz_rect *filled);
84
+
85
+ /*
86
+ Place (or continue placing) a story into the supplied rectangle
87
+ 'where', updating 'filled' with the actual area that was used.
88
+ Returns zero (FZ_PLACE_STORY_RETURN_ALL_FITTED) if all the
89
+ content fitted, non-zero if there is more to fit.
90
+
91
+ If the FZ_PLACE_STORY_FLAG_NO_OVERFLOW flag is set, then a
92
+ return code of FZ_PLACE_STORY_RETURN_OVERFLOW_WIDTH will be
93
+ returned when the next item (word) to be placed would not fit
94
+ in a rectangle of that given width.
95
+
96
+ Note, that filled may not be returned as a strict subset of
97
+ where, due to padding/margins at the bottom of pages, and
98
+ non-wrapping content extending to the right.
99
+
100
+ Subsequent calls will attempt to place the same section of story
101
+ again and again, until the placed story is drawn using fz_draw_story,
102
+ whereupon subsequent calls to fz_place_story will attempt to place
103
+ the unused remainder of the story.
104
+
105
+ After this function is called, the DOM is no longer accessible,
106
+ and any fz_xml pointer retrieved from fz_story_document is no
107
+ longer valid.
108
+
109
+ flags: Additional flags controlling layout. Pass 0 if none
110
+ required.
111
+ */
112
+ int fz_place_story_flags(fz_context *ctx, fz_story *story, fz_rect where, fz_rect *filled, int flags);
113
+
114
+ enum
115
+ {
116
+ /* Avoid the usual HTML behaviour of overflowing the box horizontally
117
+ * in some circumstances. We now abort the place in such cases and
118
+ * return with */
119
+ FZ_PLACE_STORY_FLAG_NO_OVERFLOW = 1,
120
+
121
+ /* Specific return codes from fz_place_story_flags. Also
122
+ * "non-zero" for 'more to fit'. */
123
+ FZ_PLACE_STORY_RETURN_ALL_FITTED = 0,
124
+ FZ_PLACE_STORY_RETURN_OVERFLOW_WIDTH = 2
125
+ };
126
+
127
+ /*
128
+ Draw the placed story to the given device.
129
+
130
+ This moves the point at which subsequent calls to fz_place_story
131
+ will restart placing to the end of what has just been output.
132
+ */
133
+ void fz_draw_story(fz_context *ctx, fz_story *story, fz_device *dev, fz_matrix ctm);
134
+
135
+ /*
136
+ Reset the position within the story at which the next layout call
137
+ will continue to the start of the story.
138
+ */
139
+ void fz_reset_story(fz_context *ctx, fz_story *story);
140
+
141
+ /*
142
+ Drop the html story.
143
+ */
144
+ void fz_drop_story(fz_context *ctx, fz_story *story);
145
+
146
+ /*
147
+ Get a borrowed reference to the DOM document pointer for this
148
+ story. Do not destroy this reference, it will be destroyed
149
+ when the story is laid out.
150
+
151
+ This only makes sense before the first placement of the story
152
+ or retrieval of the warnings. Once either of those things happen
153
+ the DOM representation is destroyed.
154
+ */
155
+ fz_xml *fz_story_document(fz_context *ctx, fz_story *story);
156
+
157
+
158
+ typedef struct
159
+ {
160
+ /* The overall depth of this element in the box structure.
161
+ * This can be used to compare the relative depths of different
162
+ * elements, but shouldn't be relied upon not to change between
163
+ * different versions of MuPDF. */
164
+ int depth;
165
+
166
+ /* The heading level of this element. 0 if not a header, or 1-6 for h1-h6. */
167
+ int heading;
168
+
169
+ /* The id for this element. */
170
+ const char *id;
171
+
172
+ /* The href for this element. */
173
+ const char *href;
174
+
175
+ /* The rectangle for this element. */
176
+ fz_rect rect;
177
+
178
+ /* The immediate text for this element. */
179
+ const char *text;
180
+
181
+ /* This indicates whether this opens and/or closes this element.
182
+ *
183
+ * As we traverse the tree we do a depth first search. In order for
184
+ * the caller of fz_story_positions to know whether a given element
185
+ * is inside another element, we therefore announce 'start' and 'stop'
186
+ * for each element. For instance, with:
187
+ *
188
+ * <div id="part1">
189
+ * <h1>Chapter 1</h1>...
190
+ * <h1>Chapter 2</h1>...
191
+ * ...
192
+ * </div>
193
+ * <div id="part2">
194
+ * <h1>Chapter 10</h1>...
195
+ * <h1>Chapter 11</h1>...
196
+ * ...
197
+ * </div>
198
+ *
199
+ * We would announce:
200
+ * + id='part1' (open)
201
+ * + header=1 "Chapter 1" (open/close)
202
+ * + header=1 "Chapter 2" (open/close)
203
+ * ...
204
+ * + id='part1' (close)
205
+ * + id='part2' (open)
206
+ * + header=1 "Chapter 10" (open/close)
207
+ * + header=1 "Chapter 11" (open/close)
208
+ * ...
209
+ * + id='part2' (close)
210
+ *
211
+ * If bit 0 is set, then this 'opens' the element.
212
+ * If bit 1 is set, then this 'closes' the element.
213
+ */
214
+ int open_close;
215
+
216
+ /* A count of the number of rectangles that the layout code has split the
217
+ * story into so far. After the first layout, this will be 1. If a
218
+ * layout is repeated, this number is not incremented. */
219
+ int rectangle_num;
220
+ } fz_story_element_position;
221
+
222
+ typedef void (fz_story_position_callback)(fz_context *ctx, void *arg, const fz_story_element_position *);
223
+
224
+ /*
225
+ Enumerate the positions for key blocks in the story.
226
+
227
+ This will cause the supplied function to be called with details of each
228
+ element in the story that is either a header, or has an id.
229
+ */
230
+ void fz_story_positions(fz_context *ctx, fz_story *story, fz_story_position_callback *cb, void *arg);
231
+
232
+ #endif