From 8b25de24c9b1e6acba042ea9ecdee783839e20a6 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Wed, 4 May 2022 07:32:30 -0400 Subject: Make "objects" and "pages" consistent in JSON output --- manual/json.rst | 10 ++++++++++ manual/release-notes.rst | 7 +++++++ 2 files changed, 17 insertions(+) (limited to 'manual') diff --git a/manual/json.rst b/manual/json.rst index 358cac90..ef6bed96 100644 --- a/manual/json.rst +++ b/manual/json.rst @@ -147,6 +147,16 @@ For the most part, the built-in JSON help tells you everything you need to know about the JSON format, but there are a few non-obvious things to be aware of: +- If a PDF file has certain types of errors in its pages tree (such as + page objects that are direct or multiple pages sharing the same + object ID), qpdf will automatically repair the pages tree. If you + specify ``"objects"`` and/or ``"objectinfo"`` without any other + keys, you will see the original pages tree without any corrections. + If you specify any of keys that require page tree traversal (for + example, ``"pages"``, ``"outlines"``, or ``"pagelabel"``), then + ``"objects"`` and ``"objectinfo"`` will show the repaired page tree + so that object references will be consistent throughout the file. + - While qpdf guarantees that keys present in the help will be present in the output, those fields may be null or empty if the information is not known or absent in the file. Also, if you specify diff --git a/manual/release-notes.rst b/manual/release-notes.rst index 08e2fd52..f313cd82 100644 --- a/manual/release-notes.rst +++ b/manual/release-notes.rst @@ -125,6 +125,13 @@ For a detailed list of changes, please see the file - Other changes + - In JSON v1 mode, the ``"objects"`` key now reflects the repaired + pages tree if ``"pages"`` (or any other key that has the side + effect of repairing the page tree) is specified. To see the + original objects with any unrepaired page tree errors, specify + ``"objects"`` and/or ``"objectinfo"`` by themselves. This is + consistent with how JSON v2 behaves. + - A new chapter on contributing to qpdf has been added to the documentation. See :ref:`contributing`. -- cgit v1.2.3-70-g09d2