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,507 @@
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_WRITE_PIXMAP_H
24
+ #define MUPDF_FITZ_WRITE_PIXMAP_H
25
+
26
+ #include "mupdf/fitz/system.h"
27
+ #include "mupdf/fitz/context.h"
28
+ #include "mupdf/fitz/output.h"
29
+ #include "mupdf/fitz/band-writer.h"
30
+ #include "mupdf/fitz/pixmap.h"
31
+ #include "mupdf/fitz/bitmap.h"
32
+ #include "mupdf/fitz/buffer.h"
33
+ #include "mupdf/fitz/image.h"
34
+ #include "mupdf/fitz/writer.h"
35
+
36
+ /**
37
+ PCL output
38
+ */
39
+ typedef struct
40
+ {
41
+ /* Features of a particular printer */
42
+ int features;
43
+ const char *odd_page_init;
44
+ const char *even_page_init;
45
+
46
+ /* Options for this job */
47
+ int tumble;
48
+ int duplex_set;
49
+ int duplex;
50
+ int paper_size;
51
+ int manual_feed_set;
52
+ int manual_feed;
53
+ int media_position_set;
54
+ int media_position;
55
+ int orientation;
56
+
57
+ /* Updated as we move through the job */
58
+ int page_count;
59
+ } fz_pcl_options;
60
+
61
+ /**
62
+ Initialize PCL option struct for a given preset.
63
+
64
+ Currently defined presets include:
65
+
66
+ generic Generic PCL printer
67
+ ljet4 HP DeskJet
68
+ dj500 HP DeskJet 500
69
+ fs600 Kyocera FS-600
70
+ lj HP LaserJet, HP LaserJet Plus
71
+ lj2 HP LaserJet IIp, HP LaserJet IId
72
+ lj3 HP LaserJet III
73
+ lj3d HP LaserJet IIId
74
+ lj4 HP LaserJet 4
75
+ lj4pl HP LaserJet 4 PL
76
+ lj4d HP LaserJet 4d
77
+ lp2563b HP 2563B line printer
78
+ oce9050 Oce 9050 Line printer
79
+ */
80
+ void fz_pcl_preset(fz_context *ctx, fz_pcl_options *opts, const char *preset);
81
+
82
+ /**
83
+ Parse PCL options.
84
+
85
+ Currently defined options and values are as follows:
86
+
87
+ preset=X Either "generic" or one of the presets as for fz_pcl_preset.
88
+ spacing=0 No vertical spacing capability
89
+ spacing=1 PCL 3 spacing (<ESC>*p+<n>Y)
90
+ spacing=2 PCL 4 spacing (<ESC>*b<n>Y)
91
+ spacing=3 PCL 5 spacing (<ESC>*b<n>Y and clear seed row)
92
+ mode2 Disable/Enable mode 2 graphics compression
93
+ mode3 Disable/Enable mode 3 graphics compression
94
+ eog_reset End of graphics (<ESC>*rB) resets all parameters
95
+ has_duplex Duplex supported (<ESC>&l<duplex>S)
96
+ has_papersize Papersize setting supported (<ESC>&l<sizecode>A)
97
+ has_copies Number of copies supported (<ESC>&l<copies>X)
98
+ is_ljet4pjl Disable/Enable HP 4PJL model-specific output
99
+ is_oce9050 Disable/Enable Oce 9050 model-specific output
100
+ */
101
+ fz_pcl_options *fz_parse_pcl_options(fz_context *ctx, fz_pcl_options *opts, const char *args);
102
+
103
+ /**
104
+ Create a new band writer, outputting monochrome pcl.
105
+ */
106
+ fz_band_writer *fz_new_mono_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
107
+
108
+ /**
109
+ Write a bitmap as mono PCL.
110
+ */
111
+ void fz_write_bitmap_as_pcl(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pcl_options *pcl);
112
+
113
+ /**
114
+ Save a bitmap as mono PCL.
115
+ */
116
+ void fz_save_bitmap_as_pcl(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pcl_options *pcl);
117
+
118
+ /**
119
+ Create a new band writer, outputting color pcl.
120
+ */
121
+ fz_band_writer *fz_new_color_pcl_band_writer(fz_context *ctx, fz_output *out, const fz_pcl_options *options);
122
+
123
+ /**
124
+ Write an (RGB) pixmap as color PCL.
125
+ */
126
+ void fz_write_pixmap_as_pcl(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pcl_options *pcl);
127
+
128
+ /**
129
+ Save an (RGB) pixmap as color PCL.
130
+ */
131
+ void fz_save_pixmap_as_pcl(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pcl_options *pcl);
132
+
133
+ /**
134
+ PCLm output
135
+ */
136
+ typedef struct
137
+ {
138
+ int compress;
139
+ int strip_height;
140
+
141
+ /* Updated as we move through the job */
142
+ int page_count;
143
+ } fz_pclm_options;
144
+
145
+ /**
146
+ Parse PCLm options.
147
+
148
+ Currently defined options and values are as follows:
149
+
150
+ compression=none: No compression
151
+ compression=flate: Flate compression
152
+ strip-height=n: Strip height (default 16)
153
+ */
154
+ fz_pclm_options *fz_parse_pclm_options(fz_context *ctx, fz_pclm_options *opts, const char *args);
155
+
156
+ /**
157
+ Create a new band writer, outputting pclm
158
+ */
159
+ fz_band_writer *fz_new_pclm_band_writer(fz_context *ctx, fz_output *out, const fz_pclm_options *options);
160
+
161
+ /**
162
+ Write a (Greyscale or RGB) pixmap as pclm.
163
+ */
164
+ void fz_write_pixmap_as_pclm(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pclm_options *options);
165
+
166
+ /**
167
+ Save a (Greyscale or RGB) pixmap as pclm.
168
+ */
169
+ void fz_save_pixmap_as_pclm(fz_context *ctx, fz_pixmap *pixmap, const char *filename, int append, const fz_pclm_options *options);
170
+
171
+ /**
172
+ PDFOCR output
173
+ */
174
+ typedef struct
175
+ {
176
+ int compress;
177
+ int strip_height;
178
+ char language[256];
179
+ char datadir[1024];
180
+
181
+ int skew_correct; /* 0 = no skew correction. 1 = automatic. 2 = use specified angle. */
182
+ float skew_angle; /* Only used if skew == 2 */
183
+ int skew_border; /* 0 = increase size so no content is lost. 1 = maintain size. 2 = decrease size so no new pixels are visible. */
184
+
185
+ /* Updated as we move through the job */
186
+ int page_count;
187
+ } fz_pdfocr_options;
188
+
189
+ /**
190
+ Parse PDFOCR options.
191
+
192
+ Currently defined options and values are as follows:
193
+
194
+ compression=none: No compression
195
+ compression=flate: Flate compression
196
+ strip-height=n: Strip height (default 16)
197
+ ocr-language=<lang>: OCR Language (default eng)
198
+ ocr-datadir=<datadir>: OCR data path (default rely on TESSDATA_PREFIX)
199
+ */
200
+ fz_pdfocr_options *fz_parse_pdfocr_options(fz_context *ctx, fz_pdfocr_options *opts, const char *args);
201
+
202
+ /**
203
+ Create a new band writer, outputting pdfocr.
204
+
205
+ Ownership of output stays with the caller, the band writer
206
+ borrows the reference. The caller must keep the output around
207
+ for the duration of the band writer, and then close/drop as
208
+ appropriate.
209
+ */
210
+ fz_band_writer *fz_new_pdfocr_band_writer(fz_context *ctx, fz_output *out, const fz_pdfocr_options *options);
211
+
212
+ /**
213
+ Set the progress callback for a pdfocr bandwriter.
214
+ */
215
+ void fz_pdfocr_band_writer_set_progress(fz_context *ctx, fz_band_writer *writer, fz_pdfocr_progress_fn *progress_fn, void *progress_arg);
216
+
217
+ /**
218
+ Write a (Greyscale or RGB) pixmap as pdfocr.
219
+ */
220
+ void fz_write_pixmap_as_pdfocr(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pdfocr_options *options);
221
+
222
+ /**
223
+ Save a (Greyscale or RGB) pixmap as pdfocr.
224
+ */
225
+ void fz_save_pixmap_as_pdfocr(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pdfocr_options *options);
226
+
227
+ /**
228
+ Save a (Greyscale or RGB) pixmap as a png.
229
+ */
230
+ void fz_save_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
231
+
232
+ /**
233
+ Write a pixmap as a JPEG.
234
+ */
235
+ void fz_write_pixmap_as_jpeg(fz_context *ctx, fz_output *out, fz_pixmap *pix, int quality, int invert_cmyk);
236
+
237
+ /**
238
+ Save a pixmap as a JPEG.
239
+ */
240
+ void fz_save_pixmap_as_jpeg(fz_context *ctx, fz_pixmap *pixmap, const char *filename, int quality);
241
+
242
+ /**
243
+ Write a (Greyscale or RGB) pixmap as a png.
244
+ */
245
+ void fz_write_pixmap_as_png(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap);
246
+
247
+ /**
248
+ Pixmap data as JP2K with no subsampling.
249
+
250
+ quality = 100 = lossless
251
+ otherwise for a factor of x compression use 100-x. (so 80 is 1:20 compression)
252
+ */
253
+ void fz_write_pixmap_as_jpx(fz_context *ctx, fz_output *out, fz_pixmap *pix, int quality);
254
+
255
+ /**
256
+ Save pixmap data as JP2K with no subsampling.
257
+
258
+ quality = 100 = lossless
259
+ otherwise for a factor of x compression use 100-x. (so 80 is 1:20 compression)
260
+ */
261
+ void fz_save_pixmap_as_jpx(fz_context *ctx, fz_pixmap *pixmap, const char *filename, int q);
262
+
263
+ /**
264
+ Create a new png band writer (greyscale or RGB, with or without
265
+ alpha).
266
+ */
267
+ fz_band_writer *fz_new_png_band_writer(fz_context *ctx, fz_output *out);
268
+
269
+ /**
270
+ Re-encode a given image as a PNG into a buffer.
271
+
272
+ Ownership of the buffer is returned.
273
+ */
274
+ fz_buffer *fz_new_buffer_from_image_as_png(fz_context *ctx, fz_image *image, fz_color_params color_params);
275
+ fz_buffer *fz_new_buffer_from_image_as_pbm(fz_context *ctx, fz_image *image, fz_color_params color_params);
276
+ fz_buffer *fz_new_buffer_from_image_as_pkm(fz_context *ctx, fz_image *image, fz_color_params color_params);
277
+ fz_buffer *fz_new_buffer_from_image_as_pnm(fz_context *ctx, fz_image *image, fz_color_params color_params);
278
+ fz_buffer *fz_new_buffer_from_image_as_pam(fz_context *ctx, fz_image *image, fz_color_params color_params);
279
+ fz_buffer *fz_new_buffer_from_image_as_psd(fz_context *ctx, fz_image *image, fz_color_params color_params);
280
+ fz_buffer *fz_new_buffer_from_image_as_jpeg(fz_context *ctx, fz_image *image, fz_color_params color_params, int quality, int invert_cmyk);
281
+ fz_buffer *fz_new_buffer_from_image_as_jpx(fz_context *ctx, fz_image *image, fz_color_params color_params, int quality);
282
+
283
+ /**
284
+ Re-encode a given pixmap as a PNG into a buffer.
285
+
286
+ Ownership of the buffer is returned.
287
+ */
288
+ fz_buffer *fz_new_buffer_from_pixmap_as_png(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params);
289
+ fz_buffer *fz_new_buffer_from_pixmap_as_pbm(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params);
290
+ fz_buffer *fz_new_buffer_from_pixmap_as_pkm(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params);
291
+ fz_buffer *fz_new_buffer_from_pixmap_as_pnm(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params);
292
+ fz_buffer *fz_new_buffer_from_pixmap_as_pam(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params);
293
+ fz_buffer *fz_new_buffer_from_pixmap_as_psd(fz_context *ctx, fz_pixmap *pix, fz_color_params color_params);
294
+ fz_buffer *fz_new_buffer_from_pixmap_as_jpeg(fz_context *ctx, fz_pixmap *pixmap, fz_color_params color_params, int quality, int invert_cmyk);
295
+ fz_buffer *fz_new_buffer_from_pixmap_as_jpx(fz_context *ctx, fz_pixmap *pix, fz_color_params color_params, int quality);
296
+
297
+ /**
298
+ Save a pixmap as a pnm (greyscale or rgb, no alpha).
299
+ */
300
+ void fz_save_pixmap_as_pnm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
301
+
302
+ /**
303
+ Write a pixmap as a pnm (greyscale or rgb, no alpha).
304
+ */
305
+ void fz_write_pixmap_as_pnm(fz_context *ctx, fz_output *out, fz_pixmap *pixmap);
306
+
307
+ /**
308
+ Create a band writer targeting pnm (greyscale or rgb, no
309
+ alpha).
310
+ */
311
+ fz_band_writer *fz_new_pnm_band_writer(fz_context *ctx, fz_output *out);
312
+
313
+ /**
314
+ Save a pixmap as a pnm (greyscale, rgb or cmyk, with or without
315
+ alpha).
316
+ */
317
+ void fz_save_pixmap_as_pam(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
318
+
319
+ /**
320
+ Write a pixmap as a pnm (greyscale, rgb or cmyk, with or without
321
+ alpha).
322
+ */
323
+ void fz_write_pixmap_as_pam(fz_context *ctx, fz_output *out, fz_pixmap *pixmap);
324
+
325
+ /**
326
+ Create a band writer targeting pnm (greyscale, rgb or cmyk,
327
+ with or without alpha).
328
+ */
329
+ fz_band_writer *fz_new_pam_band_writer(fz_context *ctx, fz_output *out);
330
+
331
+ /**
332
+ Save a bitmap as a pbm.
333
+ */
334
+ void fz_save_bitmap_as_pbm(fz_context *ctx, fz_bitmap *bitmap, const char *filename);
335
+
336
+ /**
337
+ Write a bitmap as a pbm.
338
+ */
339
+ void fz_write_bitmap_as_pbm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap);
340
+
341
+ /**
342
+ Create a new band writer, targeting pbm.
343
+ */
344
+ fz_band_writer *fz_new_pbm_band_writer(fz_context *ctx, fz_output *out);
345
+
346
+ /**
347
+ Save a pixmap as a pbm. (Performing halftoning).
348
+ */
349
+ void fz_save_pixmap_as_pbm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
350
+
351
+ /**
352
+ Save a CMYK bitmap as a pkm.
353
+ */
354
+ void fz_save_bitmap_as_pkm(fz_context *ctx, fz_bitmap *bitmap, const char *filename);
355
+
356
+ /**
357
+ Write a CMYK bitmap as a pkm.
358
+ */
359
+ void fz_write_bitmap_as_pkm(fz_context *ctx, fz_output *out, fz_bitmap *bitmap);
360
+
361
+ /**
362
+ Create a new pkm band writer for CMYK pixmaps.
363
+ */
364
+ fz_band_writer *fz_new_pkm_band_writer(fz_context *ctx, fz_output *out);
365
+
366
+ /**
367
+ Save a CMYK pixmap as a pkm. (Performing halftoning).
368
+ */
369
+ void fz_save_pixmap_as_pkm(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
370
+
371
+ /**
372
+ Write a (gray, rgb, or cmyk, no alpha) pixmap out as postscript.
373
+ */
374
+ void fz_write_pixmap_as_ps(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap);
375
+
376
+ /**
377
+ Save a (gray, rgb, or cmyk, no alpha) pixmap out as postscript.
378
+ */
379
+ void fz_save_pixmap_as_ps(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append);
380
+
381
+ /**
382
+ Create a postscript band writer for gray, rgb, or cmyk, no
383
+ alpha.
384
+ */
385
+ fz_band_writer *fz_new_ps_band_writer(fz_context *ctx, fz_output *out);
386
+
387
+ /**
388
+ Write the file level header for ps band writer output.
389
+ */
390
+ void fz_write_ps_file_header(fz_context *ctx, fz_output *out);
391
+
392
+ /**
393
+ Write the file level trailer for ps band writer output.
394
+ */
395
+ void fz_write_ps_file_trailer(fz_context *ctx, fz_output *out, int pages);
396
+
397
+ /**
398
+ Save a pixmap as a PSD file.
399
+ */
400
+ void fz_save_pixmap_as_psd(fz_context *ctx, fz_pixmap *pixmap, const char *filename);
401
+
402
+ /**
403
+ Write a pixmap as a PSD file.
404
+ */
405
+ void fz_write_pixmap_as_psd(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap);
406
+
407
+ /**
408
+ Open a PSD band writer.
409
+ */
410
+ fz_band_writer *fz_new_psd_band_writer(fz_context *ctx, fz_output *out);
411
+
412
+ typedef struct
413
+ {
414
+ /* These are not interpreted as CStrings by the writing code,
415
+ * but are rather copied directly out. */
416
+ char media_class[64];
417
+ char media_color[64];
418
+ char media_type[64];
419
+ char output_type[64];
420
+
421
+ unsigned int advance_distance;
422
+ int advance_media;
423
+ int collate;
424
+ int cut_media;
425
+ int duplex;
426
+ int insert_sheet;
427
+ int jog;
428
+ int leading_edge;
429
+ int manual_feed;
430
+ unsigned int media_position;
431
+ unsigned int media_weight;
432
+ int mirror_print;
433
+ int negative_print;
434
+ unsigned int num_copies;
435
+ int orientation;
436
+ int output_face_up;
437
+ unsigned int PageSize[2];
438
+ int separations;
439
+ int tray_switch;
440
+ int tumble;
441
+
442
+ int media_type_num;
443
+ int compression;
444
+ unsigned int row_count;
445
+ unsigned int row_feed;
446
+ unsigned int row_step;
447
+
448
+ /* These are not interpreted as CStrings by the writing code, but
449
+ * are rather copied directly out. */
450
+ char rendering_intent[64];
451
+ char page_size_name[64];
452
+ } fz_pwg_options;
453
+
454
+ /**
455
+ Save a pixmap as a PWG.
456
+ */
457
+ void fz_save_pixmap_as_pwg(fz_context *ctx, fz_pixmap *pixmap, char *filename, int append, const fz_pwg_options *pwg);
458
+
459
+ /**
460
+ Save a bitmap as a PWG.
461
+ */
462
+ void fz_save_bitmap_as_pwg(fz_context *ctx, fz_bitmap *bitmap, char *filename, int append, const fz_pwg_options *pwg);
463
+
464
+ /**
465
+ Write a pixmap as a PWG.
466
+ */
467
+ void fz_write_pixmap_as_pwg(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
468
+
469
+ /**
470
+ Write a bitmap as a PWG.
471
+ */
472
+ void fz_write_bitmap_as_pwg(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);
473
+
474
+ /**
475
+ Write a pixmap as a PWG page.
476
+
477
+ Caller should provide a file header by calling
478
+ fz_write_pwg_file_header, but can then write several pages to
479
+ the same file.
480
+ */
481
+ void fz_write_pixmap_as_pwg_page(fz_context *ctx, fz_output *out, const fz_pixmap *pixmap, const fz_pwg_options *pwg);
482
+
483
+ /**
484
+ Write a bitmap as a PWG page.
485
+
486
+ Caller should provide a file header by calling
487
+ fz_write_pwg_file_header, but can then write several pages to
488
+ the same file.
489
+ */
490
+ void fz_write_bitmap_as_pwg_page(fz_context *ctx, fz_output *out, const fz_bitmap *bitmap, const fz_pwg_options *pwg);
491
+
492
+ /**
493
+ Create a new monochrome pwg band writer.
494
+ */
495
+ fz_band_writer *fz_new_mono_pwg_band_writer(fz_context *ctx, fz_output *out, const fz_pwg_options *pwg);
496
+
497
+ /**
498
+ Create a new color pwg band writer.
499
+ */
500
+ fz_band_writer *fz_new_pwg_band_writer(fz_context *ctx, fz_output *out, const fz_pwg_options *pwg);
501
+
502
+ /**
503
+ Output the file header to a pwg stream, ready for pages to follow it.
504
+ */
505
+ void fz_write_pwg_file_header(fz_context *ctx, fz_output *out); /* for use by mudraw.c */
506
+
507
+ #endif