From 2a2f7f1bba3dd87bd17f8b819ddeb1a24bb742dd Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sun, 8 May 2022 12:37:18 -0400 Subject: Add maxobjectid to JSON --- libqpdf/QPDFJob.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libqpdf') 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* 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": { "": "json representation of object" } -- cgit v1.2.3-54-g00ecf