aboutsummaryrefslogtreecommitdiffstats
path: root/include/qpdf/QPDF.hh
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2022-07-31 21:26:24 +0200
committerJay Berkenbilt <ejb@ql.org>2022-07-31 22:23:17 +0200
commit12d065c75120d68cb7dd8445be4620e003598d7d (patch)
treedd190dfe50b68297109dfd4b1bc098f8e489cab3 /include/qpdf/QPDF.hh
parent13cf35ce2f39780b5ce35fd65be4b0ae44ea989d (diff)
downloadqpdf-12d065c75120d68cb7dd8445be4620e003598d7d.tar.zst
Provide a simpler QPDF::writeJSON
Diffstat (limited to 'include/qpdf/QPDF.hh')
-rw-r--r--include/qpdf/QPDF.hh32
1 files changed, 22 insertions, 10 deletions
diff --git a/include/qpdf/QPDF.hh b/include/qpdf/QPDF.hh
index f0a5f31c..fcc17522 100644
--- a/include/qpdf/QPDF.hh
+++ b/include/qpdf/QPDF.hh
@@ -134,16 +134,8 @@ class QPDF
void updateFromJSON(std::shared_ptr<InputSource>);
// Write qpdf JSON format to the pipeline "p". The only supported
- // version is 2.
- //
- // If the value of "complete" is true, a complete JSON object
- // containing only the "qpdf" key is written to the pipeline, and
- // finish() is called on the pipeline at the end. If the value of
- // "complete" is false, the "qpdf" key and its value are written
- // to the pipeline assuming that a dictionary is already open, and
- // finish() is not called. The parameter first_key indicates
- // whether this is the first key in an in-progress dictionary. It
- // will be set to false by writeJSON.
+ // version is 2. The finish() method is not called on the
+ // pipeline.
//
// The decode_level parameter controls which streams are
// uncompressed in the JSON. Use qpdf_dl_none to preserve all
@@ -168,6 +160,26 @@ class QPDF
void writeJSON(
int version,
Pipeline* p,
+ qpdf_stream_decode_level_e decode_level,
+ qpdf_json_stream_data_e json_stream_data,
+ std::string const& file_prefix,
+ std::set<std::string> wanted_objects);
+
+ // This version of writeJSON enables writing only the "qpdf" key
+ // of an in-progress dictionary. If the value of "complete" is
+ // true, a complete JSON object containing only the "qpdf" key is
+ // written to the pipeline. If the value of "complete" is false,
+ // the "qpdf" key and its value are written to the pipeline
+ // assuming that a dictionary is already open. The parameter
+ // first_key indicates whether this is the first key in an
+ // in-progress dictionary. It will be set to false by writeJSON.
+ // The "qpdf" key and value are written as if at depth 1 in a
+ // prettified JSON output. Remaining arguments are the same as the
+ // above version.
+ QPDF_DLL
+ void writeJSON(
+ int version,
+ Pipeline* p,
bool complete,
bool& first_key,
qpdf_stream_decode_level_e decode_level,