mirror of
https://github.com/qpdf/qpdf.git
synced 2024-12-23 11:28:56 +00:00
a9fbbd5dca
This script was used on test data: ---------- #!/usr/bin/env python3 import json import sys import re def json_dumps(data): return json.dumps(data, ensure_ascii=False, indent=2, separators=(',', ': ')) for filename in sys.argv[1:]: with open(filename, 'r') as f: data = json.loads(f.read()) if 'objectinfo' not in data: continue trailer = None to_sort = [] for k, v in data['objectinfo'].items(): if k == 'trailer': trailer = v else: m = re.match(r'^(\d+) \d+ R', k) if m: to_sort.append([int(m.group(1)), k, v]) newobjectinfo = {x[1]: x[2] for x in sorted(to_sort)} if trailer is not None: newobjectinfo['trailer'] = trailer data['objectinfo'] = newobjectinfo print(json_dumps(data)) ---------- |
||
---|---|---|
.. | ||
qtest | ||
CMakeLists.txt | ||
fix-qdf.cc | ||
pdf_from_scratch.cc | ||
qpdf-ctest.c | ||
qpdf.cc | ||
qpdf.testcov | ||
qpdfjob-ctest.c | ||
sizes.cc | ||
test_driver.cc | ||
test_large_file.cc | ||
test_parsedoffset.cc | ||
test_pdf_doc_encoding.cc | ||
test_pdf_unicode.cc | ||
test_renumber.cc | ||
test_shell_glob.cc | ||
test_tokenizer.cc | ||
test_unicode_filenames.cc | ||
test_xref.cc |