Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
7858 views
1
#ifndef MUPDF_FITZ_WRITE_DOCUMENT_H
2
#define MUPDF_FITZ_WRITE_DOCUMENT_H
3
4
#include "mupdf/fitz/system.h"
5
#include "mupdf/fitz/context.h"
6
#include "mupdf/fitz/document.h"
7
8
/*
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.
12
*/
13
struct fz_write_options_s
14
{
15
int do_incremental; /* Write just the changed objects */
16
int do_ascii; /* If non-zero then attempt (where possible) to make
17
the output ascii. */
18
int do_expand; /* Bitflags; each non zero bit indicates an aspect
19
of the file that should be 'expanded' on
20
writing. */
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 */
28
};
29
30
/* An enumeration of bitflags to use in the above 'do_expand' field of
31
fz_write_options.
32
*/
33
enum
34
{
35
fz_expand_images = 1,
36
fz_expand_fonts = 2,
37
fz_expand_all = -1
38
};
39
40
/*
41
fz_write: Write a document out.
42
43
(In development - Subject to change in future versions)
44
45
Save a copy of the current document in its original format.
46
Internally the document may change.
47
48
doc: The document to save.
49
50
filename: The filename to save to.
51
52
opts: NULL, or a pointer to an options structure.
53
54
May throw exceptions.
55
*/
56
void fz_write_document(fz_context *ctx, fz_document *doc, char *filename, fz_write_options *opts);
57
58
#endif
59
60