diff options
Diffstat (limited to 'libqpdf/QPDFObjectHandle.cc')
-rw-r--r-- | libqpdf/QPDFObjectHandle.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 7af83a68..4fda24f5 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1618,7 +1618,11 @@ QPDFObjectHandle::getJSON(int json_version, bool dereference_indirect) } else if (!dereference()) { throw std::logic_error("attempted to dereference an uninitialized QPDFObjectHandle"); } else { - return obj->getJSON(json_version); + Pl_Buffer p{"json"}; + JSON::Writer jw{&p, 0}; + writeJSON(json_version, jw, dereference_indirect); + p.finish(); + return JSON::parse(p.getString()); } } |