1 #ifndef MUPDF_FITZ_WRITE_DOCUMENT_H
2 #define MUPDF_FITZ_WRITE_DOCUMENT_H
4 #include "mupdf/fitz/system.h"
5 #include "mupdf/fitz/context.h"
6 #include "mupdf/fitz/document.h"
9 In calls to fz_write, the following options structure can be used
10 to control aspects of the writing process. This structure may grow
11 in future, and should be zero-filled to allow forwards compatiblity.
13 struct fz_write_options_s
15 int do_incremental; /* Write just the changed objects */
16 int do_ascii; /* If non-zero then attempt (where possible) to make
18 int do_expand; /* Bitflags; each non zero bit indicates an aspect
19 of the file that should be 'expanded' on
21 int do_garbage; /* If non-zero then attempt (where possible) to
22 garbage collect the file before writing. */
23 int do_linear; /* If non-zero then write linearised. */
24 int do_clean; /* If non-zero then clean contents */
25 int continue_on_error; /* If non-zero, errors are (optionally)
26 counted and writing continues. */
27 int *errors; /* Pointer to a place to store a count of errors */
30 /* An enumeration of bitflags to use in the above 'do_expand' field of
41 fz_write: Write a document out.
43 (In development - Subject to change in future versions)
45 Save a copy of the current document in its original format.
46 Internally the document may change.
48 doc: The document to save.
50 filename: The filename to save to.
52 opts: NULL, or a pointer to an options structure.
56 void fz_write_document(fz_document *doc, char *filename, fz_write_options *opts);