mupdf
Loading...
Searching...
No Matches
writer.h
Go to the documentation of this file.
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_WRITER_H
24#define MUPDF_FITZ_WRITER_H
25
26#include "mupdf/fitz/system.h"
27#include "mupdf/fitz/context.h"
28#include "mupdf/fitz/output.h"
29#include "mupdf/fitz/document.h"
30#include "mupdf/fitz/device.h"
31
33
43
51
60
71
72#define fz_new_derived_document_writer(CTX,TYPE,BEGIN_PAGE,END_PAGE,CLOSE,DROP) \
73 ((TYPE *)Memento_label(fz_new_document_writer_of_size(CTX,sizeof(TYPE),BEGIN_PAGE,END_PAGE,CLOSE,DROP),#TYPE))
74
87fz_document_writer *fz_new_document_writer(fz_context *ctx, const char *path, const char *format, const char *options);
88
94fz_new_document_writer_with_output(fz_context *ctx, fz_output *out, const char *format, const char *options);
95
97fz_new_document_writer_with_buffer(fz_context *ctx, fz_buffer *buf, const char *format, const char *options);
98
107fz_document_writer *fz_new_pdf_writer(fz_context *ctx, const char *path, const char *options);
109fz_document_writer *fz_new_svg_writer(fz_context *ctx, const char *path, const char *options);
111
112fz_document_writer *fz_new_text_writer(fz_context *ctx, const char *format, const char *path, const char *options);
113fz_document_writer *fz_new_text_writer_with_output(fz_context *ctx, const char *format, fz_output *out, const char *options);
114
115fz_document_writer *fz_new_odt_writer(fz_context *ctx, const char *path, const char *options);
117fz_document_writer *fz_new_docx_writer(fz_context *ctx, const char *path, const char *options);
119
120fz_document_writer *fz_new_ps_writer(fz_context *ctx, const char *path, const char *options);
122fz_document_writer *fz_new_pcl_writer(fz_context *ctx, const char *path, const char *options);
124fz_document_writer *fz_new_pclm_writer(fz_context *ctx, const char *path, const char *options);
126fz_document_writer *fz_new_pwg_writer(fz_context *ctx, const char *path, const char *options);
128
129fz_document_writer *fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options);
131
132fz_document_writer *fz_new_csv_writer(fz_context *ctx, const char *path, const char *options);
134
147typedef int (fz_pdfocr_progress_fn)(fz_context *ctx, void *progress_arg, int page, int percent);
148
149fz_document_writer *fz_new_pdfocr_writer(fz_context *ctx, const char *path, const char *options);
152
153fz_document_writer *fz_new_jpeg_pixmap_writer(fz_context *ctx, const char *path, const char *options);
154fz_document_writer *fz_new_png_pixmap_writer(fz_context *ctx, const char *path, const char *options);
155fz_document_writer *fz_new_pam_pixmap_writer(fz_context *ctx, const char *path, const char *options);
156fz_document_writer *fz_new_pnm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
157fz_document_writer *fz_new_pgm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
158fz_document_writer *fz_new_ppm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
159fz_document_writer *fz_new_pbm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
160fz_document_writer *fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path, const char *options);
161
172
178
184
193
203
204fz_document_writer *fz_new_pixmap_writer(fz_context *ctx, const char *path, const char *options, const char *default_path, int n,
205 void (*save)(fz_context *ctx, fz_pixmap *pix, const char *filename));
206
208 void (*write)(fz_context *ctx, fz_output *out, fz_pixmap *pix));
209
210FZ_DATA extern const char *fz_pdf_write_options_usage;
211FZ_DATA extern const char *fz_svg_write_options_usage;
212
213FZ_DATA extern const char *fz_pcl_write_options_usage;
214FZ_DATA extern const char *fz_pclm_write_options_usage;
215FZ_DATA extern const char *fz_pwg_write_options_usage;
216FZ_DATA extern const char *fz_pdfocr_write_options_usage;
217
218/* Implementation details: subject to change. */
219
232
244
245
246
247#endif
#define FZ_DATA
Definition export.h:49
Definition buffer.h:41
Definition context.h:886
Definition device.h:290
Definition writer.h:225
fz_document_writer_close_writer_fn * close_writer
Definition writer.h:228
fz_document_writer_drop_writer_fn * drop_writer
Definition writer.h:229
fz_document_writer_begin_page_fn * begin_page
Definition writer.h:226
fz_document_writer_end_page_fn * end_page
Definition writer.h:227
fz_device * dev
Definition writer.h:230
Definition document.h:1080
Definition output.h:111
Definition pixmap.h:432
Definition geometry.h:231
fz_document_writer * fz_new_odt_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_png_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pclm_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_ps_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_odt_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
void fz_end_page(fz_context *ctx, fz_document_writer *wri)
fz_document_writer * fz_new_csv_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_pdf_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_pkm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_document_writer_of_size(fz_context *ctx, size_t size, fz_document_writer_begin_page_fn *begin_page, fz_document_writer_end_page_fn *end_page, fz_document_writer_close_writer_fn *close, fz_document_writer_drop_writer_fn *drop)
fz_document_writer * fz_new_document_writer_with_output(fz_context *ctx, fz_output *out, const char *format, const char *options)
fz_document_writer * fz_new_pdfocr_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_pixmap_writer_with_output(fz_context *ctx, fz_output *out, const char *options, int n, void(*write)(fz_context *ctx, fz_output *out, fz_pixmap *pix))
fz_document_writer * fz_new_ps_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
void fz_write_document(fz_context *ctx, fz_document_writer *wri, fz_document *doc)
fz_document_writer * fz_new_pgm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pnm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_docx_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_pam_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_csv_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_jpeg_pixmap_writer(fz_context *ctx, const char *path, const char *options)
void fz_document_writer_end_page_fn(fz_context *ctx, fz_document_writer *wri, fz_device *dev)
Definition writer.h:50
fz_document_writer * fz_new_pclm_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pcl_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
FZ_DATA const char * fz_pclm_write_options_usage
fz_document_writer * fz_new_svg_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_pdfocr_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_text_writer_with_output(fz_context *ctx, const char *format, fz_output *out, const char *options)
void fz_close_document_writer(fz_context *ctx, fz_document_writer *wri)
fz_document_writer * fz_new_cbz_writer(fz_context *ctx, const char *path, const char *options)
void fz_drop_document_writer(fz_context *ctx, fz_document_writer *wri)
fz_document_writer * fz_new_document_writer_with_buffer(fz_context *ctx, fz_buffer *buf, const char *format, const char *options)
void fz_document_writer_drop_writer_fn(fz_context *ctx, fz_document_writer *wri)
Definition writer.h:70
fz_document_writer * fz_new_pwg_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
fz_document_writer * fz_new_document_writer(fz_context *ctx, const char *path, const char *format, const char *options)
fz_document_writer * fz_new_pwg_writer(fz_context *ctx, const char *path, const char *options)
FZ_DATA const char * fz_pdf_write_options_usage
fz_document_writer * fz_new_svg_writer(fz_context *ctx, const char *path, const char *options)
void fz_document_writer_close_writer_fn(fz_context *ctx, fz_document_writer *wri)
Definition writer.h:59
fz_document_writer * fz_new_pbm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
FZ_DATA const char * fz_pdfocr_write_options_usage
void fz_pdfocr_writer_set_progress(fz_context *ctx, fz_document_writer *writer, fz_pdfocr_progress_fn *progress, void *)
fz_device * fz_document_writer_begin_page_fn(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox)
Definition writer.h:42
FZ_DATA const char * fz_pwg_write_options_usage
fz_document_writer * fz_new_text_writer(fz_context *ctx, const char *format, const char *path, const char *options)
fz_device * fz_begin_page(fz_context *ctx, fz_document_writer *wri, fz_rect mediabox)
int fz_pdfocr_progress_fn(fz_context *ctx, void *progress_arg, int page, int percent)
Definition writer.h:147
fz_document_writer * fz_new_ppm_pixmap_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pcl_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pdf_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_cbz_writer_with_output(fz_context *ctx, fz_output *out, const char *options)
FZ_DATA const char * fz_pcl_write_options_usage
fz_document_writer * fz_new_docx_writer(fz_context *ctx, const char *path, const char *options)
fz_document_writer * fz_new_pixmap_writer(fz_context *ctx, const char *path, const char *options, const char *default_path, int n, void(*save)(fz_context *ctx, fz_pixmap *pix, const char *filename))
FZ_DATA const char * fz_svg_write_options_usage