Commit 66efa438bc228fbf937da84b2ca3be374125095f
1 parent
e848395d
Document new `inspection_mode` in design and release notes
Add details about the new `qpdf::global::inspection_mode` method to the design document, explaining its purpose, functionality, and limitations. Update release notes to highlight its introduction and describe the changes it brings for inspecting and repairing damaged PDF files.
Showing
2 changed files
with
41 additions
and
1 deletions
manual/design.rst
| @@ -35,6 +35,38 @@ behind the initial creation of qpdf. That said, qpdf is not a strict | @@ -35,6 +35,38 @@ behind the initial creation of qpdf. That said, qpdf is not a strict | ||
| 35 | PDF checker. There are many ways in which a PDF file can be out of | 35 | PDF checker. There are many ways in which a PDF file can be out of |
| 36 | conformance to the spec that qpdf doesn't notice or report. | 36 | conformance to the spec that qpdf doesn't notice or report. |
| 37 | 37 | ||
| 38 | +.. _inspection-mode: | ||
| 39 | + | ||
| 40 | +Inspection Mode | ||
| 41 | +--------------- | ||
| 42 | + | ||
| 43 | +The approach as described above has shifted somewhat over time for | ||
| 44 | +pragmatic reasons. A large number of essential repairs that can be | ||
| 45 | +carried out safely are now happening even with ``setAttemptRecovery(false)``. | ||
| 46 | +At the same time a number of minor infractions of the PDF standards are quietly | ||
| 47 | +dealt with to avoid creating distracting noise. This has been helpful to users | ||
| 48 | +who use qpdf to perform content-preserving transformations and who usually | ||
| 49 | +want qpdf to work reliably and to produce correct PDF output files that comply | ||
| 50 | +with the PDF standards even if the input files are somewhat less than perfect. | ||
| 51 | + | ||
| 52 | +However, there is another stated purpose of qpdf - to provide a tool for the | ||
| 53 | +study and analysis of PDF files. When used in this way, repairing the faults | ||
| 54 | +in input files or preventing the creation of unusable output files, often with | ||
| 55 | +unacceptable resource usage, is counter-productive rather than useful. | ||
| 56 | + | ||
| 57 | +To accommodate the needs of those who use qpdf as a tool for inspecting and | ||
| 58 | +investigating PDF files, qpdf version 12.3 introduced a special | ||
| 59 | +``ìnspection mode`` which is enabled using the | ||
| 60 | +``qpdf::global::options::inspection_mode`` function. In inspection mode, only a | ||
| 61 | +very limited set of basic operations is supported and a number of automatic | ||
| 62 | +repairs are disabled. Transformations of the input files such as linearizing files, | ||
| 63 | +creating object streams or encrypting files are not supported, as is the use of | ||
| 64 | +document and object helpers. | ||
| 65 | + | ||
| 66 | +Inspection mode is intended for manual investigations and repairs. As such, | ||
| 67 | +stability is less of a concern than for other uses of qpdf. The exact effect | ||
| 68 | +of specifying inspection mode will evolve from version to version. | ||
| 69 | + | ||
| 38 | .. _design-goals: | 70 | .. _design-goals: |
| 39 | 71 | ||
| 40 | Design Goals | 72 | Design Goals |
manual/release-notes.rst
| @@ -91,6 +91,14 @@ more detail. | @@ -91,6 +91,14 @@ more detail. | ||
| 91 | 91 | ||
| 92 | - Other enhancements | 92 | - Other enhancements |
| 93 | 93 | ||
| 94 | + - Add new ``inspection mode`` to help with the inspection and manual repair | ||
| 95 | + of damaged PDF files. In this mode some of the exceptions thrown if a PDF | ||
| 96 | + file is damaged and unrepairable are replaced with warnings and some automatic | ||
| 97 | + repairs are suppressed. Only a very limited range of operations are supported. | ||
| 98 | + Inspection mode is selected with the new function | ||
| 99 | + ``qpdf::global::options::inspection_mode``. For more detail see | ||
| 100 | + :ref:`inspection-mode`. | ||
| 101 | + | ||
| 94 | - ``QPDFWriter`` will no longer add filters when writing empty streams. | 102 | - ``QPDFWriter`` will no longer add filters when writing empty streams. |
| 95 | 103 | ||
| 96 | - More sanity checks have been added when files with damaged xref tables | 104 | - More sanity checks have been added when files with damaged xref tables |
| @@ -123,7 +131,7 @@ more detail. | @@ -123,7 +131,7 @@ more detail. | ||
| 123 | is the intended behaviour. | 131 | is the intended behaviour. |
| 124 | 132 | ||
| 125 | - There has been some refactoring of stream filtering. These are optimized | 133 | - There has been some refactoring of stream filtering. These are optimized |
| 126 | - for the common case where no user provided stream filters are | 134 | + for the common case where no user provided stream filters are |
| 127 | registered by calling ``QPDF::registerStreamFilter``. If you are | 135 | registered by calling ``QPDF::registerStreamFilter``. If you are |
| 128 | providing your own stream filters please open a ticket_. | 136 | providing your own stream filters please open a ticket_. |
| 129 | 137 |