From 9a5d16a4039bd92024e57a2e00ffb5ec5a62adc4 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Sat, 11 Dec 2021 16:51:23 -0500 Subject: Prepare for docbook -> rst: replace SGML entitles We were using SGML entities for various non-ASCII characters so they could convert properly for both HTML and print, but this is no longer necessary as we move from docbook to RST, so just replace them. Note that the conversions done by sphinx automatically handle "smart quotes", so it works to just use regular quotes in place of &LDQUO; and &RDQUO;. --- TODO | 6 --- manual/qpdf-manual.xml | 127 ++++++++++++++++++++++++------------------------- 2 files changed, 61 insertions(+), 72 deletions(-) diff --git a/TODO b/TODO index 80f42e52..5b30f9f0 100644 --- a/TODO +++ b/TODO @@ -25,12 +25,6 @@ Things to fix: Entities/Unicode (not needed) - - - - - - -> |release| Elements: diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml index 13619c69..1a543c23 100644 --- a/manual/qpdf-manual.xml +++ b/manual/qpdf-manual.xml @@ -1,10 +1,5 @@ - - - - ]> @@ -265,7 +260,7 @@ make Starting with qpdf 9.1.0, the qpdf library can be built with multiple implementations of providers of cryptographic functions, - which we refer to as “crypto providers.” At the time + which we refer to as "crypto providers." At the time of writing, a crypto implementation must provide MD5 and SHA2 (256, 384, and 512-bit) hashes and RC4 and AES256 with and without CBC encryption. In the future, if digital signature is added to @@ -588,7 +583,7 @@ make @1@option@1@outfilename@2@option@2@ does not have to be seekable, even when generating linearized files. Specifying - “@1@option@1@-@2@option@2@” as @1@option@1@outfilename@2@option@2@ + "@1@option@1@-@2@option@2@" as @1@option@1@outfilename@2@option@2@ means to write to standard output. If you want to overwrite the input file with the output, use the option @1@option@1@--replace-input@2@option@2@ and omit the output file name. @@ -1249,7 +1244,7 @@ make @1@option@1@--encrypt @1@replaceable@1@user-password@2@replaceable@2@ @1@replaceable@1@owner-password@2@replaceable@2@ @1@replaceable@1@key-length@2@replaceable@2@ [ @1@replaceable@1@restrictions@2@replaceable@2@ ] --@2@option@2@ - Note that “@1@option@1@--@2@option@2@” terminates parsing of + Note that "@1@option@1@--@2@option@2@" terminates parsing of encryption flags and must be present even if no restrictions are present. @@ -1548,12 +1543,12 @@ make Multiple input files may be specified. Each one is given as the name of the input file, an optional password (if required to open the file), and the range of pages. Note that - “@1@option@1@--@2@option@2@” terminates parsing of page + "@1@option@1@--@2@option@2@" terminates parsing of page selection flags. Starting with qpf 8.4, the special input file name - “@1@filename@1@.@2@filename@2@” can be used as a shortcut for the + "@1@filename@1@.@2@filename@2@" can be used as a shortcut for the primary input filename. @@ -1581,8 +1576,8 @@ make The page range is a set of numbers separated by commas, ranges of numbers separated dashes, or combinations of those. The character - “z” represents the last page. A number preceded by an - “r” indicates to count from the end, so + "z" represents the last page. A number preceded by an + "r" indicates to count from the end, so r3-r1 would be the last three pages of the document. Pages can appear in any order. Ranges can appear with a high number followed by a low number, which causes the pages to @@ -1635,7 +1630,7 @@ make Starting in qpdf version 8.3, you can specify the @1@option@1@--collate@2@option@2@ option. Note that this option is - specified outside of @1@option@1@--pages ... --@2@option@2@. + specified outside of @1@option@1@--pages ... --@2@option@2@. When @1@option@1@--collate@2@option@2@ is specified, it changes the meaning of @1@option@1@--pages@2@option@2@ so that the specified files, as modified by page ranges, are collated rather than concatenated. @@ -1711,8 +1706,8 @@ make @1@command@1@qpdf@2@command@2@ @1@option@1@--empty --pages infile.pdf 1-5 -- outfile.pdf@2@option@2@ - If you wanted to take pages 1–5 from - @1@filename@1@file1.pdf@2@filename@2@ and pages 11–15 from + If you wanted to take pages 1 through 5 from + @1@filename@1@file1.pdf@2@filename@2@ and pages 11 through 15 from @1@filename@1@file2.pdf@2@filename@2@ in reverse, taking document-level metadata from @1@filename@1@file2.pdf@2@filename@2@, you would run @@ -1809,7 +1804,7 @@ outfile.pdf@2@option@2@ @1@option@1@--repeat=page-range@2@option@2@: an optional range of pages that specifies which pages in the overlay/underlay file - will be repeated after the “from” pages are used + will be repeated after the "from" pages are used up. If you want to repeat a range of pages starting at the beginning, you can explicitly use @1@option@1@--from=@2@option@2@. @@ -1850,7 +1845,7 @@ outfile.pdf@2@option@2@ @1@option@1@--list-attachments@2@option@2@ - Show the “key” and stream number for embedded + Show the "key" and stream number for embedded files. With @1@option@1@--verbose@2@option@2@, additional information, including preferred file name, description, dates, and more are also displayed. The key is usually but not @@ -2447,8 +2442,8 @@ outfile.pdf@2@option@2@ For text fields and list boxes, any characters that fall - outside of US-ASCII or, if detected, “Windows - ANSI” or “Mac Roman” encoding, will be + outside of US-ASCII or, if detected, "Windows + ANSI" or "Mac Roman" encoding, will be replaced by the ? character. @@ -2529,7 +2524,7 @@ outfile.pdf@2@option@2@ Avoid optimizing images whose pixel count - (width × height) is below the specified amount. If + (width × height) is below the specified amount. If omitted, the default is 16,384 pixels. Use 0 for no minimum. @@ -2661,7 +2656,7 @@ outfile.pdf@2@option@2@ streams. This is generally safe but could, in some cases, cause damage to the content streams. This option is intended for people who wish to study PDF content streams or to debug PDF content. - You should not use this for “production” PDF files. + You should not use this for "production" PDF files. When normalizing content, if qpdf runs into any lexical errors, it @@ -2841,7 +2836,7 @@ outfile.pdf@2@option@2@ Show the contents of the given object. This is especially useful for inspecting objects that are inside of object - streams (also known as “compressed objects”). + streams (also known as "compressed objects"). @@ -2934,7 +2929,7 @@ outfile.pdf@2@option@2@ This option is repeatable. If specified, only specified objects will be shown in the - “objects” key of the JSON + "objects" key of the JSON output. If absent, all objects will be shown. @@ -2952,7 +2947,7 @@ outfile.pdf@2@option@2@ conditions that @1@option@1@--check@2@option@2@ detects. These are issued as warnings instead of errors. If qpdf finds no errors but finds warnings, it will exit with a status of 3 (as of - version 2.0.4). When @1@option@1@--check@2@option@2@ is combined + version 2.0.4). When @1@option@1@--check@2@option@2@ is combined with other options, checks are always performed before any other options are processed. For erroneous files, @1@option@1@--check@2@option@2@ will cause qpdf to attempt to @@ -3300,10 +3295,10 @@ outfile.pdf@2@option@2@ - “C” + "C" - The qpdf library includes a “C” language interface + The qpdf library includes a "C" language interface that provides a subset of the overall capabilities. The header file @1@filename@1@qpdf/qpdf-c.h@2@filename@2@ includes information about its use. As long as you use a C++ linker, you can link C @@ -3451,7 +3446,7 @@ outfile.pdf@2@option@2@ The top-level JSON structure contains a - “version” key whose value is + "version" key whose value is simple integer. The value of the version key will be incremented if a non-compatible change is made. A non-compatible change would be any change that involves removal @@ -3507,10 +3502,10 @@ outfile.pdf@2@option@2@ For example, the help output indicates includes a - “pagelabels” key whose value is + "pagelabels" key whose value is an array of one element. That element is a dictionary with keys - “index” and - “label”. In addition to + "index" and + "label". In addition to describing the meaning of those keys, this tells you that the actual JSON output will contain a pagelabels array, each of whose elements is a dictionary that contains an @@ -3546,7 +3541,7 @@ outfile.pdf@2@option@2@ Strings, names, and indirect object references in the original PDF file are all converted to strings in the JSON - representation. In the case of a “normal” PDF file, + representation. In the case of a "normal" PDF file, you can tell the difference because a name starts with a slash (/), and an indirect object reference looks like n n R, but if there were to be a string @@ -3631,11 +3626,11 @@ outfile.pdf@2@option@2@ The image information included in the page section of the JSON output includes the key - “filterable”. Note that the + "filterable". Note that the value of this field may depend on the @1@option@1@--decode-level@2@option@2@ that you invoke qpdf with. The JSON output includes a top-level key - “parameters” that indicates the + "parameters" that indicates the decode level used for computing whether a stream was filterable. For example, jpeg images will be shown as not filterable by default, but they will be shown as filterable if @@ -3674,8 +3669,8 @@ outfile.pdf@2@option@2@ is to generating warnings for recoverable problems. Note that recovery will not always produce the desired results even if it is able to get through the file. Unlike most other PDF files that - produce generic warnings such as “This file is - damaged,”, qpdf generally issues a detailed error message + produce generic warnings such as "This file is + damaged,", qpdf generally issues a detailed error message that would be most useful to a PDF developer. This is by design as there seems to be a shortage of PDF validation tools out there. This was, in fact, one of the major motivations behind the initial @@ -3918,7 +3913,7 @@ outfile.pdf@2@option@2@ Prior to qpdf version 8.1, higher level interfaces were added as - “convenience functions” in either + "convenience functions" in either QPDF or QPDFObjectHandle. For compatibility, older convenience functions for operating with pages will remain in @@ -3954,7 +3949,7 @@ outfile.pdf@2@option@2@ immediately constructed from the single token and the parser returns. Otherwise, the parser iterates in a special mode in which it accumulates objects until it finds a balancing closer. During - this process, the “R” keyword is + this process, the "R" keyword is recognized and an indirect QPDFObjectHandle may be constructed. @@ -4008,7 +4003,7 @@ outfile.pdf@2@option@2@ - The parser sees “<<”, so + The parser sees "<<", so it calls itself recursively in dictionary creation mode. @@ -4016,13 +4011,13 @@ outfile.pdf@2@option@2@ In dictionary creation mode, the parser keeps accumulating objects until it encounters - “>>”. Each object that is + ">>". Each object that is read is pushed onto a stack. If - “R” is read, the last two + "R" is read, the last two objects on the stack are inspected. If they are integers, they are popped off the stack and their values are used to construct an indirect object handle which is then pushed onto the stack. - When “>>” is finally read, + When ">>" is finally read, the stack is converted into a QPDF_Dictionary which is placed in a QPDFObjectHandle and returned. @@ -4296,7 +4291,7 @@ outfile.pdf@2@option@2@ other after adding them. Now it is possible to create a @1@firstterm@1@reserved object@2@firstterm@2@ using QPDFObjectHandle::newReserved. This is an - indirect object that stays “unresolved” even if it is + indirect object that stays "unresolved" even if it is queried for its type. So now, if you want to create a set of mutually referential objects, you can create reservations for each one of them and use those reservations to construct the @@ -4317,7 +4312,7 @@ outfile.pdf@2@option@2@ QPDF object from a different QPDF object, which we refer to as @1@firstterm@1@foreign objects@2@firstterm@2@. This allows arbitrary - merging of PDF files. The “from” + merging of PDF files. The "from" QPDF object must remain valid after the copy as discussed in the note below. The @1@command@1@qpdf@2@command@2@ command-line tool provides limited support for basic page @@ -4371,7 +4366,7 @@ outfile.pdf@2@option@2@ This outline was written prior to implementation and is not - exactly accurate, but it provides a correct “notional” + exactly accurate, but it provides a correct "notional" idea of how writing works. Look at the code in QPDFWriter for exact details. @@ -4561,7 +4556,7 @@ outfile.pdf@2@option@2@ For general information about how to access instances of QPDFObjectHandle, please see the comments in @1@filename@1@QPDFObjectHandle.hh@2@filename@2@. Search for - “Accessor methods”. This section provides a more + "Accessor methods". This section provides a more in-depth discussion of the behavior and the rationale for the behavior. @@ -4807,8 +4802,8 @@ outfile.pdf@2@option@2@ Once a file is optimized, we have information about which objects access which other objects. We can then process these tables to - decide which part (as described in “Linearized PDF Document - Structure” in the PDF specification) each object is + decide which part (as described in "Linearized PDF Document + Structure" in the PDF specification) each object is contained within. This tells us the exact order in which objects are written. The QPDFWriter class asks for this information and enqueues objects for writing in the proper @@ -4923,7 +4918,7 @@ print "\n"; The PDF specification refers to objects in object streams as - “compressed objects” regardless of whether the object + "compressed objects" regardless of whether the object stream is compressed. @@ -5061,8 +5056,8 @@ print "\n"; by /W above. A 0 in /W indicates that the field is omitted and has the default value. The default value for the field type is - “1”. All other default values are - “0”. + "1". All other default values are + "0". PDF 1.5 has three field types: @@ -5226,7 +5221,7 @@ print "\n"; Overhaul error handling for the object handle functions in - the C API. See comments in the “Object handling” + the C API. See comments in the "Object handling" section of @1@filename@1@include/qpdf/qpdf-c.h@2@filename@2@ for details. In particular, exceptions thrown by the underlying C++ code when calling object accessors are caught and @@ -7273,7 +7268,7 @@ print "\n"; are passed to the qpdf CLI in Windows, qpdf will now correctly receive them. In the past, they would have either been encoded as Windows code page 1252 (also known - as “Windows ANSI” or as something + as "Windows ANSI" or as something unintelligible. In almost all cases, qpdf is able to properly interpret Unicode arguments now, whereas in the past, it would almost never interpret them properly. The @@ -7356,7 +7351,7 @@ print "\n"; In the @1@option@1@--pages@2@option@2@ option, allow use of - “.” as a shortcut for the primary input file. + "." as a shortcut for the primary input file. That way, you can do @1@command@1@qpdf in.pdf --pages . 1-2 -- out.pdf@2@command@2@ instead of having to repeat @1@filename@1@in.pdf@2@filename@2@ in the command. @@ -7477,7 +7472,7 @@ print "\n"; Add new method QPDFPageObjectHelper::shallowCopyPage() - to copy a new page that is a “shallow copy” of a + to copy a new page that is a "shallow copy" of a page. The resulting object is an indirect object ready to be passed to QPDFPageDocumentHelper::addPage() for @@ -7689,7 +7684,7 @@ print "\n"; @1@option@1@--oi-min-height@2@option@2@, and @1@option@1@--oi-min-area@2@option@2@ prevent recompression of images whose width, height, or pixel area - (width × height) are below a specified + (width × height) are below a specified threshold. @@ -8154,7 +8149,7 @@ print "\n"; - In “newline before endstream” mode, insert the + In "newline before endstream" mode, insert the required extra newline before the endstream at the end of object streams. This one case was previously omitted. @@ -8169,7 +8164,7 @@ print "\n"; - The first round of higher level “helper” + The first round of higher level "helper" interfaces has been introduced. These are designed to provide a more convenient way of interacting with certain document features than using @@ -8290,7 +8285,7 @@ print "\n"; On the command line when specifying page ranges, support - preceding a page number by “r” to indicate that it + preceding a page number by "r" to indicate that it should be counted from the end. For example, the range r3-r1 would indicate the last three pages of a document. @@ -8337,8 +8332,8 @@ print "\n"; not of the expected type. In most cases, qpdf will be able to warn for such cases rather than fail with an exception. Previous versions of qpdf would sometimes fail with errors - such as “operation for dictionary object attempted on - object of wrong type”. This situation should be mostly + such as "operation for dictionary object attempted on + object of wrong type". This situation should be mostly or entirely eliminated now. @@ -9142,8 +9137,8 @@ print "\n"; command line by specifying use of 256-bit keys. qpdf also supports the deprecated encryption method used by Acrobat IX. This encryption style has known security weaknesses and should - not be used in practice. However, such files exist “in - the wild,” so support for this scheme is still useful. + not be used in practice. However, such files exist "in + the wild," so support for this scheme is still useful. New methods QPDFWriter::setR6EncryptionParameters (for the PDF 2.0 scheme) and @@ -9340,7 +9335,7 @@ print "\n"; Bug fix: if an object stream ended with a scalar object not followed by space, qpdf would incorrectly report that it encountered a premature EOF. This bug has been in qpdf since - version 2.0. + version 2.0. @@ -9881,12 +9876,12 @@ print "\n"; Žarko Gajić has written a Delphi wrapper for qpdf, which can be downloaded from qpdf's download side. Žarko's Delphi wrapper is released with the same licensing terms as qpdf - itself and comes with this disclaimer: “Delphi wrapper + itself and comes with this disclaimer: "Delphi wrapper unit @1@filename@1@qpdf.pas@2@filename@2@ created by Žarko Gajić (http://zarko-gajic.iz.hr/). Use at your own risk and for whatever purpose you want. No - support is provided. Sample code is provided.” + support is provided. Sample code is provided." @@ -9982,7 +9977,7 @@ print "\n"; Include proper support for LZW streams encoded without the - “early code change” flag. Special thanks to Atom + "early code change" flag. Special thanks to Atom Smasher who reported the problem and provided an input file compressed in this way, which I did not previously have. -- cgit v1.2.3-54-g00ecf