diff options
author | Jay Berkenbilt <ejb@ql.org> | 2018-12-17 23:40:29 +0100 |
---|---|---|
committer | Jay Berkenbilt <ejb@ql.org> | 2018-12-22 00:34:56 +0100 |
commit | 30a0c070e41212172f5516936594ec0f6e72ac70 (patch) | |
tree | 86ee45692ce7f54e3298d84f20a86fd482afbbaa /include/qpdf/QPDFObjectHandle.hh | |
parent | 651179b5da0777f861e427f96fd8560bf1516ae5 (diff) | |
download | qpdf-30a0c070e41212172f5516936594ec0f6e72ac70.tar.zst |
Add QPDFObjectHandle::getJSON()
Diffstat (limited to 'include/qpdf/QPDFObjectHandle.hh')
-rw-r--r-- | include/qpdf/QPDFObjectHandle.hh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index 88f071d2..9cc67686 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -733,6 +733,25 @@ class QPDFObjectHandle QPDF_DLL std::string unparseBinary(); + // Return encoded as JSON. For most object types, there is an + // obvious mapping. The JSON is generated as follows: + // * Names are encoded as strings representing the normalized value of + // getName() + // * Indirect references are encoded as strings containing "obj gen R" + // * Strings are encoded as UTF-8 strings with unrepresentable binary + // characters encoded as \uHHHH + // * Encoding streams just encodes the stream's dictionary; the stream + // data is not represented + // * Object types that are only valid in content streams (inline + // image, operator) as well as "reserved" objects are not + // representable and will be serialized as "null". + // If dereference_indirect is true and this is an indirect object, + // show the actual contents of the object. The effect of + // dereference_indirect applies only to this object. It is not + // recursive. + QPDF_DLL + JSON getJSON(bool dereference_indirect = false); + // Legacy helper methods for commonly performed operations on // pages. Newer code should use QPDFPageObjectHelper instead. The // specification and behavior of these methods are the same as the |