diff options
author | m-holger <m-holger@kubitscheck.org> | 2024-01-29 14:22:58 +0100 |
---|---|---|
committer | m-holger <m-holger@kubitscheck.org> | 2024-01-29 14:22:58 +0100 |
commit | 8ff20b00897acecc6908c98fab72db1c57692abb (patch) | |
tree | 43861ce541d68eee3bb7cc9f7cd85de86a22e386 /libqpdf/QPDF_json.cc | |
parent | 4660e23262fd3606d0b9ef7db9bcc315783b16e3 (diff) | |
download | qpdf-8ff20b00897acecc6908c98fab72db1c57692abb.tar.zst |
Allow "n:/pdf-syntax" JSON syntax for dictionary keys
Diffstat (limited to 'libqpdf/QPDF_json.cc')
-rw-r--r-- | libqpdf/QPDF_json.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libqpdf/QPDF_json.cc b/libqpdf/QPDF_json.cc index 7951b1e4..33211f14 100644 --- a/libqpdf/QPDF_json.cc +++ b/libqpdf/QPDF_json.cc @@ -666,7 +666,9 @@ QPDF::JSONReactor::dictionaryItem(std::string const& key, JSON const& value) if (dict.isStream()) { dict = dict.getDict(); } - dict.replaceKey(key, makeObject(value)); + dict.replaceKey( + is_pdf_name(key) ? QPDFObjectHandle::parse(key.substr(2)).getName() : key, + makeObject(value)); } } else { throw std::logic_error("QPDF_json: unknown state " + std::to_string(state)); |