QPDFWriter_private.hh
3.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#ifndef QPDFWRITER_PRIVATE_HH
#define QPDFWRITER_PRIVATE_HH
#include <qpdf/QPDFWriter.hh>
#include <qpdf/ObjTable.hh>
// This file is intended for inclusion by QPDFWriter, QPDF, QPDF_optimization and QPDF_linearization
// only.
struct QPDFWriter::Object
{
int renumber{0};
int gen{0};
int object_stream{0};
};
struct QPDFWriter::NewObject
{
QPDFXRefEntry xref;
qpdf_offset_t length{0};
};
class QPDFWriter::ObjTable: public ::ObjTable<QPDFWriter::Object>
{
friend class QPDFWriter;
public:
bool
getStreamsEmpty() const noexcept
{
return streams_empty;
}
private:
// For performance, set by QPDFWriter rather than tracked by ObjTable.
bool streams_empty{false};
};
class QPDFWriter::NewObjTable: public ::ObjTable<QPDFWriter::NewObject>
{
friend class QPDFWriter;
};
class QPDFWriter::Members
{
friend class QPDFWriter;
public:
QPDF_DLL
~Members();
private:
Members(QPDF& pdf);
Members(Members const&) = delete;
QPDF& pdf;
QPDFObjGen root_og{-1, 0};
char const* filename{"unspecified"};
FILE* file{nullptr};
bool close_file{false};
Pl_Buffer* buffer_pipeline{nullptr};
Buffer* output_buffer{nullptr};
bool normalize_content_set{false};
bool normalize_content{false};
bool compress_streams{true};
bool compress_streams_set{false};
qpdf_stream_decode_level_e stream_decode_level{qpdf_dl_generalized};
bool stream_decode_level_set{false};
bool recompress_flate{false};
bool qdf_mode{false};
bool preserve_unreferenced_objects{false};
bool newline_before_endstream{false};
bool static_id{false};
bool suppress_original_object_ids{false};
bool direct_stream_lengths{true};
bool encrypted{false};
bool preserve_encryption{true};
bool linearized{false};
bool pclm{false};
qpdf_object_stream_e object_stream_mode{qpdf_o_preserve};
std::string encryption_key;
bool encrypt_metadata{true};
bool encrypt_use_aes{false};
std::map<std::string, std::string> encryption_dictionary;
int encryption_V{0};
int encryption_R{0};
std::string id1; // for /ID key of
std::string id2; // trailer dictionary
std::string final_pdf_version;
int final_extension_level{0};
std::string min_pdf_version;
int min_extension_level{0};
std::string forced_pdf_version;
int forced_extension_level{0};
std::string extra_header_text;
int encryption_dict_objid{0};
std::string cur_data_key;
std::list<std::shared_ptr<Pipeline>> to_delete;
Pl_Count* pipeline{nullptr};
std::vector<QPDFObjectHandle> object_queue;
size_t object_queue_front{0};
QPDFWriter::ObjTable obj;
QPDFWriter::NewObjTable new_obj;
int next_objid{1};
int cur_stream_length_id{0};
size_t cur_stream_length{0};
bool added_newline{false};
size_t max_ostream_index{0};
std::set<QPDFObjGen> normalized_streams;
std::map<QPDFObjGen, int> page_object_to_seq;
std::map<QPDFObjGen, int> contents_to_page_seq;
std::map<int, std::vector<QPDFObjGen>> object_stream_to_objects;
std::list<Pipeline*> pipeline_stack;
unsigned long long next_stack_id{0};
bool deterministic_id{false};
Pl_MD5* md5_pipeline{nullptr};
std::string deterministic_id_data;
bool did_write_setup{false};
// For linearization only
std::string lin_pass1_filename;
// For progress reporting
std::shared_ptr<QPDFWriter::ProgressReporter> progress_reporter;
int events_expected{0};
int events_seen{0};
int next_progress_report{0};
};
#endif // QPDFWRITER_PRIVATE_HH