diff options
author | Jay Berkenbilt <ejb@ql.org> | 2022-05-08 18:37:18 +0200 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2022-05-08 19:45:20 +0200 |
commit | 2a2f7f1bba3dd87bd17f8b819ddeb1a24bb742dd (patch) | |
tree | fc8814eb2b983ba6e753d3daee1aefabf7b48968 /libqpdf | |
parent | 02e8ef6fd939e9df9dffc8511f5eb7e11ee6992b (diff) | |
download | qpdf-2a2f7f1bba3dd87bd17f8b819ddeb1a24bb742dd.tar.zst |
Add maxobjectid to JSON
Diffstat (limited to 'libqpdf')
-rw-r--r-- | libqpdf/QPDFJob.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index 621e6933..55bebdcb 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -1188,6 +1188,12 @@ QPDFJob::doJSONQpdf(Pipeline* p, bool& first, QPDF& pdf) p, first_qpdf, "jsonversion", JSON::makeInt(this->m->json_version), 1); JSON::writeDictionaryItem( p, first_qpdf, "pdfversion", JSON::makeString(pdf.getPDFVersion()), 1); + JSON::writeDictionaryItem( + p, + first_qpdf, + "maxobjectid", + JSON::makeInt(QIntC::to_longlong(pdf.getObjectCount())), + 1); JSON::writeDictionaryKey(p, first_qpdf, "objects", 1); bool first_object = true; JSON::writeDictionaryOpen(p, first_object, 2); @@ -1613,6 +1619,7 @@ QPDFJob::json_schema(int json_version, std::set<std::string>* keys) schema.addDictionaryMember("qpdf", JSON::parse(R"({ "jsonversion": "qpdf json output version", "pdfversion": "PDF version from PDF header", + "maxobjectid": "Highest object ID; needed for adding new objects", "objects": { "<obj:n n R|trailer>": "json representation of object" } |