#ifndef MUPDF_FITZ_WRITE_DOCUMENT_H1#define MUPDF_FITZ_WRITE_DOCUMENT_H23#include "mupdf/fitz/system.h"4#include "mupdf/fitz/context.h"5#include "mupdf/fitz/document.h"67/*8In calls to fz_write, the following options structure can be used9to control aspects of the writing process. This structure may grow10in future, and should be zero-filled to allow forwards compatiblity.11*/12struct fz_write_options_s13{14int do_incremental; /* Write just the changed objects */15int do_ascii; /* If non-zero then attempt (where possible) to make16the output ascii. */17int do_expand; /* Bitflags; each non zero bit indicates an aspect18of the file that should be 'expanded' on19writing. */20int do_garbage; /* If non-zero then attempt (where possible) to21garbage collect the file before writing. */22int do_linear; /* If non-zero then write linearised. */23int do_clean; /* If non-zero then clean contents */24int continue_on_error; /* If non-zero, errors are (optionally)25counted and writing continues. */26int *errors; /* Pointer to a place to store a count of errors */27};2829/* An enumeration of bitflags to use in the above 'do_expand' field of30fz_write_options.31*/32enum33{34fz_expand_images = 1,35fz_expand_fonts = 2,36fz_expand_all = -137};3839/*40fz_write: Write a document out.4142(In development - Subject to change in future versions)4344Save a copy of the current document in its original format.45Internally the document may change.4647doc: The document to save.4849filename: The filename to save to.5051opts: NULL, or a pointer to an options structure.5253May throw exceptions.54*/55void fz_write_document(fz_context *ctx, fz_document *doc, char *filename, fz_write_options *opts);5657#endif585960