From c76536dd9a150adb71fdcda11ee1a93f25128cc7 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 7 May 2022 13:33:45 -0400 Subject: Implement JSON v2 output --- TODO | 122 ++++---- include/qpdf/Constants.h | 2 +- include/qpdf/QPDFJob.hh | 15 + include/qpdf/QPDFObjectHandle.hh | 10 +- include/qpdf/auto_job_c_main.hh | 2 + job.sums | 14 +- job.yml | 13 +- libqpdf/QPDFJob.cc | 156 ++++++++++- libqpdf/QPDFJob_config.cc | 23 ++ libqpdf/QPDFObjectHandle.cc | 2 +- libqpdf/QPDF_Stream.cc | 16 +- libqpdf/qpdf/QPDF_Stream.hh | 2 +- libqpdf/qpdf/auto_job_help.hh | 21 +- libqpdf/qpdf/auto_job_init.hh | 5 +- libqpdf/qpdf/auto_job_json_init.hh | 9 +- libqpdf/qpdf/auto_job_schema.hh | 2 + manual/cli.rst | 31 +++ qpdf/qtest/qpdf.test | 9 +- qpdf/qtest/qpdf/direct-pages-json-objects.out | 192 ++++++------- qpdf/qtest/qpdf/direct-pages-json-pages.out | 216 ++++++--------- ...son-V4-aes-encrypt---show-encryption-key-v2.out | 2 +- qpdf/qtest/qpdf/json-V4-aes-encrypt-v2.out | 2 +- .../json-field-types---show-encryption-key-v2.out | 166 +++++------ qpdf/qtest/qpdf/json-field-types-acroform-v2.out | 24 +- qpdf/qtest/qpdf/json-field-types-v2.out | 166 +++++------ qpdf/qtest/qpdf/json-image-streams-all-v2.out | 6 +- qpdf/qtest/qpdf/json-image-streams-small-v2.out | 6 +- .../qpdf/json-image-streams-specialized-v2.out | 6 +- qpdf/qtest/qpdf/json-image-streams-v2.out | 6 +- .../qpdf/json-need-appearances-acroform-v2.out | 24 +- qpdf/qtest/qpdf/json-outlines-with-actions-v2.out | 36 +-- .../qpdf/json-outlines-with-old-root-dests-v2.out | 34 +-- ...-page-labels-and-outlines-outlines-pages-v2.out | 12 +- ...json-page-labels-and-outlines-pagelabels-v2.out | 8 +- .../json-page-labels-and-outlines-pages-v2.out | 12 +- .../qpdf/json-page-labels-and-outlines-qpdf-v2.out | 210 +++++++++----- .../qpdf/json-page-labels-and-outlines-v2.out | 52 ++-- qpdf/qtest/qpdf/json-page-labels-num-tree-v2.out | 44 +-- qpdf/qtest/qpdf/page_api_2-json-objects.out | 260 +++++++---------- qpdf/qtest/qpdf/page_api_2-json-pages.out | 307 +++++++++------------ 40 files changed, 1183 insertions(+), 1062 deletions(-) diff --git a/TODO b/TODO index 35cfbd79..b184d81f 100644 --- a/TODO +++ b/TODO @@ -50,6 +50,8 @@ Output JSON v2 General things to remember: +* Test inline and file stream data. + * Make sure all the information from --check and other informational options (--show-linearization, --show-encryption, --show-xref, --list-attachments, --show-npages) is available in the json output. @@ -58,9 +60,6 @@ General things to remember: when present in the schema. It's reasonable for people to check for presence of a key. Most languages make this easy to do. -* The choices for json_key (job.yml) will be different for v1 and v2. - That information is already duplicated in multiple places. - * Test stream with invalid data * When we get to full serialization, add json serialization @@ -76,20 +75,61 @@ General things to remember: * "b:cf80", "b:CF80", "u:π", "u:\u03c0" * "b:d83edd54", "u:🥔", "u:\ud83e\udd54" +JSON to PDF: + When reading a JSON string, any string that doesn't follow the above rules is an error. Just use newUnicodeString on "u:" strings. For "b:" strings, decode the bytes with hex_decode and use newString. +For going back from JSON to PDF, we can have +QPDF::fromJSON(std::shared_ptr which will have logic +similar to copyForeignObject. Note that this InputSource is not going +to be this->file. We have to keep it separately. + +The backing input source is this memory block: + +``` +%PDF-1.3 +xref +0 1 +0000000000 65535 f +trailer << /Size 1 >> +startxref +9 +%%EOF +``` + +* Ignore all keys except .qpdf. +* Verify that .qpdf.jsonVersion is 2 +* Set this->m->pdf_version based on the .qpdf.pdfVersion key +* For each object in .qpdf.objects: + * Walk through the object detecting any indirect objects. For each + one that is not already known, reserve the object. We can also + validate but we should try to do the best we can with invalid JSON + so people can get good error messages. + * Construct a QPDFObjectHandle from the JSON + * If the object is the trailer, update the trailer + * Else if the object doesn't exist, reserve it + * If the object is reserved, call replaceReserved() + * Else the object already exists; this is an error. + +For streams, have a stream data provider that, for inline streams, +does a base64 from the file offsets and for file-based streams, reads +the file. For the inline case, we have to keep the json InputSource +around. Otherwise, we don't. It is an error if there is no stream data. + +Documentation: + Serialized PDF: The JSON output will have a "qpdf" key containing -* jsonVersion -* pdfVersion +* jsonversion +* pdfversion * objects The "qpdf" key replaces "objects" and "objectinfo" in v1 JSON. -Within .qpdf.objects, the key is "obj:o g R" or "obj:trailer", and the +Within .qpdf.objects, the key is "obj:o g R" or "trailer", and the value is a dictionary with exactly one of "value" or "stream" as its single key. @@ -113,16 +153,17 @@ For streams: "stream": { "dict": { ... stream dictionary ... }, "data": "base64-encoded data", - "dataFile": "path to base64-encoded data" + "datafile": "path to base64-encoded data" } } } -At most one of "data" or "dataFile" will be present. When serializing, +At most one of "data" or "datafile" will be present. When serializing, stream decode parameters will be obeyed, and the stream dictionary will reflect the result. There will be the option to omit stream data. -In the stream dictionary, "/Length" is always removed. +When data is included, "/Length" is removed from the stream +dictionary. Streams are filtered or not based on the --decode-level parameter. If a stream is filtered, "/Filter" and "/DecodeParms" are removed from @@ -131,74 +172,11 @@ for when the file is read back in. CLI: -* Add new flags - - * --from-json=input.json -- signals reading from a JSON and counts - as an input file. - - * --json-streams-omit -- stream data is omitted, the default - - * --json-streams-inline -- stream data is included in the "data" - key as base64-encoded - - * --json-streams-file-prefix=prefix -- stream is written to $prefix-$obj - where $obj is the object number. The path to the file is stored - in the "dataFile" key. A relative path is recommended and will be - interpreted as relative to the current directory. If a relative - prefix is given, a relative path will stored in "dataFile". - Example: - mkdir in-streams - qpdf in.pdf --json-streams-file-prefix=in-streams/ > out.json - - * --to-json -- changes default to --json-streams-inline implies - --json-key=qpdf - Example workflow: * qpdf in.pdf --to-json > pdf.json * edit pdf.json * qpdf --from-json=pdf.json out.pdf -JSON to PDF: - -For going back from JSON to PDF, we can have -QPDF::fromJSON(std::shared_ptr which will have logic -similar to copyForeignObject. Note that this InputSource is not going -to be this->file. We have to keep it separately. - -The backing input source is this memory block: - -``` -%PDF-1.3 -xref -0 1 -0000000000 65535 f -trailer << /Size 1 >> -startxref -9 -%%EOF -``` - -* Ignore all keys except .qpdf. -* Verify that .qpdf.jsonVersion is 2 -* Set this->m->pdf_version based on the .qpdf.pdfVersion key -* For each object in .qpdf.objects: - * Walk through the object detecting any indirect objects. For each - one that is not already known, reserve the object. We can also - validate but we should try to do the best we can with invalid JSON - so people can get good error messages. - * Construct a QPDFObjectHandle from the JSON - * If the object is the trailer, update the trailer - * Else if the object doesn't exist, reserve it - * If the object is reserved, call replaceReserved() - * Else the object already exists; this is an error. - -For streams, have a stream data provider that, for inline streams, -does a base64 from the file offsets and for file-based streams, reads -the file. For the inline case, we have to keep the json InputSource -around. Otherwise, we don't. It is an error if there is no stream data. - -Documentation: - Update --json option in cli.rst to mention v2 and update json.rst. Other documentation fodder: diff --git a/include/qpdf/Constants.h b/include/qpdf/Constants.h index babf215c..d1fd969b 100644 --- a/include/qpdf/Constants.h +++ b/include/qpdf/Constants.h @@ -100,7 +100,7 @@ enum qpdf_stream_decode_level_e { qpdf_dl_all /* also decode lossy filters */ }; /* For JSON encoding */ -enum qpdf_stream_data_json_e { +enum qpdf_json_stream_data_e { qpdf_sj_none = 0, qpdf_sj_inline, qpdf_sj_file, diff --git a/include/qpdf/QPDFJob.hh b/include/qpdf/QPDFJob.hh index f85c1ec7..da8d3fcb 100644 --- a/include/qpdf/QPDFJob.hh +++ b/include/qpdf/QPDFJob.hh @@ -515,12 +515,25 @@ class QPDFJob std::set getWantedJSONObjects(); void doJSONObjects(Pipeline* p, bool& first, QPDF& pdf); void doJSONObjectinfo(Pipeline* p, bool& first, QPDF& pdf); + void doJSONQpdf(Pipeline* p, bool& first, QPDF& pdf); void doJSONPages(Pipeline* p, bool& first, QPDF& pdf); void doJSONPageLabels(Pipeline* p, bool& first, QPDF& pdf); void doJSONOutlines(Pipeline* p, bool& first, QPDF& pdf); void doJSONAcroform(Pipeline* p, bool& first, QPDF& pdf); void doJSONEncrypt(Pipeline* p, bool& first, QPDF& pdf); void doJSONAttachments(Pipeline* p, bool& first, QPDF& pdf); + void doJSONStream( + Pipeline* p, + bool& first, + QPDF& pdf, + QPDFObjectHandle& obj, + std::string const& file_prefix); + void doJSONObject( + Pipeline* p, + bool& first, + QPDF& pdf, + std::string const& key, + QPDFObjectHandle& obj); void addOutlinesToJson( std::vector outlines, JSON& j, @@ -638,6 +651,8 @@ class QPDFJob int json_version; std::set json_keys; std::set json_objects; + qpdf_json_stream_data_e json_stream_data; + std::string json_stream_prefix; bool test_json_schema; bool check; bool optimize_images; diff --git a/include/qpdf/QPDFObjectHandle.hh b/include/qpdf/QPDFObjectHandle.hh index eb16ad39..70c7cf54 100644 --- a/include/qpdf/QPDFObjectHandle.hh +++ b/include/qpdf/QPDFObjectHandle.hh @@ -1377,12 +1377,16 @@ class QPDFObjectHandle // data_filename argument must be supplied. The value of // data_filename is stored in the resulting json in the "datafile" // key but is not otherwise use. The stream data itself (raw or - // filtered depending on decode level), is written to the - // pipeline via pipeStreamData(). + // filtered depending on decode level), is written to the pipeline + // via pipeStreamData(). + // + // NOTE: When json_data is qpdf_sj_inline, the QPDF object from + // which the stream originates must remain valid until after the + // JSON object is written. QPDF_DLL JSON getStreamJSON( int json_version, - qpdf_stream_data_json_e json_data, + qpdf_json_stream_data_e json_data, qpdf_stream_decode_level_e decode_level, Pipeline* p, std::string const& data_filename); diff --git a/include/qpdf/auto_job_c_main.hh b/include/qpdf/auto_job_c_main.hh index af400e04..54efa1df 100644 --- a/include/qpdf/auto_job_c_main.hh +++ b/include/qpdf/auto_job_c_main.hh @@ -66,6 +66,7 @@ QPDF_DLL Config* removeAttachment(std::string const& parameter); QPDF_DLL Config* rotate(std::string const& parameter); QPDF_DLL Config* showAttachment(std::string const& parameter); QPDF_DLL Config* showObject(std::string const& parameter); +QPDF_DLL Config* jsonStreamPrefix(std::string const& parameter); QPDF_DLL Config* collate(std::string const& parameter); QPDF_DLL Config* collate(); QPDF_DLL Config* splitPages(std::string const& parameter); @@ -80,5 +81,6 @@ QPDF_DLL Config* objectStreams(std::string const& parameter); QPDF_DLL Config* passwordMode(std::string const& parameter); QPDF_DLL Config* removeUnreferencedResources(std::string const& parameter); QPDF_DLL Config* streamData(std::string const& parameter); +QPDF_DLL Config* jsonStreamData(std::string const& parameter); QPDF_DLL Config* json(std::string const& parameter); QPDF_DLL Config* json(); diff --git a/job.sums b/job.sums index eb2c54a3..a7364df6 100644 --- a/job.sums +++ b/job.sums @@ -3,15 +3,15 @@ generate_auto_job 0514289f2deb3bf7c1a6e85ef7d99ad120321ef5a6fe49d76c5274c6a658d3 include/qpdf/auto_job_c_att.hh 4c2b171ea00531db54720bf49a43f8b34481586ae7fb6cbf225099ee42bc5bb4 include/qpdf/auto_job_c_copy_att.hh 50609012bff14fd82f0649185940d617d05d530cdc522185c7f3920a561ccb42 include/qpdf/auto_job_c_enc.hh 28446f3c32153a52afa239ea40503e6cc8ac2c026813526a349e0cd4ae17ddd5 -include/qpdf/auto_job_c_main.hh 940aa6f1ead18ed08ba33f11254e9f042348262c85b91de742f0427094412a80 +include/qpdf/auto_job_c_main.hh 688959c4725a71e1340cccfb2cf780ec62ada5aa42a9c3c7c8a5cd8e85a4a17d include/qpdf/auto_job_c_pages.hh b3cc0f21029f6d89efa043dcdbfa183cb59325b6506001c18911614fe8e568ec include/qpdf/auto_job_c_uo.hh ae21b69a1efa9333050f4833d465f6daff87e5b38e5106e49bbef5d4132e4ed1 -job.yml e3d9752ea8810872447190b0b2b913f591ae03dfdd876945adf1bbb76942cd0f +job.yml e73b8190f3e314bcdc98edf3d61d72283e5d0ff603b3d8ae98c77bb36b80028f libqpdf/qpdf/auto_job_decl.hh 74df4d7fdbdf51ecd0d58ce1e9844bb5525b9adac5a45f7c9a787ecdda2868df -libqpdf/qpdf/auto_job_help.hh a3d1a326a3f8ff61a7d451176acde3bb6c8ad66c1ea7a0b8c5d789917ad3a9ee -libqpdf/qpdf/auto_job_init.hh 1dcefadac02bb4b3a5d112912483902ad46489b1cacefefd3ebe4f64fc1b8a29 +libqpdf/qpdf/auto_job_help.hh feac25cd7e45fd587ca3c9b8807a1aed2e5510b592e76ae5bac775b0e03ac0b2 +libqpdf/qpdf/auto_job_init.hh 7d98e1d4b213537b6d401a103a9d52c77aaea3e1164f06c3664625f6ebfa7e7d libqpdf/qpdf/auto_job_json_decl.hh 06caa46eaf71db8a50c046f91866baa8087745a9474319fb7c86d92634cc8297 -libqpdf/qpdf/auto_job_json_init.hh 784ff973e7efbf589f6a9b3ad22b3aada5c5393e9c5cd31845b8fe4af6e03f98 -libqpdf/qpdf/auto_job_schema.hh cbbcae166cfecbdbdeb40c5a30870e03604a019a8b4f7a217d554a82431d2e5f +libqpdf/qpdf/auto_job_json_init.hh 1c1dcefd9577638f04fa1b76c82ddb1d20d93017bb72782da2aca8a51d974770 +libqpdf/qpdf/auto_job_schema.hh 748b2e11754c5186b31098ab1b7963306fe0d5fd91445df914c105c8fac49c18 manual/_ext/qpdf.py 6add6321666031d55ed4aedf7c00e5662bba856dfcd66ccb526563bffefbb580 -manual/cli.rst 8684ca1f601f2832cded52d1b2f74730f97b7b85b57e31a399231731fbe80d26 +manual/cli.rst 3901f7e099c2ebf29e81db7d93f3f19a92aff9e72ec6dfb0984a170cfcdd300f diff --git a/job.yml b/job.yml index c449520e..69d6370e 100644 --- a/job.yml +++ b/job.yml @@ -47,11 +47,16 @@ choices: - acroform - attachments - encrypt - - objectinfo - - objects + - objectinfo # only v1 + - objects # only v1 - outlines - pagelabels - pages + - qpdf # only v2 + json_stream_data: + - none + - inline + - file print128: - full - low @@ -156,6 +161,7 @@ options: rotate: "[+|-]angle" show-attachment: attachment show-object: trailer + json-stream-prefix: stream-file-prefix required_choices: compress-streams: yn decode-level: decode_level @@ -167,6 +173,7 @@ options: password-mode: password_mode remove-unreferenced-resources: remove_unref stream-data: stream_data + json-stream-data: json_stream_data optional_choices: json: json_version - table: pages @@ -348,6 +355,8 @@ json: - null json-object: - null + json-stream-data: + json-stream-prefix: # other options allow-weak-crypto: keep-files-open: diff --git a/libqpdf/QPDFJob.cc b/libqpdf/QPDFJob.cc index 521377f8..621e6933 100644 --- a/libqpdf/QPDFJob.cc +++ b/libqpdf/QPDFJob.cc @@ -401,6 +401,7 @@ QPDFJob::Members::Members() : flatten_rotation(false), list_attachments(false), json_version(0), + json_stream_data(qpdf_sj_none), test_json_schema(false), check(false), optimize_images(false), @@ -695,6 +696,17 @@ QPDFJob::checkConfiguration() " use --replace-input to intentionally" " overwrite the input file"); } + + if (m->json_version == 1) { + if (m->json_keys.count("qpdf")) { + usage("json key \"qpdf\" is not valid for json version 1"); + } + } else { + if (m->json_keys.count("objects") || m->json_keys.count("objectinfo")) { + usage("json keys \"objects\" and \"objectinfo\" are only valid for " + "json version 1"); + } + } } unsigned long @@ -1103,6 +1115,102 @@ QPDFJob::doJSONObjectinfo(Pipeline* p, bool& first, QPDF& pdf) JSON::writeDictionaryClose(p, first_object, 1); } +void +QPDFJob::doJSONStream( + Pipeline* p, + bool& first, + QPDF& pdf, + QPDFObjectHandle& obj, + std::string const& file_prefix) +{ + Pipeline* stream_p = nullptr; + FILE* f = nullptr; + std::shared_ptr f_pl; + std::string filename; + if (this->m->json_stream_data == qpdf_sj_file) { + filename = file_prefix + "-" + QUtil::int_to_string(obj.getObjectID()); + f = QUtil::safe_fopen(filename.c_str(), "wb"); + f_pl = std::make_shared("stream data", f); + stream_p = f_pl.get(); + } + auto j = JSON::makeDictionary(); + j.addDictionaryMember( + "stream", + obj.getStreamJSON( + this->m->json_version, + this->m->json_stream_data, + this->m->decode_level, + stream_p, + filename)); + + JSON::writeDictionaryItem(p, first, "obj:" + obj.unparse(), j, 2); + if (f) { + f_pl->finish(); + f_pl = nullptr; + fclose(f); + } +} + +void +QPDFJob::doJSONObject( + Pipeline* p, + bool& first, + QPDF& pdf, + std::string const& key, + QPDFObjectHandle& obj) +{ + auto j = JSON::makeDictionary(); + j.addDictionaryMember("value", obj.getJSON(this->m->json_version, true)); + JSON::writeDictionaryItem(p, first, key, j, 2); +} + +void +QPDFJob::doJSONQpdf(Pipeline* p, bool& first, QPDF& pdf) +{ + std::string file_prefix = this->m->json_stream_prefix; + if (this->m->json_stream_data == qpdf_sj_file) { + if (file_prefix.empty()) { + if (this->m->infilename.get()) { + file_prefix = this->m->infilename.get(); + } + if (file_prefix.empty()) { + usage( + "please specify --json-stream-prefix since the input file " + "name is unknown"); + } + } + } + + JSON::writeDictionaryKey(p, first, "qpdf", 0); + bool first_qpdf = true; + JSON::writeDictionaryOpen(p, first_qpdf, 1); + JSON::writeDictionaryItem( + p, first_qpdf, "jsonversion", JSON::makeInt(this->m->json_version), 1); + JSON::writeDictionaryItem( + p, first_qpdf, "pdfversion", JSON::makeString(pdf.getPDFVersion()), 1); + JSON::writeDictionaryKey(p, first_qpdf, "objects", 1); + bool first_object = true; + JSON::writeDictionaryOpen(p, first_object, 2); + bool all_objects = m->json_objects.empty(); + std::set wanted_og = getWantedJSONObjects(); + std::vector objects = pdf.getAllObjects(); + for (auto& obj: objects) { + if (all_objects || wanted_og.count(obj.getObjGen())) { + if (obj.isStream()) { + doJSONStream(p, first_object, pdf, obj, file_prefix); + } else { + doJSONObject(p, first_object, pdf, "obj:" + obj.unparse(), obj); + } + } + } + if (all_objects || m->json_objects.count("trailer")) { + auto trailer = pdf.getTrailer(); + doJSONObject(p, first_object, pdf, "trailer", trailer); + } + JSON::writeDictionaryClose(p, first_object, 2); + JSON::writeDictionaryClose(p, first_qpdf, 1); +} + void QPDFJob::doJSONPages(Pipeline* p, bool& first, QPDF& pdf) { @@ -1482,14 +1590,15 @@ QPDFJob::json_schema(int json_version, std::set* keys) // The list of selectable top-level keys id duplicated in the // following places: job.yml, QPDFJob::json_schema, and // QPDFJob::doJSON. - if (all_keys || keys->count("objects")) { - schema.addDictionaryMember("objects", JSON::parse(R"({ + if (json_version == 1) { + if (all_keys || keys->count("objects")) { + schema.addDictionaryMember("objects", JSON::parse(R"({ "": "json representation of object" })")); - } - if (all_keys || keys->count("objectinfo")) { - JSON objectinfo = - schema.addDictionaryMember("objectinfo", JSON::parse(R"({ + } + if (all_keys || keys->count("objectinfo")) { + JSON objectinfo = + schema.addDictionaryMember("objectinfo", JSON::parse(R"({ "": { "stream": { "filter": "if stream, its filters, otherwise null", @@ -1498,6 +1607,17 @@ QPDFJob::json_schema(int json_version, std::set* keys) } } })")); + } + } else { + if (all_keys || keys->count("qpdf")) { + schema.addDictionaryMember("qpdf", JSON::parse(R"({ + "jsonversion": "qpdf json output version", + "pdfversion": "PDF version from PDF header", + "objects": { + "": "json representation of object" + } +})")); + } } if (all_keys || keys->count("pages")) { JSON page = schema.addDictionaryMember("pages", JSON::parse(R"([ @@ -1705,15 +1825,21 @@ QPDFJob::doJSON(QPDF& pdf, Pipeline* p) doJSONOutlines(p, first, pdf); } - // We do objects and objectinfo last so their information is - // consistent with repairing the page tree. To see the original - // file with any page tree problems and the page tree not - // flattened, select objects/objectinfo without other keys. - if (all_keys || m->json_keys.count("objects")) { - doJSONObjects(p, first, pdf); - } - if (all_keys || m->json_keys.count("objectinfo")) { - doJSONObjectinfo(p, first, pdf); + // We do objects last so their information is consistent with + // repairing the page tree. To see the original file with any page + // tree problems and the page tree not flattened, select + // objects/objectinfo without other keys. + if (this->m->json_version == 1) { + if (all_keys || m->json_keys.count("objects")) { + doJSONObjects(p, first, pdf); + } + if (all_keys || m->json_keys.count("objectinfo")) { + doJSONObjectinfo(p, first, pdf); + } + } else { + if (all_keys || m->json_keys.count("qpdf")) { + doJSONQpdf(p, first, pdf); + } } JSON::writeDictionaryClose(p, first, 0); diff --git a/libqpdf/QPDFJob_config.cc b/libqpdf/QPDFJob_config.cc index 3f8f0840..d990de37 100644 --- a/libqpdf/QPDFJob_config.cc +++ b/libqpdf/QPDFJob_config.cc @@ -260,6 +260,29 @@ QPDFJob::Config::jsonObject(std::string const& parameter) return this; } +QPDFJob::Config* +QPDFJob::Config::jsonStreamData(std::string const& parameter) +{ + if (parameter == "none") { + o.m->json_stream_data = qpdf_sj_none; + } else if (parameter == "inline") { + o.m->json_stream_data = qpdf_sj_inline; + } else if (parameter == "file") { + o.m->json_stream_data = qpdf_sj_file; + } else { + usage("invalid json-streams option"); + } + + return this; +} + +QPDFJob::Config* +QPDFJob::Config::jsonStreamPrefix(std::string const& parameter) +{ + o.m->json_stream_prefix = parameter; + return this; +} + QPDFJob::Config* QPDFJob::Config::testJsonSchema() { diff --git a/libqpdf/QPDFObjectHandle.cc b/libqpdf/QPDFObjectHandle.cc index 1d6a9ccf..10fb153c 100644 --- a/libqpdf/QPDFObjectHandle.cc +++ b/libqpdf/QPDFObjectHandle.cc @@ -1800,7 +1800,7 @@ QPDFObjectHandle::getJSON(int json_version, bool dereference_indirect) JSON QPDFObjectHandle::getStreamJSON( int json_version, - qpdf_stream_data_json_e json_data, + qpdf_json_stream_data_e json_data, qpdf_stream_decode_level_e decode_level, Pipeline* p, std::string const& data_filename) diff --git a/libqpdf/QPDF_Stream.cc b/libqpdf/QPDF_Stream.cc index 67a3ad0d..ff62df73 100644 --- a/libqpdf/QPDF_Stream.cc +++ b/libqpdf/QPDF_Stream.cc @@ -189,7 +189,7 @@ QPDF_Stream::getJSON(int json_version) JSON QPDF_Stream::getStreamJSON( int json_version, - qpdf_stream_data_json_e json_data, + qpdf_json_stream_data_e json_data, qpdf_stream_decode_level_e decode_level, Pipeline* p, std::string const& data_filename) @@ -231,11 +231,17 @@ QPDF_Stream::getStreamJSON( } else { data_pipeline = &discard; } - filtered = pipeStreamData( - data_pipeline, nullptr, 0, decode_level, false, (attempt == 1)); - if (filter && (!filtered)) { + bool succeeded = pipeStreamData( + data_pipeline, + &filtered, + 0, + decode_level, + false, + (attempt == 1)); + if ((!succeeded) || (filter && (!filtered))) { // Try again filter = false; + decode_level = qpdf_dl_none; } else { if (buf_pl.get()) { buf = buf_pl->getBufferSharedPointer(); @@ -247,7 +253,7 @@ QPDF_Stream::getStreamJSON( // touching top-level keys. dict = this->stream_dict.unsafeShallowCopy(); dict.removeKey("/Length"); - if (filtered) { + if (filter && filtered) { dict.removeKey("/Filter"); dict.removeKey("/DecodeParms"); } diff --git a/libqpdf/qpdf/QPDF_Stream.hh b/libqpdf/qpdf/QPDF_Stream.hh index fcf98ffa..51b215e2 100644 --- a/libqpdf/qpdf/QPDF_Stream.hh +++ b/libqpdf/qpdf/QPDF_Stream.hh @@ -63,7 +63,7 @@ class QPDF_Stream: public QPDFObject addTokenFilter(std::shared_ptr token_filter); JSON getStreamJSON( int json_version, - qpdf_stream_data_json_e json_data, + qpdf_json_stream_data_e json_data, qpdf_stream_decode_level_e decode_level, Pipeline* p, std::string const& data_filename); diff --git a/libqpdf/qpdf/auto_job_help.hh b/libqpdf/qpdf/auto_job_help.hh index 55d2cc63..47210371 100644 --- a/libqpdf/qpdf/auto_job_help.hh +++ b/libqpdf/qpdf/auto_job_help.hh @@ -817,6 +817,21 @@ objects will be shown. ap.addOptionHelp("--job-json-help", "json", "show format of job JSON", R"(Describe the format of the QPDFJob JSON input used by --job-json-file. )"); +ap.addOptionHelp("--json-stream-data", "json", "how to handle streams in json output", R"(--json-stream-data={none|inline|file} + +Control whether streams in json output should be omitted, +written inline (base64-encoded) or written to a file. If "file" +is chosen, the file will be the name of the input file appended +with -nnn where nnn is the object number. The prefix can be +overridden with --json-stream-prefix. +)"); +ap.addOptionHelp("--json-stream-prefix", "json", "prefix for json stream data files", R"(--json-stream-prefix=file-prefix + +When --json-stream-data=file is given, override the input file +name as the prefix for stream data files. Whatever is given here +will be appended with -nnn to create the name of the file that +will contain the data for the stream stream in object nnn. +)"); ap.addHelpTopic("testing", "options for testing or debugging", R"(The options below are useful when writing automated test code that includes files created by qpdf or when testing qpdf itself. )"); @@ -829,6 +844,9 @@ for testing only so that output files can be reproducible. Never use it for production files. This option is not secure since it significantly weakens the encryption. )"); +} +static void add_help_8(QPDFArgParser& ap) +{ ap.addOptionHelp("--linearize-pass1", "testing", "save pass 1 of linearization", R"(--linearize-pass1=file Write the first pass of linearization to the named file. The @@ -839,9 +857,6 @@ ap.addOptionHelp("--test-json-schema", "testing", "test generated json against s the output of qpdf --json and the output of qpdf --json-help. )"); } -static void add_help_8(QPDFArgParser& ap) -{ -} static void add_help(QPDFArgParser& ap) { add_help_1(ap); diff --git a/libqpdf/qpdf/auto_job_init.hh b/libqpdf/qpdf/auto_job_init.hh index b3191d4d..5c13275c 100644 --- a/libqpdf/qpdf/auto_job_init.hh +++ b/libqpdf/qpdf/auto_job_init.hh @@ -20,7 +20,8 @@ static char const* object_streams_choices[] = {"disable", "preserve", "generate" static char const* remove_unref_choices[] = {"auto", "yes", "no", 0}; static char const* flatten_choices[] = {"all", "print", "screen", 0}; static char const* json_version_choices[] = {"1", "2", "latest", 0}; -static char const* json_key_choices[] = {"acroform", "attachments", "encrypt", "objectinfo", "objects", "outlines", "pagelabels", "pages", 0}; +static char const* json_key_choices[] = {"acroform", "attachments", "encrypt", "objectinfo", "objects", "outlines", "pagelabels", "pages", "qpdf", 0}; +static char const* json_stream_data_choices[] = {"none", "inline", "file", 0}; static char const* print128_choices[] = {"full", "low", "none", 0}; static char const* modify128_choices[] = {"all", "annotate", "form", "assembly", "none", 0}; @@ -101,6 +102,7 @@ this->ap.addRequiredParameter("remove-attachment", [this](std::string const& x){ this->ap.addRequiredParameter("rotate", [this](std::string const& x){c_main->rotate(x);}, "[+|-]angle"); this->ap.addRequiredParameter("show-attachment", [this](std::string const& x){c_main->showAttachment(x);}, "attachment"); this->ap.addRequiredParameter("show-object", [this](std::string const& x){c_main->showObject(x);}, "trailer"); +this->ap.addRequiredParameter("json-stream-prefix", [this](std::string const& x){c_main->jsonStreamPrefix(x);}, "stream-file-prefix"); this->ap.addOptionalParameter("collate", [this](std::string const& x){c_main->collate(x);}); this->ap.addOptionalParameter("split-pages", [this](std::string const& x){c_main->splitPages(x);}); this->ap.addChoices("compress-streams", [this](std::string const& x){c_main->compressStreams(x);}, true, yn_choices); @@ -113,6 +115,7 @@ this->ap.addChoices("object-streams", [this](std::string const& x){c_main->objec this->ap.addChoices("password-mode", [this](std::string const& x){c_main->passwordMode(x);}, true, password_mode_choices); this->ap.addChoices("remove-unreferenced-resources", [this](std::string const& x){c_main->removeUnreferencedResources(x);}, true, remove_unref_choices); this->ap.addChoices("stream-data", [this](std::string const& x){c_main->streamData(x);}, true, stream_data_choices); +this->ap.addChoices("json-stream-data", [this](std::string const& x){c_main->jsonStreamData(x);}, true, json_stream_data_choices); this->ap.addChoices("json", [this](std::string const& x){c_main->json(x);}, false, json_version_choices); this->ap.registerOptionTable("pages", b(&ArgParser::argEndPages)); this->ap.addPositional(p(&ArgParser::argPagesPositional)); diff --git a/libqpdf/qpdf/auto_job_json_init.hh b/libqpdf/qpdf/auto_job_json_init.hh index 92c4d65c..c73eb3a7 100644 --- a/libqpdf/qpdf/auto_job_json_init.hh +++ b/libqpdf/qpdf/auto_job_json_init.hh @@ -13,7 +13,8 @@ static char const* object_streams_choices[] = {"disable", "preserve", "generate" static char const* remove_unref_choices[] = {"auto", "yes", "no", 0}; static char const* flatten_choices[] = {"all", "print", "screen", 0}; static char const* json_version_choices[] = {"1", "2", "latest", 0}; -static char const* json_key_choices[] = {"acroform", "attachments", "encrypt", "objectinfo", "objects", "outlines", "pagelabels", "pages", 0}; +static char const* json_key_choices[] = {"acroform", "attachments", "encrypt", "objectinfo", "objects", "outlines", "pagelabels", "pages", "qpdf", 0}; +static char const* json_stream_data_choices[] = {"none", "inline", "file", 0}; static char const* print128_choices[] = {"full", "low", "none", 0}; static char const* modify128_choices[] = {"all", "annotate", "form", "assembly", "none", 0}; @@ -252,6 +253,12 @@ beginArray(bindJSON(&Handlers::beginJsonObjectArray), bindBare(&Handlers::endJso addParameter([this](std::string const& p) { c_main->jsonObject(p); }); popHandler(); // array: .jsonObject[] popHandler(); // key: jsonObject +pushKey("jsonStreamData"); +addChoices(json_stream_data_choices, true, [this](std::string const& p) { c_main->jsonStreamData(p); }); +popHandler(); // key: jsonStreamData +pushKey("jsonStreamPrefix"); +addParameter([this](std::string const& p) { c_main->jsonStreamPrefix(p); }); +popHandler(); // key: jsonStreamPrefix pushKey("allowWeakCrypto"); addBare([this]() { c_main->allowWeakCrypto(); }); popHandler(); // key: allowWeakCrypto diff --git a/libqpdf/qpdf/auto_job_schema.hh b/libqpdf/qpdf/auto_job_schema.hh index 267dad23..c2310961 100644 --- a/libqpdf/qpdf/auto_job_schema.hh +++ b/libqpdf/qpdf/auto_job_schema.hh @@ -84,6 +84,8 @@ static constexpr char const* JOB_SCHEMA_DATA = R"({ "jsonObject": [ "limit which objects are in JSON" ], + "jsonStreamData": "how to handle streams in json output", + "jsonStreamPrefix": "prefix for json stream data files", "allowWeakCrypto": "allow insecure cryptographic algorithms", "keepFilesOpen": "manage keeping multiple files open", "keepFilesOpenThreshold": "set threshold for keepFilesOpen", diff --git a/manual/cli.rst b/manual/cli.rst index 97ee85d7..a0c6ba3b 100644 --- a/manual/cli.rst +++ b/manual/cli.rst @@ -3225,6 +3225,37 @@ Related Options :qpdf:ref:`--job-json-file`. For more information about QPDFJob, see :ref:`qpdf-job`. +.. qpdf:option:: --json-stream-data={none|inline|file} + + .. help: how to handle streams in json output + + Control whether streams in json output should be omitted, + written inline (base64-encoded) or written to a file. If "file" + is chosen, the file will be the name of the input file appended + with -nnn where nnn is the object number. The prefix can be + overridden with --json-stream-prefix. + + Control whether streams in json output should be omitted, written + inline (base64-encoded) or written to a file. If ``file`` is + chosen, the file will be the name of the input file appended with + :samp:`-{nnn}` where :samp:`{nnn}` is the object number. The prefix + can be overridden with :qpdf:ref:`--json-stream-prefix`. + +.. qpdf:option:: --json-stream-prefix=file-prefix + + .. help: prefix for json stream data files + + When --json-stream-data=file is given, override the input file + name as the prefix for stream data files. Whatever is given here + will be appended with -nnn to create the name of the file that + will contain the data for the stream stream in object nnn. + + When :qpdf:ref:`--json-stream-data` is given with the value + ``file``, override the input file name as the prefix for stream + data files. Whatever is given here will be appended with + :samp:`-{nnn}` to create the name of the file that will contain the + data for the stream stream in object :samp:`{nnn}`. + .. _test-options: Options for Testing or Debugging diff --git a/qpdf/qtest/qpdf.test b/qpdf/qtest/qpdf.test index 734485e3..23dce379 100644 --- a/qpdf/qtest/qpdf.test +++ b/qpdf/qtest/qpdf.test @@ -1139,9 +1139,9 @@ foreach my $d (@json_files) $td->NORMALIZE_NEWLINES); $td->runtest("json v2 $out", {$td->COMMAND => - ['qpdf', '--json=2', '--test-json-schema', @v1_xargs, $in]}, + ['qpdf', '--json=2', '--test-json-schema', @$xargs, $in]}, {$td->FILE => "$out-v2.out", $td->EXIT_STATUS => 0}, - $td->NORMALIZE_NEWLINES | $td->EXPECT_FAILURE); + $td->NORMALIZE_NEWLINES); } show_ntests(); @@ -2886,14 +2886,13 @@ foreach my $f (qw(page_api_2 direct-pages)) $td->runtest("json for $f (objects only)", {$td->COMMAND => "qpdf --json=latest $f.pdf" . - " --json-key=objects --json-key=objectinfo"}, + " --json-key=qpdf"}, {$td->FILE => "$f-json-objects.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); $td->runtest("json for $f (with pages)", {$td->COMMAND => "qpdf --json=latest $f.pdf" . - " --json-key=objects --json-key=objectinfo" . - " --json-key=pages"}, + " --json-key=qpdf --json-key=pages"}, {$td->FILE => "$f-json-pages.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); } diff --git a/qpdf/qtest/qpdf/direct-pages-json-objects.out b/qpdf/qtest/qpdf/direct-pages-json-objects.out index a7cf4e96..773a0a4c 100644 --- a/qpdf/qtest/qpdf/direct-pages-json-objects.out +++ b/qpdf/qtest/qpdf/direct-pages-json-objects.out @@ -3,118 +3,92 @@ "parameters": { "decodelevel": "generalized" }, - "objects": { - "1 0 R": { - "/Pages": "2 0 R", - "/Type": "/Catalog" - }, - "2 0 R": { - "/Count": 2, - "/Kids": [ - { - "/Contents": "3 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "2 0 R", - "/Resources": { - "/Font": { - "/F1": "5 0 R" + "qpdf": { + "jsonversion": 2, + "pdfversion": "1.3", + "objects": { + "obj:1 0 R": { + "value": { + "/Pages": "2 0 R", + "/Type": "/Catalog" + } + }, + "obj:2 0 R": { + "value": { + "/Count": 2, + "/Kids": [ + { + "/Contents": "3 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "2 0 R", + "/Resources": { + "/Font": { + "/F1": "5 0 R" + }, + "/ProcSet": "6 0 R" + }, + "/Type": "/Page" }, - "/ProcSet": "6 0 R" - }, - "/Type": "/Page" - }, - { - "/Contents": "3 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 + { + "/Contents": "3 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "2 0 R", + "/Resources": { + "/Font": { + "/F1": "5 0 R" + }, + "/ProcSet": "6 0 R" + }, + "/Type": "/Page" + } ], - "/Parent": "2 0 R", - "/Resources": { - "/Font": { - "/F1": "5 0 R" - }, - "/ProcSet": "6 0 R" - }, - "/Type": "/Page" + "/Type": "/Pages" + } + }, + "obj:3 0 R": { + "stream": { + "dict": { + "/Length": "4 0 R" + } + } + }, + "obj:4 0 R": { + "value": 44 + }, + "obj:5 0 R": { + "value": { + "/BaseFont": "/Helvetica", + "/Encoding": "/WinAnsiEncoding", + "/Name": "/F1", + "/Subtype": "/Type1", + "/Type": "/Font" + } + }, + "obj:6 0 R": { + "value": [ + "/PDF", + "/Text" + ] + }, + "trailer": { + "value": { + "/ID": [ + "b:1323a5937c577a66735583a93698ce3c", + "b:372cbf44f6db88ab60d9263c0f0bd26a" + ], + "/Root": "1 0 R", + "/Size": 7 } - ], - "/Type": "/Pages" - }, - "3 0 R": { - "dict": { - "/Length": "4 0 R" - } - }, - "4 0 R": 44, - "5 0 R": { - "/BaseFont": "/Helvetica", - "/Encoding": "/WinAnsiEncoding", - "/Name": "/F1", - "/Subtype": "/Type1", - "/Type": "/Font" - }, - "6 0 R": [ - "/PDF", - "/Text" - ], - "trailer": { - "/ID": [ - "b:1323a5937c577a66735583a93698ce3c", - "b:372cbf44f6db88ab60d9263c0f0bd26a" - ], - "/Root": "1 0 R", - "/Size": 7 - } - }, - "objectinfo": { - "1 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "2 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "3 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 44 - } - }, - "4 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "5 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "6 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null } } } diff --git a/qpdf/qtest/qpdf/direct-pages-json-pages.out b/qpdf/qtest/qpdf/direct-pages-json-pages.out index 4ebc4d29..5cd2b2c0 100644 --- a/qpdf/qtest/qpdf/direct-pages-json-pages.out +++ b/qpdf/qtest/qpdf/direct-pages-json-pages.out @@ -25,134 +25,98 @@ "pageposfrom1": 2 } ], - "objects": { - "1 0 R": { - "/Pages": "2 0 R", - "/Type": "/Catalog" - }, - "2 0 R": { - "/Count": 2, - "/Kids": [ - "7 0 R", - "8 0 R" - ], - "/Type": "/Pages" - }, - "3 0 R": { - "dict": { - "/Length": "4 0 R" - } - }, - "4 0 R": 44, - "5 0 R": { - "/BaseFont": "/Helvetica", - "/Encoding": "/WinAnsiEncoding", - "/Name": "/F1", - "/Subtype": "/Type1", - "/Type": "/Font" - }, - "6 0 R": [ - "/PDF", - "/Text" - ], - "7 0 R": { - "/Contents": "3 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "2 0 R", - "/Resources": { - "/Font": { - "/F1": "5 0 R" - }, - "/ProcSet": "6 0 R" + "qpdf": { + "jsonversion": 2, + "pdfversion": "1.3", + "objects": { + "obj:1 0 R": { + "value": { + "/Pages": "2 0 R", + "/Type": "/Catalog" + } }, - "/Type": "/Page" - }, - "8 0 R": { - "/Contents": "3 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "2 0 R", - "/Resources": { - "/Font": { - "/F1": "5 0 R" - }, - "/ProcSet": "6 0 R" + "obj:2 0 R": { + "value": { + "/Count": 2, + "/Kids": [ + "7 0 R", + "8 0 R" + ], + "/Type": "/Pages" + } }, - "/Type": "/Page" - }, - "trailer": { - "/ID": [ - "b:1323a5937c577a66735583a93698ce3c", - "b:372cbf44f6db88ab60d9263c0f0bd26a" - ], - "/Root": "1 0 R", - "/Size": 7 - } - }, - "objectinfo": { - "1 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "2 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "3 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 44 - } - }, - "4 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "5 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "6 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "7 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "8 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null + "obj:3 0 R": { + "stream": { + "dict": { + "/Length": "4 0 R" + } + } + }, + "obj:4 0 R": { + "value": 44 + }, + "obj:5 0 R": { + "value": { + "/BaseFont": "/Helvetica", + "/Encoding": "/WinAnsiEncoding", + "/Name": "/F1", + "/Subtype": "/Type1", + "/Type": "/Font" + } + }, + "obj:6 0 R": { + "value": [ + "/PDF", + "/Text" + ] + }, + "obj:7 0 R": { + "value": { + "/Contents": "3 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "2 0 R", + "/Resources": { + "/Font": { + "/F1": "5 0 R" + }, + "/ProcSet": "6 0 R" + }, + "/Type": "/Page" + } + }, + "obj:8 0 R": { + "value": { + "/Contents": "3 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "2 0 R", + "/Resources": { + "/Font": { + "/F1": "5 0 R" + }, + "/ProcSet": "6 0 R" + }, + "/Type": "/Page" + } + }, + "trailer": { + "value": { + "/ID": [ + "b:1323a5937c577a66735583a93698ce3c", + "b:372cbf44f6db88ab60d9263c0f0bd26a" + ], + "/Root": "1 0 R", + "/Size": 7 + } } } } diff --git a/qpdf/qtest/qpdf/json-V4-aes-encrypt---show-encryption-key-v2.out b/qpdf/qtest/qpdf/json-V4-aes-encrypt---show-encryption-key-v2.out index bef0e522..5f32eb44 100644 --- a/qpdf/qtest/qpdf/json-V4-aes-encrypt---show-encryption-key-v2.out +++ b/qpdf/qtest/qpdf/json-V4-aes-encrypt---show-encryption-key-v2.out @@ -7,8 +7,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, diff --git a/qpdf/qtest/qpdf/json-V4-aes-encrypt-v2.out b/qpdf/qtest/qpdf/json-V4-aes-encrypt-v2.out index 93de404b..959f0103 100644 --- a/qpdf/qtest/qpdf/json-V4-aes-encrypt-v2.out +++ b/qpdf/qtest/qpdf/json-V4-aes-encrypt-v2.out @@ -7,8 +7,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, diff --git a/qpdf/qtest/qpdf/json-field-types---show-encryption-key-v2.out b/qpdf/qtest/qpdf/json-field-types---show-encryption-key-v2.out index b52cc9db..c3158fae 100644 --- a/qpdf/qtest/qpdf/json-field-types---show-encryption-key-v2.out +++ b/qpdf/qtest/qpdf/json-field-types---show-encryption-key-v2.out @@ -26,7 +26,7 @@ "object": "4 0 R" }, "choices": [], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text", @@ -40,7 +40,7 @@ "parent": null, "partialname": "text", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "r1", @@ -266,7 +266,7 @@ "object": "10 0 R" }, "choices": [], - "defaultvalue": "salad πʬ", + "defaultvalue": "u:salad πʬ", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text2", @@ -280,7 +280,7 @@ "parent": null, "partialname": "text2", "quadding": 0, - "value": "salad πʬ" + "value": "u:salad πʬ" }, { "alternativename": "combolist1", @@ -295,7 +295,7 @@ "pi", "four" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combolist1", @@ -309,7 +309,7 @@ "parent": null, "partialname": "combolist1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "list1", @@ -324,7 +324,7 @@ "seven", "eight" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Ch", "fullname": "list1", @@ -338,7 +338,7 @@ "parent": null, "partialname": "list1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "drop1", @@ -353,7 +353,7 @@ "elephant", "twelve" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 131072, "fieldtype": "/Ch", "fullname": "drop1", @@ -367,7 +367,7 @@ "parent": null, "partialname": "drop1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "combodrop1", @@ -382,7 +382,7 @@ "gamma", "delta" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combodrop1", @@ -396,7 +396,7 @@ "parent": null, "partialname": "combodrop1", "quadding": 0, - "value": "" + "value": "u:" } ], "hasacroform": true, @@ -407,8 +407,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -433,7 +433,7 @@ "outlines": [], "qpdf": { "jsonversion": 2, - "pdfversion": "1.3", + "pdfversion": "1.5", "objects": { "obj:1 0 R": { "value": { @@ -454,7 +454,7 @@ ], "/NeedAppearances": true }, - "/Lang": "en-US", + "/Lang": "u:en-US", "/MarkInfo": { "/Marked": true }, @@ -472,9 +472,9 @@ }, "obj:2 0 R": { "value": { - "/CreationDate": "D:20190103125434-05'00'", - "/Creator": "Writer", - "/Producer": "LibreOffice 6.1" + "/CreationDate": "u:D:20190103125434-05'00'", + "/Creator": "u:Writer", + "/Producer": "u:LibreOffice 6.1" } }, "obj:3 0 R": { @@ -491,11 +491,11 @@ "/AP": { "/N": "19 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F2 12 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F2 12 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Tx", "/P": "15 0 R", @@ -506,9 +506,9 @@ 704.699 ], "/Subtype": "/Widget", - "/T": "text", + "/T": "u:text", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:5 0 R": { @@ -522,7 +522,7 @@ "23 0 R" ], "/P": "15 0 R", - "/T": "r1", + "/T": "u:r1", "/V": "/1" } }, @@ -535,7 +535,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -545,7 +545,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -555,7 +555,7 @@ 566.349 ], "/Subtype": "/Widget", - "/T": "checkbox1", + "/T": "u:checkbox1", "/Type": "/Annot", "/V": "/Off" } @@ -569,7 +569,7 @@ } }, "/AS": "/Yes", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -579,7 +579,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -589,7 +589,7 @@ 539.799 ], "/Subtype": "/Widget", - "/T": "checkbox2", + "/T": "u:checkbox2", "/Type": "/Annot", "/V": "/Yes" } @@ -603,7 +603,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -613,7 +613,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -623,7 +623,7 @@ 512.549 ], "/Subtype": "/Widget", - "/T": "checkbox3", + "/T": "u:checkbox3", "/Type": "/Annot", "/V": "/Off" } @@ -639,7 +639,7 @@ "39 0 R" ], "/P": "15 0 R", - "/T": "r2", + "/T": "u:r2", "/V": "/2" } }, @@ -648,11 +648,11 @@ "/AP": { "/N": "40 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F2 12 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F2 12 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "salad πʬ", + "/DV": "u:salad πʬ", "/F": 4, "/FT": "/Tx", "/P": "15 0 R", @@ -663,9 +663,9 @@ 278.099 ], "/Subtype": "/Widget", - "/T": "text2", + "/T": "u:text2", "/Type": "/Annot", - "/V": "salad πʬ" + "/V": "u:salad πʬ" } }, "obj:11 0 R": { @@ -673,18 +673,18 @@ "/AP": { "/N": "42 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Opt": [ - "five", - "six", - "seven", - "eight" + "u:five", + "u:six", + "u:seven", + "u:eight" ], "/P": "15 0 R", "/Rect": [ @@ -694,9 +694,9 @@ 232.849 ], "/Subtype": "/Widget", - "/T": "list1", + "/T": "u:list1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:12 0 R": { @@ -704,19 +704,19 @@ "/AP": { "/N": "44 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 131072, "/Opt": [ - "nine", - "ten", - "elephant", - "twelve" + "u:nine", + "u:ten", + "u:elephant", + "u:twelve" ], "/P": "15 0 R", "/Rect": [ @@ -726,9 +726,9 @@ 130.949 ], "/Subtype": "/Widget", - "/T": "drop1", + "/T": "u:drop1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:13 0 R": { @@ -736,19 +736,19 @@ "/AP": { "/N": "46 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 393216, "/Opt": [ - "one", - "two", - "pi", - "four" + "u:one", + "u:two", + "u:pi", + "u:four" ], "/P": "15 0 R", "/Rect": [ @@ -758,9 +758,9 @@ 232.849 ], "/Subtype": "/Widget", - "/T": "combolist1", + "/T": "u:combolist1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:14 0 R": { @@ -768,19 +768,19 @@ "/AP": { "/N": "48 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 393216, "/Opt": [ - "alpha", - "beta", - "gamma", - "delta" + "u:alpha", + "u:beta", + "u:gamma", + "u:delta" ], "/P": "15 0 R", "/Rect": [ @@ -790,9 +790,9 @@ 135.349 ], "/Subtype": "/Widget", - "/T": "combodrop1", + "/T": "u:combodrop1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:15 0 R": { @@ -898,7 +898,7 @@ } }, "/AS": "/1", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -907,7 +907,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -930,7 +930,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -939,7 +939,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -962,7 +962,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -971,7 +971,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -1115,7 +1115,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1124,7 +1124,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -1147,7 +1147,7 @@ } }, "/AS": "/2", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1156,7 +1156,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -1179,7 +1179,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1188,7 +1188,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -3165,8 +3165,8 @@ "value": { "/DocChecksum": "/CC322E136FE95DECF8BC297B1A9B2C2E", "/ID": [ - "ø«Ä{±ßTJ\rùÁZuï\u0000F", - "ì®zg+Ìó4…[Tƒ{ —8" + "b:f8abc47bb1df544a0df9c15a75ef0046", + "b:ecae7a672bccf334835b54867b208438" ], "/Info": "2 0 R", "/Root": "1 0 R", diff --git a/qpdf/qtest/qpdf/json-field-types-acroform-v2.out b/qpdf/qtest/qpdf/json-field-types-acroform-v2.out index c5854d12..79abecf6 100644 --- a/qpdf/qtest/qpdf/json-field-types-acroform-v2.out +++ b/qpdf/qtest/qpdf/json-field-types-acroform-v2.out @@ -13,7 +13,7 @@ "object": "4 0 R" }, "choices": [], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text", @@ -27,7 +27,7 @@ "parent": null, "partialname": "text", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "r1", @@ -253,7 +253,7 @@ "object": "10 0 R" }, "choices": [], - "defaultvalue": "salad πʬ", + "defaultvalue": "u:salad πʬ", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text2", @@ -267,7 +267,7 @@ "parent": null, "partialname": "text2", "quadding": 0, - "value": "salad πʬ" + "value": "u:salad πʬ" }, { "alternativename": "combolist1", @@ -282,7 +282,7 @@ "pi", "four" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combolist1", @@ -296,7 +296,7 @@ "parent": null, "partialname": "combolist1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "list1", @@ -311,7 +311,7 @@ "seven", "eight" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Ch", "fullname": "list1", @@ -325,7 +325,7 @@ "parent": null, "partialname": "list1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "drop1", @@ -340,7 +340,7 @@ "elephant", "twelve" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 131072, "fieldtype": "/Ch", "fullname": "drop1", @@ -354,7 +354,7 @@ "parent": null, "partialname": "drop1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "combodrop1", @@ -369,7 +369,7 @@ "gamma", "delta" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combodrop1", @@ -383,7 +383,7 @@ "parent": null, "partialname": "combodrop1", "quadding": 0, - "value": "" + "value": "u:" } ], "hasacroform": true, diff --git a/qpdf/qtest/qpdf/json-field-types-v2.out b/qpdf/qtest/qpdf/json-field-types-v2.out index b52cc9db..c3158fae 100644 --- a/qpdf/qtest/qpdf/json-field-types-v2.out +++ b/qpdf/qtest/qpdf/json-field-types-v2.out @@ -26,7 +26,7 @@ "object": "4 0 R" }, "choices": [], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text", @@ -40,7 +40,7 @@ "parent": null, "partialname": "text", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "r1", @@ -266,7 +266,7 @@ "object": "10 0 R" }, "choices": [], - "defaultvalue": "salad πʬ", + "defaultvalue": "u:salad πʬ", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text2", @@ -280,7 +280,7 @@ "parent": null, "partialname": "text2", "quadding": 0, - "value": "salad πʬ" + "value": "u:salad πʬ" }, { "alternativename": "combolist1", @@ -295,7 +295,7 @@ "pi", "four" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combolist1", @@ -309,7 +309,7 @@ "parent": null, "partialname": "combolist1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "list1", @@ -324,7 +324,7 @@ "seven", "eight" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Ch", "fullname": "list1", @@ -338,7 +338,7 @@ "parent": null, "partialname": "list1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "drop1", @@ -353,7 +353,7 @@ "elephant", "twelve" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 131072, "fieldtype": "/Ch", "fullname": "drop1", @@ -367,7 +367,7 @@ "parent": null, "partialname": "drop1", "quadding": 0, - "value": "" + "value": "u:" }, { "alternativename": "combodrop1", @@ -382,7 +382,7 @@ "gamma", "delta" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combodrop1", @@ -396,7 +396,7 @@ "parent": null, "partialname": "combodrop1", "quadding": 0, - "value": "" + "value": "u:" } ], "hasacroform": true, @@ -407,8 +407,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -433,7 +433,7 @@ "outlines": [], "qpdf": { "jsonversion": 2, - "pdfversion": "1.3", + "pdfversion": "1.5", "objects": { "obj:1 0 R": { "value": { @@ -454,7 +454,7 @@ ], "/NeedAppearances": true }, - "/Lang": "en-US", + "/Lang": "u:en-US", "/MarkInfo": { "/Marked": true }, @@ -472,9 +472,9 @@ }, "obj:2 0 R": { "value": { - "/CreationDate": "D:20190103125434-05'00'", - "/Creator": "Writer", - "/Producer": "LibreOffice 6.1" + "/CreationDate": "u:D:20190103125434-05'00'", + "/Creator": "u:Writer", + "/Producer": "u:LibreOffice 6.1" } }, "obj:3 0 R": { @@ -491,11 +491,11 @@ "/AP": { "/N": "19 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F2 12 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F2 12 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Tx", "/P": "15 0 R", @@ -506,9 +506,9 @@ 704.699 ], "/Subtype": "/Widget", - "/T": "text", + "/T": "u:text", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:5 0 R": { @@ -522,7 +522,7 @@ "23 0 R" ], "/P": "15 0 R", - "/T": "r1", + "/T": "u:r1", "/V": "/1" } }, @@ -535,7 +535,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -545,7 +545,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -555,7 +555,7 @@ 566.349 ], "/Subtype": "/Widget", - "/T": "checkbox1", + "/T": "u:checkbox1", "/Type": "/Annot", "/V": "/Off" } @@ -569,7 +569,7 @@ } }, "/AS": "/Yes", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -579,7 +579,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -589,7 +589,7 @@ 539.799 ], "/Subtype": "/Widget", - "/T": "checkbox2", + "/T": "u:checkbox2", "/Type": "/Annot", "/V": "/Yes" } @@ -603,7 +603,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -613,7 +613,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "8" + "/CA": "u:8" }, "/P": "15 0 R", "/Rect": [ @@ -623,7 +623,7 @@ 512.549 ], "/Subtype": "/Widget", - "/T": "checkbox3", + "/T": "u:checkbox3", "/Type": "/Annot", "/V": "/Off" } @@ -639,7 +639,7 @@ "39 0 R" ], "/P": "15 0 R", - "/T": "r2", + "/T": "u:r2", "/V": "/2" } }, @@ -648,11 +648,11 @@ "/AP": { "/N": "40 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F2 12 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F2 12 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "salad πʬ", + "/DV": "u:salad πʬ", "/F": 4, "/FT": "/Tx", "/P": "15 0 R", @@ -663,9 +663,9 @@ 278.099 ], "/Subtype": "/Widget", - "/T": "text2", + "/T": "u:text2", "/Type": "/Annot", - "/V": "salad πʬ" + "/V": "u:salad πʬ" } }, "obj:11 0 R": { @@ -673,18 +673,18 @@ "/AP": { "/N": "42 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Opt": [ - "five", - "six", - "seven", - "eight" + "u:five", + "u:six", + "u:seven", + "u:eight" ], "/P": "15 0 R", "/Rect": [ @@ -694,9 +694,9 @@ 232.849 ], "/Subtype": "/Widget", - "/T": "list1", + "/T": "u:list1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:12 0 R": { @@ -704,19 +704,19 @@ "/AP": { "/N": "44 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 131072, "/Opt": [ - "nine", - "ten", - "elephant", - "twelve" + "u:nine", + "u:ten", + "u:elephant", + "u:twelve" ], "/P": "15 0 R", "/Rect": [ @@ -726,9 +726,9 @@ 130.949 ], "/Subtype": "/Widget", - "/T": "drop1", + "/T": "u:drop1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:13 0 R": { @@ -736,19 +736,19 @@ "/AP": { "/N": "46 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 393216, "/Opt": [ - "one", - "two", - "pi", - "four" + "u:one", + "u:two", + "u:pi", + "u:four" ], "/P": "15 0 R", "/Rect": [ @@ -758,9 +758,9 @@ 232.849 ], "/Subtype": "/Widget", - "/T": "combolist1", + "/T": "u:combolist1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:14 0 R": { @@ -768,19 +768,19 @@ "/AP": { "/N": "48 0 R" }, - "/DA": "0.18039 0.20392 0.21176 rg /F4 10 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /F4 10 Tf", "/DR": { "/Font": "18 0 R" }, - "/DV": "", + "/DV": "u:", "/F": 4, "/FT": "/Ch", "/Ff": 393216, "/Opt": [ - "alpha", - "beta", - "gamma", - "delta" + "u:alpha", + "u:beta", + "u:gamma", + "u:delta" ], "/P": "15 0 R", "/Rect": [ @@ -790,9 +790,9 @@ 135.349 ], "/Subtype": "/Widget", - "/T": "combodrop1", + "/T": "u:combodrop1", "/Type": "/Annot", - "/V": "" + "/V": "u:" } }, "obj:15 0 R": { @@ -898,7 +898,7 @@ } }, "/AS": "/1", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -907,7 +907,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -930,7 +930,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -939,7 +939,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -962,7 +962,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -971,7 +971,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "5 0 R", @@ -1115,7 +1115,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1124,7 +1124,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -1147,7 +1147,7 @@ } }, "/AS": "/2", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1156,7 +1156,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -1179,7 +1179,7 @@ } }, "/AS": "/Off", - "/DA": "0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", + "/DA": "u:0.18039 0.20392 0.21176 rg /ZaDi 0 Tf", "/DR": { "/Font": { "/ZaDi": "28 0 R" @@ -1188,7 +1188,7 @@ "/F": 4, "/FT": "/Btn", "/MK": { - "/CA": "l" + "/CA": "u:l" }, "/P": "15 0 R", "/Parent": "9 0 R", @@ -3165,8 +3165,8 @@ "value": { "/DocChecksum": "/CC322E136FE95DECF8BC297B1A9B2C2E", "/ID": [ - "ø«Ä{±ßTJ\rùÁZuï\u0000F", - "ì®zg+Ìó4…[Tƒ{ —8" + "b:f8abc47bb1df544a0df9c15a75ef0046", + "b:ecae7a672bccf334835b54867b208438" ], "/Info": "2 0 R", "/Root": "1 0 R", diff --git a/qpdf/qtest/qpdf/json-image-streams-all-v2.out b/qpdf/qtest/qpdf/json-image-streams-all-v2.out index 3b09fe94..6ba15415 100644 --- a/qpdf/qtest/qpdf/json-image-streams-all-v2.out +++ b/qpdf/qtest/qpdf/json-image-streams-all-v2.out @@ -250,8 +250,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -733,8 +733,8 @@ "trailer": { "value": { "/ID": [ - "S¶Ł”łîð\u000e¢¬\u0007}_)\u0012¶", - "'+“‰¤V2«PP ç`m\"˛" + "b:53b6958e9beef00ea2ac077d5f2912b6", + "b:272b8d8ba45632ab505020e7606d221d" ], "/Root": "1 0 R", "/Size": 31 diff --git a/qpdf/qtest/qpdf/json-image-streams-small-v2.out b/qpdf/qtest/qpdf/json-image-streams-small-v2.out index f9daea32..f7556d31 100644 --- a/qpdf/qtest/qpdf/json-image-streams-small-v2.out +++ b/qpdf/qtest/qpdf/json-image-streams-small-v2.out @@ -250,8 +250,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -745,8 +745,8 @@ "trailer": { "value": { "/ID": [ - "Z§¯•Py»’~’46˛ı\u0011¢", - "Z§¯•Py»’~’46˛ı\u0011¢" + "b:5aa7af805079bb907e9034361d9a11a2", + "b:5aa7af805079bb907e9034361d9a11a2" ], "/Root": "1 0 R", "/Size": 31 diff --git a/qpdf/qtest/qpdf/json-image-streams-specialized-v2.out b/qpdf/qtest/qpdf/json-image-streams-specialized-v2.out index 42382857..3e3f699c 100644 --- a/qpdf/qtest/qpdf/json-image-streams-specialized-v2.out +++ b/qpdf/qtest/qpdf/json-image-streams-specialized-v2.out @@ -250,8 +250,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -733,8 +733,8 @@ "trailer": { "value": { "/ID": [ - "S¶Ł”łîð\u000e¢¬\u0007}_)\u0012¶", - "'+“‰¤V2«PP ç`m\"˛" + "b:53b6958e9beef00ea2ac077d5f2912b6", + "b:272b8d8ba45632ab505020e7606d221d" ], "/Root": "1 0 R", "/Size": 31 diff --git a/qpdf/qtest/qpdf/json-image-streams-v2.out b/qpdf/qtest/qpdf/json-image-streams-v2.out index d757bb57..6a49225b 100644 --- a/qpdf/qtest/qpdf/json-image-streams-v2.out +++ b/qpdf/qtest/qpdf/json-image-streams-v2.out @@ -250,8 +250,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -733,8 +733,8 @@ "trailer": { "value": { "/ID": [ - "S¶Ł”łîð\u000e¢¬\u0007}_)\u0012¶", - "'+“‰¤V2«PP ç`m\"˛" + "b:53b6958e9beef00ea2ac077d5f2912b6", + "b:272b8d8ba45632ab505020e7606d221d" ], "/Root": "1 0 R", "/Size": 31 diff --git a/qpdf/qtest/qpdf/json-need-appearances-acroform-v2.out b/qpdf/qtest/qpdf/json-need-appearances-acroform-v2.out index ae3dcec3..b5f00110 100644 --- a/qpdf/qtest/qpdf/json-need-appearances-acroform-v2.out +++ b/qpdf/qtest/qpdf/json-need-appearances-acroform-v2.out @@ -13,7 +13,7 @@ "object": "4 0 R" }, "choices": [], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text", @@ -27,7 +27,7 @@ "parent": null, "partialname": "text", "quadding": 0, - "value": "abc" + "value": "u:abc" }, { "alternativename": "r1", @@ -253,7 +253,7 @@ "object": "10 0 R" }, "choices": [], - "defaultvalue": "salad πʬ", + "defaultvalue": "u:salad πʬ", "fieldflags": 0, "fieldtype": "/Tx", "fullname": "text2", @@ -267,7 +267,7 @@ "parent": null, "partialname": "text2", "quadding": 0, - "value": "salad ÷πʬ" + "value": "u:salad ÷πʬ" }, { "alternativename": "combolist1", @@ -282,7 +282,7 @@ "pi", "four" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combolist1", @@ -296,7 +296,7 @@ "parent": null, "partialname": "combolist1", "quadding": 0, - "value": "pi" + "value": "u:pi" }, { "alternativename": "list1", @@ -311,7 +311,7 @@ "seven", "eight" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 0, "fieldtype": "/Ch", "fullname": "list1", @@ -325,7 +325,7 @@ "parent": null, "partialname": "list1", "quadding": 0, - "value": "six" + "value": "u:six" }, { "alternativename": "drop1", @@ -340,7 +340,7 @@ "elephant", "twelve" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 131072, "fieldtype": "/Ch", "fullname": "drop1", @@ -354,7 +354,7 @@ "parent": null, "partialname": "drop1", "quadding": 0, - "value": "elephant" + "value": "u:elephant" }, { "alternativename": "combodrop1", @@ -369,7 +369,7 @@ "gamma", "delta" ], - "defaultvalue": "", + "defaultvalue": "u:", "fieldflags": 393216, "fieldtype": "/Ch", "fullname": "combodrop1", @@ -383,7 +383,7 @@ "parent": null, "partialname": "combodrop1", "quadding": 0, - "value": "delta" + "value": "u:delta" } ], "hasacroform": true, diff --git a/qpdf/qtest/qpdf/json-outlines-with-actions-v2.out b/qpdf/qtest/qpdf/json-outlines-with-actions-v2.out index 4182f6d3..feffede7 100644 --- a/qpdf/qtest/qpdf/json-outlines-with-actions-v2.out +++ b/qpdf/qtest/qpdf/json-outlines-with-actions-v2.out @@ -441,8 +441,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -694,7 +694,7 @@ "/Last": "37 0 R", "/Next": "5 0 R", "/Parent": "2 0 R", - "/Title": "Potato 1 -> 5: /XYZ null null null", + "/Title": "u:Potato 1 -> 5: /XYZ null null null", "/Type": "/Outline" } }, @@ -709,7 +709,7 @@ ], "/Parent": "2 0 R", "/Prev": "4 0 R", - "/Title": "Salad 2 -> 15: /XYZ 66 756 3", + "/Title": "u:Salad 2 -> 15: /XYZ 66 756 3", "/Type": "/Outline" } }, @@ -1294,7 +1294,7 @@ "/Last": "101 0 R", "/Next": "37 0 R", "/Parent": "4 0 R", - "/Title": "Mern 1.1 -> 11: /Fit", + "/Title": "u:Mern 1.1 -> 11: /Fit", "/Type": "/Outline" } }, @@ -1310,7 +1310,7 @@ "/Last": "103 0 R", "/Parent": "4 0 R", "/Prev": "36 0 R", - "/Title": "Squash ÷πʬ÷ 1.2 -> 13: /FitH 792", + "/Title": "u:Squash ÷πʬ÷ 1.2 -> 13: /FitH 792", "/Type": "/Outline" } }, @@ -1641,7 +1641,7 @@ "/Last": "105 0 R", "/Next": "101 0 R", "/Parent": "36 0 R", - "/Title": "Biherbadem 1.1.1 -> 12: /FitV 100", + "/Title": "u:Biherbadem 1.1.1 -> 12: /FitV 100", "/Type": "/Outline" } }, @@ -1659,16 +1659,16 @@ "/Last": "106 0 R", "/Parent": "36 0 R", "/Prev": "100 0 R", - "/Title": "Gawehwehweh 1.1.2 -> 12: /XYZ null null null", + "/Title": "u:Gawehwehweh 1.1.2 -> 12: /XYZ null null null", "/Type": "/Outline" } }, "obj:102 0 R": { "value": { - "/Dest": "gabeebee", + "/Dest": "u:gabeebee", "/Next": "103 0 R", "/Parent": "37 0 R", - "/Title": "Gabeebeebee (name) 1.2.1 -> 1: /FitR 66 714 180 770", + "/Title": "u:Gabeebeebee (name) 1.2.1 -> 1: /FitR 66 714 180 770", "/Type": "/Outline" } }, @@ -1687,20 +1687,20 @@ }, "/Parent": "37 0 R", "/Prev": "102 0 R", - "/Title": "Merschqaberschq (A) 1.2.2 -> 0: /XYZ null null null", + "/Title": "u:Merschqaberschq (A) 1.2.2 -> 0: /XYZ null null null", "/Type": "/Outline" } }, "obj:104 0 R": { "value": { "/A": { - "/D": "glarp", + "/D": "u:glarp", "/S": "/GoTo", "/Type": "/Action" }, "/Next": "105 0 R", "/Parent": "100 0 R", - "/Title": "Glarpenspliel (A, name) 1.1.1.1 -> 18: /XYZ null null null", + "/Title": "u:Glarpenspliel (A, name) 1.1.1.1 -> 18: /XYZ null null null", "/Type": "/Outline" } }, @@ -1715,7 +1715,7 @@ ], "/Parent": "100 0 R", "/Prev": "104 0 R", - "/Title": "Hagoogamagoogle 1.1.1.2 -> 19: /XYZ null null null", + "/Title": "u:Hagoogamagoogle 1.1.1.2 -> 19: /XYZ null null null", "/Type": "/Outline" } }, @@ -1723,14 +1723,14 @@ "value": { "/Dest": "108 0 R", "/Parent": "101 0 R", - "/Title": "Jawarnianbvarwash 1.1.2.1 -> 22: /XYZ null null null", + "/Title": "u:Jawarnianbvarwash 1.1.2.1 -> 22: /XYZ null null null", "/Type": "/Outline" } }, "obj:107 0 R": { "value": { "/Names": [ - "gabeebee", + "u:gabeebee", [ "7 0 R", "/FitR", @@ -1739,7 +1739,7 @@ 180, 770 ], - "glarp", + "u:glarp", [ "24 0 R", "/XYZ", @@ -1762,8 +1762,8 @@ "trailer": { "value": { "/ID": [ - "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f", - "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f" + "b:d52b0c17c216506962ae6743afec260f", + "b:d52b0c17c216506962ae6743afec260f" ], "/Root": "1 0 R", "/Size": 109 diff --git a/qpdf/qtest/qpdf/json-outlines-with-old-root-dests-v2.out b/qpdf/qtest/qpdf/json-outlines-with-old-root-dests-v2.out index 4bd39d7c..6ce3b54d 100644 --- a/qpdf/qtest/qpdf/json-outlines-with-old-root-dests-v2.out +++ b/qpdf/qtest/qpdf/json-outlines-with-old-root-dests-v2.out @@ -10,7 +10,7 @@ ], "images": [], "label": { - "/P": "0", + "/P": "u:0", "/St": 1 }, "object": "6 0 R", @@ -524,7 +524,7 @@ { "index": 0, "label": { - "/P": "0", + "/P": "u:0", "/St": 1 } }, @@ -546,8 +546,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -736,7 +736,7 @@ "/Nums": [ 0, { - "/P": "0" + "/P": "u:0" }, 1, { @@ -809,7 +809,7 @@ "/Last": "37 0 R", "/Next": "5 0 R", "/Parent": "2 0 R", - "/Title": "•Potato 1 -> 5: /XYZ null null null", + "/Title": "u:•Potato 1 -> 5: /XYZ null null null", "/Type": "/Outline" } }, @@ -824,7 +824,7 @@ ], "/Parent": "2 0 R", "/Prev": "4 0 R", - "/Title": "•Salad 2 -> 15: /XYZ 66 756 3", + "/Title": "u:•Salad 2 -> 15: /XYZ 66 756 3", "/Type": "/Outline" } }, @@ -1409,7 +1409,7 @@ "/Last": "101 0 R", "/Next": "37 0 R", "/Parent": "4 0 R", - "/Title": "•Mern 1.1 -> 11: /Fit", + "/Title": "u:•Mern 1.1 -> 11: /Fit", "/Type": "/Outline" } }, @@ -1425,7 +1425,7 @@ "/Last": "103 0 R", "/Parent": "4 0 R", "/Prev": "36 0 R", - "/Title": "•Squash ÷πʬ÷ 1.2 -> 13: /FitH 792", + "/Title": "u:•Squash ÷πʬ÷ 1.2 -> 13: /FitH 792", "/Type": "/Outline" } }, @@ -1756,7 +1756,7 @@ "/Last": "105 0 R", "/Next": "101 0 R", "/Parent": "36 0 R", - "/Title": "•Biherbadem 1.1.1 -> 12: /FitV 100", + "/Title": "u:•Biherbadem 1.1.1 -> 12: /FitV 100", "/Type": "/Outline" } }, @@ -1774,7 +1774,7 @@ "/Last": "106 0 R", "/Parent": "36 0 R", "/Prev": "100 0 R", - "/Title": "•Gawehwehweh 1.1.2 -> 12: /XYZ null null null", + "/Title": "u:•Gawehwehweh 1.1.2 -> 12: /XYZ null null null", "/Type": "/Outline" } }, @@ -1783,7 +1783,7 @@ "/Dest": "/gabeebee", "/Next": "103 0 R", "/Parent": "37 0 R", - "/Title": "•Gabeebeebee (name) 1.2.1 -> 1: /FitR 66 714 180 770", + "/Title": "u:•Gabeebeebee (name) 1.2.1 -> 1: /FitR 66 714 180 770", "/Type": "/Outline" } }, @@ -1802,7 +1802,7 @@ }, "/Parent": "37 0 R", "/Prev": "102 0 R", - "/Title": "•Merschqaberschq (A) 1.2.2 -> 0: /XYZ null null null", + "/Title": "u:•Merschqaberschq (A) 1.2.2 -> 0: /XYZ null null null", "/Type": "/Outline" } }, @@ -1815,7 +1815,7 @@ }, "/Next": "105 0 R", "/Parent": "100 0 R", - "/Title": "•Glarpenspliel (A, name) 1.1.1.1 -> 18: /XYZ null null null", + "/Title": "u:•Glarpenspliel (A, name) 1.1.1.1 -> 18: /XYZ null null null", "/Type": "/Outline" } }, @@ -1830,7 +1830,7 @@ ], "/Parent": "100 0 R", "/Prev": "104 0 R", - "/Title": "•Hagoogamagoogle 1.1.1.2 -> 19: /XYZ null null null", + "/Title": "u:•Hagoogamagoogle 1.1.1.2 -> 19: /XYZ null null null", "/Type": "/Outline" } }, @@ -1844,7 +1844,7 @@ null ], "/Parent": "101 0 R", - "/Title": "•Jawarnianbvarwash 1.1.2.1 -> 22: /XYZ null null null", + "/Title": "u:•Jawarnianbvarwash 1.1.2.1 -> 22: /XYZ null null null", "/Type": "/Outline" } }, @@ -1870,8 +1870,8 @@ "trailer": { "value": { "/ID": [ - "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f", - "Õ+\f\u0017Â\u0016Pib®gC¯ì&\u000f" + "b:d52b0c17c216506962ae6743afec260f", + "b:d52b0c17c216506962ae6743afec260f" ], "/Root": "1 0 R", "/Size": 108 diff --git a/qpdf/qtest/qpdf/json-page-labels-and-outlines-outlines-pages-v2.out b/qpdf/qtest/qpdf/json-page-labels-and-outlines-outlines-pages-v2.out index 05c245ef..acbf7e08 100644 --- a/qpdf/qtest/qpdf/json-page-labels-and-outlines-outlines-pages-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-and-outlines-outlines-pages-v2.out @@ -10,7 +10,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "3 0 R", @@ -35,7 +35,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "4 0 R", @@ -138,7 +138,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "10 0 R", @@ -151,7 +151,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "11 0 R", @@ -190,7 +190,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "14 0 R", @@ -358,7 +358,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "22 0 R", diff --git a/qpdf/qtest/qpdf/json-page-labels-and-outlines-pagelabels-v2.out b/qpdf/qtest/qpdf/json-page-labels-and-outlines-pagelabels-v2.out index 8f2d7578..50611b13 100644 --- a/qpdf/qtest/qpdf/json-page-labels-and-outlines-pagelabels-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-and-outlines-pagelabels-v2.out @@ -7,7 +7,7 @@ { "index": 0, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -21,7 +21,7 @@ { "index": 7, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -35,7 +35,7 @@ { "index": 11, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -56,7 +56,7 @@ { "index": 19, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, diff --git a/qpdf/qtest/qpdf/json-page-labels-and-outlines-pages-v2.out b/qpdf/qtest/qpdf/json-page-labels-and-outlines-pages-v2.out index 9d11e8f1..746d0bee 100644 --- a/qpdf/qtest/qpdf/json-page-labels-and-outlines-pages-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-and-outlines-pages-v2.out @@ -10,7 +10,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "3 0 R", @@ -35,7 +35,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "4 0 R", @@ -138,7 +138,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "10 0 R", @@ -151,7 +151,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "11 0 R", @@ -190,7 +190,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "14 0 R", @@ -358,7 +358,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "22 0 R", diff --git a/qpdf/qtest/qpdf/json-page-labels-and-outlines-qpdf-v2.out b/qpdf/qtest/qpdf/json-page-labels-and-outlines-qpdf-v2.out index 8a64c16f..3d8a2d67 100644 --- a/qpdf/qtest/qpdf/json-page-labels-and-outlines-qpdf-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-and-outlines-qpdf-v2.out @@ -14,7 +14,7 @@ "/Nums": [ 0, { - "/P": "" + "/P": "u:" }, 2, { @@ -23,7 +23,7 @@ }, 7, { - "/P": "" + "/P": "u:" }, 9, { @@ -32,7 +32,7 @@ }, 11, { - "/P": "" + "/P": "u:" }, 12, { @@ -46,7 +46,7 @@ }, 19, { - "/P": "" + "/P": "u:" }, 20, { @@ -684,8 +684,10 @@ } }, "obj:33 0 R": { - "value": { - "/Length": "34 0 R" + "stream": { + "dict": { + "/Length": "34 0 R" + } } }, "obj:34 0 R": { @@ -707,232 +709,290 @@ ] }, "obj:37 0 R": { - "value": { - "/Length": "38 0 R" + "stream": { + "dict": { + "/Length": "38 0 R" + } } }, "obj:38 0 R": { "value": 46 }, "obj:39 0 R": { - "value": { - "/Length": "40 0 R" + "stream": { + "dict": { + "/Length": "40 0 R" + } } }, "obj:40 0 R": { "value": 46 }, "obj:41 0 R": { - "value": { - "/Length": "42 0 R" + "stream": { + "dict": { + "/Length": "42 0 R" + } } }, "obj:42 0 R": { "value": 46 }, "obj:43 0 R": { - "value": { - "/Length": "44 0 R" + "stream": { + "dict": { + "/Length": "44 0 R" + } } }, "obj:44 0 R": { "value": 46 }, "obj:45 0 R": { - "value": { - "/Length": "46 0 R" + "stream": { + "dict": { + "/Length": "46 0 R" + } } }, "obj:46 0 R": { "value": 46 }, "obj:47 0 R": { - "value": { - "/Length": "48 0 R" + "stream": { + "dict": { + "/Length": "48 0 R" + } } }, "obj:48 0 R": { "value": 46 }, "obj:49 0 R": { - "value": { - "/Length": "50 0 R" + "stream": { + "dict": { + "/Length": "50 0 R" + } } }, "obj:50 0 R": { "value": 46 }, "obj:51 0 R": { - "value": { - "/Length": "52 0 R" + "stream": { + "dict": { + "/Length": "52 0 R" + } } }, "obj:52 0 R": { "value": 46 }, "obj:53 0 R": { - "value": { - "/Length": "54 0 R" + "stream": { + "dict": { + "/Length": "54 0 R" + } } }, "obj:54 0 R": { "value": 46 }, "obj:55 0 R": { - "value": { - "/Length": "56 0 R" + "stream": { + "dict": { + "/Length": "56 0 R" + } } }, "obj:56 0 R": { "value": 47 }, "obj:57 0 R": { - "value": { - "/Length": "58 0 R" + "stream": { + "dict": { + "/Length": "58 0 R" + } } }, "obj:58 0 R": { "value": 47 }, "obj:59 0 R": { - "value": { - "/Length": "60 0 R" + "stream": { + "dict": { + "/Length": "60 0 R" + } } }, "obj:60 0 R": { "value": 47 }, "obj:61 0 R": { - "value": { - "/Length": "62 0 R" + "stream": { + "dict": { + "/Length": "62 0 R" + } } }, "obj:62 0 R": { "value": 47 }, "obj:63 0 R": { - "value": { - "/Length": "64 0 R" + "stream": { + "dict": { + "/Length": "64 0 R" + } } }, "obj:64 0 R": { "value": 47 }, "obj:65 0 R": { - "value": { - "/Length": "66 0 R" + "stream": { + "dict": { + "/Length": "66 0 R" + } } }, "obj:66 0 R": { "value": 47 }, "obj:67 0 R": { - "value": { - "/Length": "68 0 R" + "stream": { + "dict": { + "/Length": "68 0 R" + } } }, "obj:68 0 R": { "value": 47 }, "obj:69 0 R": { - "value": { - "/Length": "70 0 R" + "stream": { + "dict": { + "/Length": "70 0 R" + } } }, "obj:70 0 R": { "value": 47 }, "obj:71 0 R": { - "value": { - "/Length": "72 0 R" + "stream": { + "dict": { + "/Length": "72 0 R" + } } }, "obj:72 0 R": { "value": 47 }, "obj:73 0 R": { - "value": { - "/Length": "74 0 R" + "stream": { + "dict": { + "/Length": "74 0 R" + } } }, "obj:74 0 R": { "value": 47 }, "obj:75 0 R": { - "value": { - "/Length": "76 0 R" + "stream": { + "dict": { + "/Length": "76 0 R" + } } }, "obj:76 0 R": { "value": 47 }, "obj:77 0 R": { - "value": { - "/Length": "78 0 R" + "stream": { + "dict": { + "/Length": "78 0 R" + } } }, "obj:78 0 R": { "value": 47 }, "obj:79 0 R": { - "value": { - "/Length": "80 0 R" + "stream": { + "dict": { + "/Length": "80 0 R" + } } }, "obj:80 0 R": { "value": 47 }, "obj:81 0 R": { - "value": { - "/Length": "82 0 R" + "stream": { + "dict": { + "/Length": "82 0 R" + } } }, "obj:82 0 R": { "value": 47 }, "obj:83 0 R": { - "value": { - "/Length": "84 0 R" + "stream": { + "dict": { + "/Length": "84 0 R" + } } }, "obj:84 0 R": { "value": 47 }, "obj:85 0 R": { - "value": { - "/Length": "86 0 R" + "stream": { + "dict": { + "/Length": "86 0 R" + } } }, "obj:86 0 R": { "value": 47 }, "obj:87 0 R": { - "value": { - "/Length": "88 0 R" + "stream": { + "dict": { + "/Length": "88 0 R" + } } }, "obj:88 0 R": { "value": 47 }, "obj:89 0 R": { - "value": { - "/Length": "90 0 R" + "stream": { + "dict": { + "/Length": "90 0 R" + } } }, "obj:90 0 R": { "value": 47 }, "obj:91 0 R": { - "value": { - "/Length": "92 0 R" + "stream": { + "dict": { + "/Length": "92 0 R" + } } }, "obj:92 0 R": { "value": 47 }, "obj:93 0 R": { - "value": { - "/Length": "94 0 R" + "stream": { + "dict": { + "/Length": "94 0 R" + } } }, "obj:94 0 R": { @@ -960,7 +1020,7 @@ "/Last": "99 0 R", "/Next": "97 0 R", "/Parent": "95 0 R", - "/Title": "Isís 1 -> 5: /XYZ null null null", + "/Title": "u:Isís 1 -> 5: /XYZ null null null", "/Type": "/Outline" } }, @@ -975,7 +1035,7 @@ ], "/Parent": "95 0 R", "/Prev": "96 0 R", - "/Title": "Trepak 2 -> 15: /XYZ 66 756 3", + "/Title": "u:Trepak 2 -> 15: /XYZ 66 756 3", "/Type": "/Outline" } }, @@ -990,7 +1050,7 @@ "/Last": "101 0 R", "/Next": "99 0 R", "/Parent": "96 0 R", - "/Title": "Amanda 1.1 -> 11: /Fit", + "/Title": "u:Amanda 1.1 -> 11: /Fit", "/Type": "/Outline" } }, @@ -1006,7 +1066,7 @@ "/Last": "106 0 R", "/Parent": "96 0 R", "/Prev": "98 0 R", - "/Title": "Sandy ÷Σανδι÷ 1.2 -> 13: /FitH 792", + "/Title": "u:Sandy ÷Σανδι÷ 1.2 -> 13: /FitH 792", "/Type": "/Outline" } }, @@ -1022,7 +1082,7 @@ "/Last": "103 0 R", "/Next": "101 0 R", "/Parent": "98 0 R", - "/Title": "Isosicle 1.1.1 -> 12: /FitV 100", + "/Title": "u:Isosicle 1.1.1 -> 12: /FitV 100", "/Type": "/Outline" } }, @@ -1040,7 +1100,7 @@ "/Last": "104 0 R", "/Parent": "98 0 R", "/Prev": "100 0 R", - "/Title": "Isosicle 1.1.2 -> 12: /XYZ null null null", + "/Title": "u:Isosicle 1.1.2 -> 12: /XYZ null null null", "/Type": "/Outline" } }, @@ -1055,7 +1115,7 @@ ], "/Next": "103 0 R", "/Parent": "100 0 R", - "/Title": "Isosicle 1.1.1.1 -> 18: /XYZ null null null", + "/Title": "u:Isosicle 1.1.1.1 -> 18: /XYZ null null null", "/Type": "/Outline" } }, @@ -1070,7 +1130,7 @@ ], "/Parent": "100 0 R", "/Prev": "102 0 R", - "/Title": "Isosicle 1.1.1.2 -> 19: /XYZ null null null", + "/Title": "u:Isosicle 1.1.1.2 -> 19: /XYZ null null null", "/Type": "/Outline" } }, @@ -1084,7 +1144,7 @@ null ], "/Parent": "101 0 R", - "/Title": "Isosicle 1.1.2.1 -> 22: /XYZ null null null", + "/Title": "u:Isosicle 1.1.2.1 -> 22: /XYZ null null null", "/Type": "/Outline" } }, @@ -1100,7 +1160,7 @@ ], "/Next": "106 0 R", "/Parent": "99 0 R", - "/Title": "Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770", + "/Title": "u:Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770", "/Type": "/Outline" } }, @@ -1115,7 +1175,7 @@ ], "/Parent": "99 0 R", "/Prev": "105 0 R", - "/Title": "Trepsicle 1.2.2 -> 0: /XYZ null null null", + "/Title": "u:Trepsicle 1.2.2 -> 0: /XYZ null null null", "/Type": "/Outline" } }, diff --git a/qpdf/qtest/qpdf/json-page-labels-and-outlines-v2.out b/qpdf/qtest/qpdf/json-page-labels-and-outlines-v2.out index 43becdf5..349b8b68 100644 --- a/qpdf/qtest/qpdf/json-page-labels-and-outlines-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-and-outlines-v2.out @@ -10,7 +10,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "3 0 R", @@ -35,7 +35,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "4 0 R", @@ -138,7 +138,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "10 0 R", @@ -151,7 +151,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 2 }, "object": "11 0 R", @@ -190,7 +190,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "14 0 R", @@ -358,7 +358,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "22 0 R", @@ -524,7 +524,7 @@ { "index": 0, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -538,7 +538,7 @@ { "index": 7, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -552,7 +552,7 @@ { "index": 11, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -573,7 +573,7 @@ { "index": 19, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -616,8 +616,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -805,7 +805,7 @@ "/Nums": [ 0, { - "/P": "" + "/P": "u:" }, 2, { @@ -814,7 +814,7 @@ }, 7, { - "/P": "" + "/P": "u:" }, 9, { @@ -823,7 +823,7 @@ }, 11, { - "/P": "" + "/P": "u:" }, 12, { @@ -837,7 +837,7 @@ }, 19, { - "/P": "" + "/P": "u:" }, 20, { @@ -1811,7 +1811,7 @@ "/Last": "99 0 R", "/Next": "97 0 R", "/Parent": "95 0 R", - "/Title": "Isís 1 -> 5: /XYZ null null null", + "/Title": "u:Isís 1 -> 5: /XYZ null null null", "/Type": "/Outline" } }, @@ -1826,7 +1826,7 @@ ], "/Parent": "95 0 R", "/Prev": "96 0 R", - "/Title": "Trepak 2 -> 15: /XYZ 66 756 3", + "/Title": "u:Trepak 2 -> 15: /XYZ 66 756 3", "/Type": "/Outline" } }, @@ -1841,7 +1841,7 @@ "/Last": "101 0 R", "/Next": "99 0 R", "/Parent": "96 0 R", - "/Title": "Amanda 1.1 -> 11: /Fit", + "/Title": "u:Amanda 1.1 -> 11: /Fit", "/Type": "/Outline" } }, @@ -1857,7 +1857,7 @@ "/Last": "106 0 R", "/Parent": "96 0 R", "/Prev": "98 0 R", - "/Title": "Sandy ÷Σανδι÷ 1.2 -> 13: /FitH 792", + "/Title": "u:Sandy ÷Σανδι÷ 1.2 -> 13: /FitH 792", "/Type": "/Outline" } }, @@ -1873,7 +1873,7 @@ "/Last": "103 0 R", "/Next": "101 0 R", "/Parent": "98 0 R", - "/Title": "Isosicle 1.1.1 -> 12: /FitV 100", + "/Title": "u:Isosicle 1.1.1 -> 12: /FitV 100", "/Type": "/Outline" } }, @@ -1891,7 +1891,7 @@ "/Last": "104 0 R", "/Parent": "98 0 R", "/Prev": "100 0 R", - "/Title": "Isosicle 1.1.2 -> 12: /XYZ null null null", + "/Title": "u:Isosicle 1.1.2 -> 12: /XYZ null null null", "/Type": "/Outline" } }, @@ -1906,7 +1906,7 @@ ], "/Next": "103 0 R", "/Parent": "100 0 R", - "/Title": "Isosicle 1.1.1.1 -> 18: /XYZ null null null", + "/Title": "u:Isosicle 1.1.1.1 -> 18: /XYZ null null null", "/Type": "/Outline" } }, @@ -1921,7 +1921,7 @@ ], "/Parent": "100 0 R", "/Prev": "102 0 R", - "/Title": "Isosicle 1.1.1.2 -> 19: /XYZ null null null", + "/Title": "u:Isosicle 1.1.1.2 -> 19: /XYZ null null null", "/Type": "/Outline" } }, @@ -1935,7 +1935,7 @@ null ], "/Parent": "101 0 R", - "/Title": "Isosicle 1.1.2.1 -> 22: /XYZ null null null", + "/Title": "u:Isosicle 1.1.2.1 -> 22: /XYZ null null null", "/Type": "/Outline" } }, @@ -1951,7 +1951,7 @@ ], "/Next": "106 0 R", "/Parent": "99 0 R", - "/Title": "Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770", + "/Title": "u:Trepsichord 1.2.1 -> 1: /FitR 66 714 180 770", "/Type": "/Outline" } }, @@ -1966,7 +1966,7 @@ ], "/Parent": "99 0 R", "/Prev": "105 0 R", - "/Title": "Trepsicle 1.2.2 -> 0: /XYZ null null null", + "/Title": "u:Trepsicle 1.2.2 -> 0: /XYZ null null null", "/Type": "/Outline" } }, diff --git a/qpdf/qtest/qpdf/json-page-labels-num-tree-v2.out b/qpdf/qtest/qpdf/json-page-labels-num-tree-v2.out index 5fe008d6..acff306a 100644 --- a/qpdf/qtest/qpdf/json-page-labels-num-tree-v2.out +++ b/qpdf/qtest/qpdf/json-page-labels-num-tree-v2.out @@ -36,7 +36,7 @@ ], "images": [], "label": { - "/P": "blank", + "/P": "u:blank", "/St": 1 }, "object": "8 0 R", @@ -49,7 +49,7 @@ ], "images": [], "label": { - "/P": "X-", + "/P": "u:X-", "/S": "/A", "/St": 17 }, @@ -63,7 +63,7 @@ ], "images": [], "label": { - "/P": "X-", + "/P": "u:X-", "/S": "/A", "/St": 18 }, @@ -77,7 +77,7 @@ ], "images": [], "label": { - "/P": "", + "/P": "u:", "/St": 1 }, "object": "11 0 R", @@ -207,7 +207,7 @@ ], "images": [], "label": { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 6 }, @@ -221,7 +221,7 @@ ], "images": [], "label": { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 7 }, @@ -235,7 +235,7 @@ ], "images": [], "label": { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 8 }, @@ -249,7 +249,7 @@ ], "images": [], "label": { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 9 }, @@ -263,7 +263,7 @@ ], "images": [], "label": { - "/P": "www", + "/P": "u:www", "/St": 1 }, "object": "25 0 R", @@ -412,14 +412,14 @@ { "index": 2, "label": { - "/P": "blank", + "/P": "u:blank", "/St": 1 } }, { "index": 3, "label": { - "/P": "X-", + "/P": "u:X-", "/S": "/A", "/St": 17 } @@ -427,7 +427,7 @@ { "index": 5, "label": { - "/P": "", + "/P": "u:", "/St": 1 } }, @@ -462,7 +462,7 @@ { "index": 15, "label": { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 6 } @@ -470,7 +470,7 @@ { "index": 19, "label": { - "/P": "www", + "/P": "u:www", "/St": 1 } }, @@ -513,8 +513,8 @@ "capabilities": { "accessibility": true, "extract": true, - "moddifyannotations": true, "modify": true, + "modifyannotations": true, "modifyassembly": true, "modifyforms": true, "modifyother": true, @@ -1219,17 +1219,17 @@ }, 2, { - "/P": "blank" + "/P": "u:blank" }, 3, { - "/P": "X-", + "/P": "u:X-", "/S": "/A", "/St": 17 }, 5, { - "/P": "" + "/P": "u:" }, 6, { @@ -1261,13 +1261,13 @@ }, 15, { - "/P": "q.", + "/P": "u:q.", "/S": "/D", "/St": 6 }, 19, { - "/P": "www" + "/P": "u:www" } ] } @@ -1590,8 +1590,8 @@ "trailer": { "value": { "/ID": [ - "’ùˇÞxtó¼\\·¯½˚Ł7»", - "\rþ˘©LÞ\u000fKýÈl\u0003¯ˇ\u0001\u000e" + "b:90f919de7874f3bc5cb7afbd1e9537bb", + "b:0dfe18a94cde0f4bfdc86c03af19010e" ], "/Root": "1 0 R", "/Size": 100 diff --git a/qpdf/qtest/qpdf/page_api_2-json-objects.out b/qpdf/qtest/qpdf/page_api_2-json-objects.out index 3fc137ac..b686d143 100644 --- a/qpdf/qtest/qpdf/page_api_2-json-objects.out +++ b/qpdf/qtest/qpdf/page_api_2-json-objects.out @@ -3,161 +3,115 @@ "parameters": { "decodelevel": "generalized" }, - "objects": { - "1 0 R": { - "/Pages": "3 0 R", - "/Type": "/Catalog" - }, - "2 0 R": { - "/CreationDate": "u:D:20120621124041", - "/Producer": "u:Apex PDFWriter" - }, - "3 0 R": { - "/Count": 3, - "/Kids": [ - "4 0 R", - "4 0 R", - "5 0 R" - ], - "/Type": "/Pages" - }, - "4 0 R": { - "/Contents": "6 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "3 0 R", - "/Resources": { - "/Font": { - "/F1": "8 0 R" - }, - "/ProcSet": [ - "/PDF", - "/Text" - ] + "qpdf": { + "jsonversion": 2, + "pdfversion": "1.3", + "objects": { + "obj:1 0 R": { + "value": { + "/Pages": "3 0 R", + "/Type": "/Catalog" + } }, - "/Type": "/Page" - }, - "5 0 R": { - "/Contents": "9 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "3 0 R", - "/Resources": { - "/Font": { - "/F1": "8 0 R" - }, - "/ProcSet": [ - "/PDF", - "/Text" - ] + "obj:2 0 R": { + "value": { + "/CreationDate": "u:D:20120621124041", + "/Producer": "u:Apex PDFWriter" + } }, - "/Type": "/Page" - }, - "6 0 R": { - "dict": { - "/Length": "7 0 R" - } - }, - "7 0 R": 47, - "8 0 R": { - "/BaseFont": "/Times-Roman", - "/Encoding": "/WinAnsiEncoding", - "/Subtype": "/Type1", - "/Type": "/Font" - }, - "9 0 R": { - "dict": { - "/Length": "10 0 R" - } - }, - "10 0 R": 47, - "trailer": { - "/ID": [ - "b:fb18b786ff7b358705da8a532aba8f6f", - "b:f7179eb35159bfd4c00f128abcfd1f02" - ], - "/Info": "2 0 R", - "/Root": "1 0 R", - "/Size": 11 - } - }, - "objectinfo": { - "1 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "2 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "3 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "4 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "5 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "6 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 47 - } - }, - "7 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "8 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "9 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 47 - } - }, - "10 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null + "obj:3 0 R": { + "value": { + "/Count": 3, + "/Kids": [ + "4 0 R", + "4 0 R", + "5 0 R" + ], + "/Type": "/Pages" + } + }, + "obj:4 0 R": { + "value": { + "/Contents": "6 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "3 0 R", + "/Resources": { + "/Font": { + "/F1": "8 0 R" + }, + "/ProcSet": [ + "/PDF", + "/Text" + ] + }, + "/Type": "/Page" + } + }, + "obj:5 0 R": { + "value": { + "/Contents": "9 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "3 0 R", + "/Resources": { + "/Font": { + "/F1": "8 0 R" + }, + "/ProcSet": [ + "/PDF", + "/Text" + ] + }, + "/Type": "/Page" + } + }, + "obj:6 0 R": { + "stream": { + "dict": { + "/Length": "7 0 R" + } + } + }, + "obj:7 0 R": { + "value": 47 + }, + "obj:8 0 R": { + "value": { + "/BaseFont": "/Times-Roman", + "/Encoding": "/WinAnsiEncoding", + "/Subtype": "/Type1", + "/Type": "/Font" + } + }, + "obj:9 0 R": { + "stream": { + "dict": { + "/Length": "10 0 R" + } + } + }, + "obj:10 0 R": { + "value": 47 + }, + "trailer": { + "value": { + "/ID": [ + "b:fb18b786ff7b358705da8a532aba8f6f", + "b:f7179eb35159bfd4c00f128abcfd1f02" + ], + "/Info": "2 0 R", + "/Root": "1 0 R", + "/Size": 11 + } } } } diff --git a/qpdf/qtest/qpdf/page_api_2-json-pages.out b/qpdf/qtest/qpdf/page_api_2-json-pages.out index c4b7632c..8e6f94b0 100644 --- a/qpdf/qtest/qpdf/page_api_2-json-pages.out +++ b/qpdf/qtest/qpdf/page_api_2-json-pages.out @@ -35,188 +35,137 @@ "pageposfrom1": 3 } ], - "objects": { - "1 0 R": { - "/Pages": "3 0 R", - "/Type": "/Catalog" - }, - "2 0 R": { - "/CreationDate": "u:D:20120621124041", - "/Producer": "u:Apex PDFWriter" - }, - "3 0 R": { - "/Count": 3, - "/Kids": [ - "4 0 R", - "11 0 R", - "5 0 R" - ], - "/Type": "/Pages" - }, - "4 0 R": { - "/Contents": "6 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "3 0 R", - "/Resources": { - "/Font": { - "/F1": "8 0 R" - }, - "/ProcSet": [ - "/PDF", - "/Text" - ] + "qpdf": { + "jsonversion": 2, + "pdfversion": "1.3", + "objects": { + "obj:1 0 R": { + "value": { + "/Pages": "3 0 R", + "/Type": "/Catalog" + } }, - "/Type": "/Page" - }, - "5 0 R": { - "/Contents": "9 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "3 0 R", - "/Resources": { - "/Font": { - "/F1": "8 0 R" - }, - "/ProcSet": [ - "/PDF", - "/Text" - ] + "obj:2 0 R": { + "value": { + "/CreationDate": "u:D:20120621124041", + "/Producer": "u:Apex PDFWriter" + } }, - "/Type": "/Page" - }, - "6 0 R": { - "dict": { - "/Length": "7 0 R" - } - }, - "7 0 R": 47, - "8 0 R": { - "/BaseFont": "/Times-Roman", - "/Encoding": "/WinAnsiEncoding", - "/Subtype": "/Type1", - "/Type": "/Font" - }, - "9 0 R": { - "dict": { - "/Length": "10 0 R" - } - }, - "10 0 R": 47, - "11 0 R": { - "/Contents": "6 0 R", - "/MediaBox": [ - 0, - 0, - 612, - 792 - ], - "/Parent": "3 0 R", - "/Resources": { - "/Font": { - "/F1": "8 0 R" - }, - "/ProcSet": [ - "/PDF", - "/Text" - ] + "obj:3 0 R": { + "value": { + "/Count": 3, + "/Kids": [ + "4 0 R", + "11 0 R", + "5 0 R" + ], + "/Type": "/Pages" + } }, - "/Type": "/Page" - }, - "trailer": { - "/ID": [ - "b:fb18b786ff7b358705da8a532aba8f6f", - "b:f7179eb35159bfd4c00f128abcfd1f02" - ], - "/Info": "2 0 R", - "/Root": "1 0 R", - "/Size": 11 - } - }, - "objectinfo": { - "1 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "2 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "3 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "4 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "5 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "6 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 47 - } - }, - "7 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "8 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "9 0 R": { - "stream": { - "filter": null, - "is": true, - "length": 47 - } - }, - "10 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null - } - }, - "11 0 R": { - "stream": { - "filter": null, - "is": false, - "length": null + "obj:4 0 R": { + "value": { + "/Contents": "6 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "3 0 R", + "/Resources": { + "/Font": { + "/F1": "8 0 R" + }, + "/ProcSet": [ + "/PDF", + "/Text" + ] + }, + "/Type": "/Page" + } + }, + "obj:5 0 R": { + "value": { + "/Contents": "9 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "3 0 R", + "/Resources": { + "/Font": { + "/F1": "8 0 R" + }, + "/ProcSet": [ + "/PDF", + "/Text" + ] + }, + "/Type": "/Page" + } + }, + "obj:6 0 R": { + "stream": { + "dict": { + "/Length": "7 0 R" + } + } + }, + "obj:7 0 R": { + "value": 47 + }, + "obj:8 0 R": { + "value": { + "/BaseFont": "/Times-Roman", + "/Encoding": "/WinAnsiEncoding", + "/Subtype": "/Type1", + "/Type": "/Font" + } + }, + "obj:9 0 R": { + "stream": { + "dict": { + "/Length": "10 0 R" + } + } + }, + "obj:10 0 R": { + "value": 47 + }, + "obj:11 0 R": { + "value": { + "/Contents": "6 0 R", + "/MediaBox": [ + 0, + 0, + 612, + 792 + ], + "/Parent": "3 0 R", + "/Resources": { + "/Font": { + "/F1": "8 0 R" + }, + "/ProcSet": [ + "/PDF", + "/Text" + ] + }, + "/Type": "/Page" + } + }, + "trailer": { + "value": { + "/ID": [ + "b:fb18b786ff7b358705da8a532aba8f6f", + "b:f7179eb35159bfd4c00f128abcfd1f02" + ], + "/Info": "2 0 R", + "/Root": "1 0 R", + "/Size": 11 + } } } } -- cgit v1.2.3-70-g09d2