-
When there is no context for writing output or error messages, use the default logger.
-
This includes the output PDF, streams from --show-object and attachments from --save-attachment. This also enables --verbose and --progress to work with saving to stdout.
-
Remove variables obsoleted by commit 4f24617.
-
* native UTF-8 strings * names whose PDF and canonical syntax differ in both dictionary key positions and other positions For json, names are converted both as names and directly when used as dictionary keys.
-
* Replace --create-from-json=file with --json-input, which causes the regular input to be treated as json. * Eliminate --to-json * In --json=2, bring back "objects" and eliminate "objectinfo". Stream data is never present. * In --json-output=2, write "qpdf-v2" with "objects" and include stream data.
-
I decided these were confusing and inconsistent with how JSON works. They muddle the API rather than improving it.
-
The last offset is irrelevant to not being able to find /Root.
-
This makes it a lot easier to run parts of the test suite.
-
There is one unexpected pass in this commit. This script was applied to the files changed in this commit: ---------- #!/usr/bin/env python3 import json import sys 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()) data['version'] = 2 objectinfo = {} if 'objectinfo' in data: objectinfo = data['objectinfo'] del data['objectinfo'] if 'objects' not in data: continue qpdf = {'jsonversion': 2, 'pdfversion': '1.3', 'objects': {}} for k, v in data['objects'].items(): is_stream = objectinfo.get(k, {}).get('stream', {}).get('is', False) if k.endswith(' R'): k = 'obj:' + k if is_stream: v = {'stream': {'dict': v}} else: v = {'value': v} qpdf['objects'][k] = v data['qpdf'] = qpdf del data['objects'] print(json_dumps(data)) ---------- -
moddify -> modify. Also carefully spell checked all remaining keys by splitting them into words and running a spell checker, not just relying on visual proofreading. That was the only one.
-
Not fully exercised in this commit
-
Also refine the herustic for deciding whether to use hexadecimal notation for a string.
-
Update getJSON() methods and calls to them