Commit e1271361c59085fc68d75e37faae99f4e595b73e
1 parent
0a3057dc
Add documentation for features since 8.3.0
Showing
2 changed files
with
460 additions
and
18 deletions
include/qpdf/QPDFWriter.hh
| @@ -343,6 +343,16 @@ class QPDFWriter | @@ -343,6 +343,16 @@ class QPDFWriter | ||
| 343 | // setting R4 parameters pushes the version to at least 1.5, or if | 343 | // setting R4 parameters pushes the version to at least 1.5, or if |
| 344 | // AES is used, 1.6, and setting R5 or R6 parameters pushes the | 344 | // AES is used, 1.6, and setting R5 or R6 parameters pushes the |
| 345 | // version to at least 1.7 with extension level 3. | 345 | // version to at least 1.7 with extension level 3. |
| 346 | + // | ||
| 347 | + // Note about Unicode passwords: the PDF specification requires | ||
| 348 | + // passwords to be encoded with PDF Doc encoding for R <= 4 and | ||
| 349 | + // UTF-8 for R >= 5. In all cases, these methods take strings of | ||
| 350 | + // bytes as passwords. It is up to the caller to ensure that | ||
| 351 | + // passwords are properly encoded. The qpdf command-line tool | ||
| 352 | + // tries to do this, as discussed in the manual. If you are doing | ||
| 353 | + // this from your own application, QUtil contains many transcoding | ||
| 354 | + // functions that could be useful to you, most notably | ||
| 355 | + // utf8_to_pdf_doc. | ||
| 346 | QPDF_DLL | 356 | QPDF_DLL |
| 347 | void setR3EncryptionParameters( | 357 | void setR3EncryptionParameters( |
| 348 | char const* user_password, char const* owner_password, | 358 | char const* user_password, char const* owner_password, |
manual/qpdf-manual.xml
| @@ -535,6 +535,83 @@ make | @@ -535,6 +535,83 @@ make | ||
| 535 | </listitem> | 535 | </listitem> |
| 536 | </varlistentry> | 536 | </varlistentry> |
| 537 | <varlistentry> | 537 | <varlistentry> |
| 538 | + <term><option>--suppress-password-recovery</option></term> | ||
| 539 | + <listitem> | ||
| 540 | + <para> | ||
| 541 | + Ordinarily, qpdf attempts to automatically compensate for | ||
| 542 | + passwords specified in the wrong character encoding. This | ||
| 543 | + option suppresses that behavior. Under normal conditions, | ||
| 544 | + there are no reasons to use this option. See <xref | ||
| 545 | + linkend="ref.unicode-passwords"/> for a discussion | ||
| 546 | + </para> | ||
| 547 | + </listitem> | ||
| 548 | + </varlistentry> | ||
| 549 | + <varlistentry> | ||
| 550 | + <term><option>--password-mode=<replaceable>mode</replaceable></option></term> | ||
| 551 | + <listitem> | ||
| 552 | + <para> | ||
| 553 | + This option can be used to fine-tune how qpdf interprets | ||
| 554 | + Unicode (non-ASCII) password strings passed on the command | ||
| 555 | + line. With the exception of the <option>hex-bytes</option> | ||
| 556 | + mode, these only apply to passwords provided when encrypting | ||
| 557 | + files. The <option>hex-bytes</option> mode also applies to | ||
| 558 | + passwords specified for reading files. For additional | ||
| 559 | + discussion of the supported password modes and when you might | ||
| 560 | + want to use them, see <xref linkend="ref.unicode-passwords"/>. | ||
| 561 | + The following modes are supported: | ||
| 562 | + <itemizedlist> | ||
| 563 | + <listitem> | ||
| 564 | + <para> | ||
| 565 | + <option>auto</option>: Automatically determine whether the | ||
| 566 | + specified password is a properly encoded Unicode (UTF-8) | ||
| 567 | + string, and transcode it as required by the PDF spec based | ||
| 568 | + on the type encryption being applied. On Windows starting | ||
| 569 | + with version 8.4.0, and on almost all other modern | ||
| 570 | + platforms, incoming passwords will be properly encoded in | ||
| 571 | + UTF-8, so this is almost always what you want. | ||
| 572 | + </para> | ||
| 573 | + </listitem> | ||
| 574 | + <listitem> | ||
| 575 | + <para> | ||
| 576 | + <option>unicode</option>: Tells qpdf that the incoming | ||
| 577 | + password is UTF-8, overriding whatever its automatic | ||
| 578 | + detection determines. The only difference between this mode | ||
| 579 | + and <option>auto</option> is that qpdf will fail with an | ||
| 580 | + error message if the password is not valid UTF-8 instead of | ||
| 581 | + falling back to <option>bytes</option> mode with a warning. | ||
| 582 | + </para> | ||
| 583 | + </listitem> | ||
| 584 | + <listitem> | ||
| 585 | + <para> | ||
| 586 | + <option>bytes</option>: Interpret the password as a literal | ||
| 587 | + byte string. For non-Windows platforms, this is what | ||
| 588 | + versions of qpdf prior to 8.4.0 did. For Windows platforms, | ||
| 589 | + there is no way to specify strings of binary data on the | ||
| 590 | + command line directly, but you can use the | ||
| 591 | + <option>@filename</option> option to do it, in which case | ||
| 592 | + this option forces qpdf to respect the string of bytes as | ||
| 593 | + provided. This option will allow you to encrypt PDF files | ||
| 594 | + with passwords that will not be usable by other readers. | ||
| 595 | + </para> | ||
| 596 | + </listitem> | ||
| 597 | + <listitem> | ||
| 598 | + <para> | ||
| 599 | + <option>hex-bytes</option>: Interpret the password as a | ||
| 600 | + hex-encoded string. This provides a way to pass binary data | ||
| 601 | + as a password on all platforms including Windows. As with | ||
| 602 | + <option>bytes</option>, this option may allow creation of | ||
| 603 | + files that can't be opened by other readers. This mode | ||
| 604 | + affects qpdf's interpretation of passwords specified for | ||
| 605 | + decrypting files as well as for encrypting them. It makes | ||
| 606 | + it possible to specify strings that are encoded in some | ||
| 607 | + manner other than the system's default encoding. | ||
| 608 | + </para> | ||
| 609 | + </listitem> | ||
| 610 | + </itemizedlist> | ||
| 611 | + </para> | ||
| 612 | + </listitem> | ||
| 613 | + </varlistentry> | ||
| 614 | + <varlistentry> | ||
| 538 | <term><option>--rotate=[+|-]angle[:page-range]</option></term> | 615 | <term><option>--rotate=[+|-]angle[:page-range]</option></term> |
| 539 | <listitem> | 616 | <listitem> |
| 540 | <para> | 617 | <para> |
| @@ -699,22 +776,17 @@ make | @@ -699,22 +776,17 @@ make | ||
| 699 | producers. | 776 | producers. |
| 700 | </para> | 777 | </para> |
| 701 | <para> | 778 | <para> |
| 702 | - In all cases where qpdf allows specification of a password, care | ||
| 703 | - must be taken if the password contains characters that fall | ||
| 704 | - outside of the 7-bit US-ASCII character range to ensure that the | ||
| 705 | - exact correct byte sequence is provided. It is possible that a | ||
| 706 | - future version of qpdf may handle this more gracefully. For | ||
| 707 | - example, if a password was encrypted using a password that was | ||
| 708 | - encoded in ISO-8859-1 and your terminal is configured to use | ||
| 709 | - UTF-8, the password you supply may not work properly. There are | ||
| 710 | - various approaches to handling this. For example, if you are | ||
| 711 | - using Linux and have the iconv executable installed, you could | ||
| 712 | - pass <option>--password=`echo <replaceable>password</replaceable> | ||
| 713 | - | iconv -t iso-8859-1`</option> to qpdf where | ||
| 714 | - <replaceable>password</replaceable> is a password specified in | ||
| 715 | - your terminal's locale. A detailed discussion of this is out of | ||
| 716 | - scope for this manual, but just be aware of this issue if you have | ||
| 717 | - trouble with a password that contains 8-bit characters. | 779 | + Prior to 8.4.0, in the case of passwords that contain characters |
| 780 | + that fall outside of 7-bit US-ASCII, qpdf left the burden of | ||
| 781 | + supplying properly encoded encryption and decryption passwords to | ||
| 782 | + the user. Starting in qpdf 8.4.0, qpdf does this automatically in | ||
| 783 | + most cases. For an in-depth discussion, please see <xref | ||
| 784 | + linkend="ref.unicode-passwords"/>. Previous versions of this | ||
| 785 | + manual described workarounds using the <command>iconv</command> | ||
| 786 | + command. Such workarounds are no longer required or recommended | ||
| 787 | + with qpdf 8.4.0. However, for backward compatibility, qpdf | ||
| 788 | + attempts to detect those workarounds and do the right thing in | ||
| 789 | + most cases. | ||
| 718 | </para> | 790 | </para> |
| 719 | </sect1> | 791 | </sect1> |
| 720 | <sect1 id="ref.encryption-options"> | 792 | <sect1 id="ref.encryption-options"> |
| @@ -2024,6 +2096,121 @@ outfile.pdf</option> | @@ -2024,6 +2096,121 @@ outfile.pdf</option> | ||
| 2024 | content stream, in which case it will produce unusable results. | 2096 | content stream, in which case it will produce unusable results. |
| 2025 | </para> | 2097 | </para> |
| 2026 | </sect1> | 2098 | </sect1> |
| 2099 | + <sect1 id="ref.unicode-passwords"> | ||
| 2100 | + <title>Unicode Passwords</title> | ||
| 2101 | + <para> | ||
| 2102 | + At the library API level, all methods that perform encryption and | ||
| 2103 | + decryption interpret passwords as strings of bytes. It is up to | ||
| 2104 | + the caller to ensure that they are appropriately encoded. Starting | ||
| 2105 | + with qpdf version 8.4.0, qpdf will attempt to make this easier for | ||
| 2106 | + you when interact with qpdf via its command line interface. The | ||
| 2107 | + PDF specification requires passwords used to encrypt files with | ||
| 2108 | + 40-bit or 128-bit encryption to be encoded with PDF Doc encoding. | ||
| 2109 | + This encoding is a single-byte encoding that supports ISO-Latin-1 | ||
| 2110 | + and a handful of other commonly used characters. It has a large | ||
| 2111 | + overlap with Windows ANSI but is not exactly the same. There is | ||
| 2112 | + generally not a way to provide PDF Doc encoded strings on the | ||
| 2113 | + command line. As such, qpdf versions prior to 8.4.0 would often | ||
| 2114 | + create PDF files that couldn't be opened with other software when | ||
| 2115 | + given a password with non-ASCII characters to encrypt a file with | ||
| 2116 | + 40-bit or 128-bit encryption. Starting with qpdf 8.4.0, qpdf | ||
| 2117 | + recognizes the encoding of the parameter and transcodes it as | ||
| 2118 | + needed. The rest of this section provides the details about | ||
| 2119 | + exactly how qpdf behaves. Most users will not need to know this | ||
| 2120 | + information, but it might be useful if you have been working | ||
| 2121 | + around qpdf's old behavior or if you are using qpdf to generate | ||
| 2122 | + encrypted files for testing other PDF software. | ||
| 2123 | + </para> | ||
| 2124 | + <para> | ||
| 2125 | + A note about Windows: when qpdf builds, it attempts to determine | ||
| 2126 | + what it has to do to use <function>wmain</function> instead of | ||
| 2127 | + <function>main</function> on Windows. The | ||
| 2128 | + <function>wmain</function> function is an alternative entry point | ||
| 2129 | + that receives all arguments as UTF-16-encoded strings. When qpdf | ||
| 2130 | + starts up this way, it converts all the strings to UTF-8 encoding | ||
| 2131 | + and then invokes the regular main. This means that, as far as qpdf | ||
| 2132 | + is concerned, it receives its command-line arguments with UTF-8 | ||
| 2133 | + encoding, just as it would in any modern Linux or UNIX | ||
| 2134 | + environment. | ||
| 2135 | + </para> | ||
| 2136 | + <para> | ||
| 2137 | + If a file is being encrypted with 40-bit or 128-bit encryption and | ||
| 2138 | + the supplied password is not a valid UTF-8 string, qpdf will fall | ||
| 2139 | + back to the behavior of interpreting the password as a string of | ||
| 2140 | + bytes. If you have old scripts that encrypt files by passing the | ||
| 2141 | + output of <command>iconv</command> to qpdf, you no longer need to | ||
| 2142 | + do that, but if you do, qpdf should still work. The only exception | ||
| 2143 | + would be for the extremely unlikely case of a password that is | ||
| 2144 | + encoded with a single-byte encoding but also happens to be valid | ||
| 2145 | + UTF-8. Such a password would contain strings of even numbers of | ||
| 2146 | + characters that alternate between accented letters and symbols. In | ||
| 2147 | + the extremely unlikely event that you are intentionally using such | ||
| 2148 | + passwords and qpdf is thwarting you by interpreting them as UTF-8, | ||
| 2149 | + you can use <option>--password-mode=bytes</option> to suppress | ||
| 2150 | + qpdf's automatic behavior. | ||
| 2151 | + </para> | ||
| 2152 | + <para> | ||
| 2153 | + The <option>--password-mode</option> option, as described earlier | ||
| 2154 | + in this chapter, can be used to change qpdf's interpretation of | ||
| 2155 | + supplied passwords. There are very few reasons to use this option. | ||
| 2156 | + One would be the unlikely case described in the previous paragraph | ||
| 2157 | + in which the supplied password happens to be valid UTF-8 but isn't | ||
| 2158 | + supposed to be UTF-8. Your best bet would be just to provide the | ||
| 2159 | + password as a valid UTF-8 string, but you could also use | ||
| 2160 | + <option>--password-mode=bytes</option>. Another reason to use | ||
| 2161 | + <option>--password-mode=bytes</option> would be to intentionally | ||
| 2162 | + generate PDF files encrypted with passwords that are not properly | ||
| 2163 | + encoded. The qpdf test suite does this to generate invalid files | ||
| 2164 | + for the purpose of testing its password recovery capability. If | ||
| 2165 | + you were trying to create intentionally incorrect files for a | ||
| 2166 | + similar purposes, the <option>bytes</option> password mode can | ||
| 2167 | + enable you to do this. | ||
| 2168 | + </para> | ||
| 2169 | + <para> | ||
| 2170 | + When qpdf attempts to decrypt a file with a password that contains | ||
| 2171 | + non-ASCII characters, it will generate a list of alternative | ||
| 2172 | + passwords by attempting to interpret the password as each of a | ||
| 2173 | + handful of different coding systems and then transcode them to the | ||
| 2174 | + required format. This helps to compensate for the supplied | ||
| 2175 | + password being given in the wrong coding system, such as would | ||
| 2176 | + happen if you used the <command>iconv</command> workaround that | ||
| 2177 | + was previously needed. It also generates passwords by doing the | ||
| 2178 | + reverse operation: translating from correct in incorrect encoding | ||
| 2179 | + of the password. This would enable qpdf to decrypt files using | ||
| 2180 | + passwords that were improperly encoded by whatever software | ||
| 2181 | + encrypted the files, including older versions of qpdf invoked | ||
| 2182 | + without properly encoded passwords. The combination of these two | ||
| 2183 | + recovery methods should make qpdf transparently open most | ||
| 2184 | + encrypted files with the password supplied correctly but in the | ||
| 2185 | + wrong coding system. There are no real downsides to this behavior, | ||
| 2186 | + but if you don't want qpdf to do this, you can use the | ||
| 2187 | + <option>--suppress-password-recovery</option> option. One reason | ||
| 2188 | + to do that is to ensure that you know the exact password that was | ||
| 2189 | + used to encrypt the file. | ||
| 2190 | + </para> | ||
| 2191 | + <para> | ||
| 2192 | + With these changes, qpdf now generates compliant passwords in most | ||
| 2193 | + cases. There are still some exceptions. In particular, the PDF | ||
| 2194 | + specification directs compliant writers to normalize Unicode | ||
| 2195 | + passwords and to perform certain transformations on passwords with | ||
| 2196 | + bidirectional text. Implementing this functionality requires using | ||
| 2197 | + a real Unicode library like ICU. If a client application that uses | ||
| 2198 | + qpdf wants to do this, the qpdf library will accept the resulting | ||
| 2199 | + passwords, but qpdf will not perform these transformations itself. | ||
| 2200 | + It is possible that this will be addressed in a future version of | ||
| 2201 | + qpdf. The <classname>QPDFWriter</classname> methods that enable | ||
| 2202 | + encryption on the output file accept passwords as strings of | ||
| 2203 | + bytes. | ||
| 2204 | + </para> | ||
| 2205 | + <para> | ||
| 2206 | + Please note that the <option>--password-is-hex-key</option> option | ||
| 2207 | + is unrelated to all this. This flag bypasses the normal process of | ||
| 2208 | + going from password to encryption string entirely, allowing the | ||
| 2209 | + raw encryption key to be specified directly. This is useful for | ||
| 2210 | + forensic purposes or for brute-force recovery of files with | ||
| 2211 | + unknown passwords. | ||
| 2212 | + </para> | ||
| 2213 | + </sect1> | ||
| 2027 | </chapter> | 2214 | </chapter> |
| 2028 | <chapter id="ref.qdf"> | 2215 | <chapter id="ref.qdf"> |
| 2029 | <title>QDF Mode</title> | 2216 | <title>QDF Mode</title> |
| @@ -3975,6 +4162,253 @@ print "\n"; | @@ -3975,6 +4162,253 @@ print "\n"; | ||
| 3975 | </para> | 4162 | </para> |
| 3976 | <variablelist> | 4163 | <variablelist> |
| 3977 | <varlistentry> | 4164 | <varlistentry> |
| 4165 | + <term>8.4.0: XXX, 2019</term> | ||
| 4166 | + <listitem> | ||
| 4167 | + <itemizedlist> | ||
| 4168 | + <listitem> | ||
| 4169 | + <para> | ||
| 4170 | + Command-line Enhancements | ||
| 4171 | + </para> | ||
| 4172 | + <itemizedlist> | ||
| 4173 | + <listitem> | ||
| 4174 | + <para> | ||
| 4175 | + <emphasis>Non-compatible CLI change:</emphasis> The qpdf | ||
| 4176 | + command-line tool interprets passwords given at the | ||
| 4177 | + command-line differently from previous releases when the | ||
| 4178 | + passwords contain non-ASCII characters. In some cases, the | ||
| 4179 | + behavior differs from previous releases. For a discussion of | ||
| 4180 | + the current behavior, please see <xref | ||
| 4181 | + linkend="ref.unicode-passwords"/>. The incompatibilities are | ||
| 4182 | + as follows: | ||
| 4183 | + <itemizedlist> | ||
| 4184 | + <listitem> | ||
| 4185 | + <para> | ||
| 4186 | + On Windows, qpdf now receives all command-line options as | ||
| 4187 | + Unicode strings if it can figure out the appropriate | ||
| 4188 | + compile/link options. This is enabled at least for MSVC | ||
| 4189 | + and mingw builds. That means that if non-ASCII strings | ||
| 4190 | + are passed to the qpdf CLI in Windows, qpdf will now | ||
| 4191 | + correctly receive them. In the past, they would have | ||
| 4192 | + either been encoded as Windows code page 1252 (also known | ||
| 4193 | + as “Windows ANSI” or as something | ||
| 4194 | + unintelligble. In almost all cases, qpdf is able to | ||
| 4195 | + properly interpret Unicode arguments now, whereas in the | ||
| 4196 | + past, it would almost never interpret them properly. The | ||
| 4197 | + result is that non-ASCII passwords given to the qpdf CLI | ||
| 4198 | + on Windows now have a much greater chance of creating PDF | ||
| 4199 | + files that can be opened by a variety of readers. In the | ||
| 4200 | + past, usually files encrypted from the Windows CLI using | ||
| 4201 | + non-ASCII passwords would not be readable by most | ||
| 4202 | + viewers. Note that the current version of qpdf is able to | ||
| 4203 | + decrypt files that it previously created using the | ||
| 4204 | + previously supplied password. | ||
| 4205 | + </para> | ||
| 4206 | + </listitem> | ||
| 4207 | + <listitem> | ||
| 4208 | + <para> | ||
| 4209 | + The PDF specification requires passwords to be encoded as | ||
| 4210 | + UTF-8 for 256-bit encryption and with PDF Doc encoding | ||
| 4211 | + for 40-bit or 128-bit encryption. Older versions of qpdf | ||
| 4212 | + left it up to the user to provide passwords with the | ||
| 4213 | + correct encoding. The qpdf CLI now detects when a | ||
| 4214 | + password is given with UTF-8 encoding and automatically | ||
| 4215 | + transcodes it to what the PDF spec requires. While this | ||
| 4216 | + is almost always the correct behavior, it is possible to | ||
| 4217 | + override the behavior if there is some reason to do so. | ||
| 4218 | + This is discussed in more depth in <xref | ||
| 4219 | + linkend="ref.unicode-passwords"/>. | ||
| 4220 | + </para> | ||
| 4221 | + </listitem> | ||
| 4222 | + </itemizedlist> | ||
| 4223 | + </para> | ||
| 4224 | + </listitem> | ||
| 4225 | + <listitem> | ||
| 4226 | + <para> | ||
| 4227 | + When opening an encrypted file with a password, if the | ||
| 4228 | + specified password doesn't work and the password contains | ||
| 4229 | + any non-ASCII characters, qpdf will try a number of | ||
| 4230 | + alternative passwords to try to compensate for possible | ||
| 4231 | + character encoding errors. This behavior can be suppressed | ||
| 4232 | + with the <option>--suppress-password-recovery</option> | ||
| 4233 | + option. See <xref linkend="ref.unicode-passwords"/> for a | ||
| 4234 | + full discussion. | ||
| 4235 | + </para> | ||
| 4236 | + </listitem> | ||
| 4237 | + <listitem> | ||
| 4238 | + <para> | ||
| 4239 | + Add the <option>--password-mode</option> option to fine-tune | ||
| 4240 | + how qpdf interprets password arguments, especially when they | ||
| 4241 | + contain non-ASCII characters. See <xref | ||
| 4242 | + linkend="ref.unicode-passwords"/> for more information. | ||
| 4243 | + </para> | ||
| 4244 | + </listitem> | ||
| 4245 | + <listitem> | ||
| 4246 | + <para> | ||
| 4247 | + In the <option>--pages</option> option, it is now possible | ||
| 4248 | + to copy the same page more than once from the same file | ||
| 4249 | + without using the previous workaround of specifying two | ||
| 4250 | + different paths to the same file. | ||
| 4251 | + </para> | ||
| 4252 | + </listitem> | ||
| 4253 | + <listitem> | ||
| 4254 | + <para> | ||
| 4255 | + In the <option>--pages</option> option, allow use of | ||
| 4256 | + “.” as a shortcut for the primary input file. | ||
| 4257 | + That way, you can do <command>qpdf in.pdf --pages . 1-2 -- | ||
| 4258 | + out.pdf</command> instead of having to repeat | ||
| 4259 | + <filename>in.pdf</filename> in the command. | ||
| 4260 | + </para> | ||
| 4261 | + </listitem> | ||
| 4262 | + <listitem> | ||
| 4263 | + <para> | ||
| 4264 | + When encrypting with 128-bit and 256-bit encryption, new | ||
| 4265 | + encryption options <option>--assemble</option>, | ||
| 4266 | + <option>--annotate</option>, <option>--form</option>, and | ||
| 4267 | + <option>--modify-other</option> allow more fine-grained | ||
| 4268 | + granluarity in configuring options. Before, the | ||
| 4269 | + <option>--modify</option> option only configured certain | ||
| 4270 | + predefined groups of permissions. | ||
| 4271 | + </para> | ||
| 4272 | + </listitem> | ||
| 4273 | + </itemizedlist> | ||
| 4274 | + </listitem> | ||
| 4275 | + <listitem> | ||
| 4276 | + <para> | ||
| 4277 | + Bug Fixes and Enhancements | ||
| 4278 | + </para> | ||
| 4279 | + <itemizedlist> | ||
| 4280 | + <listitem> | ||
| 4281 | + <para> | ||
| 4282 | + <emphasis>Potential data-loss bug:</emphasis> Versions of | ||
| 4283 | + qpdf between 8.1.0 and 8.3.0 had a bug that could cause page | ||
| 4284 | + splitting and merging operations to drop some font or image | ||
| 4285 | + resources if the PDF file's internal structure shared these | ||
| 4286 | + resource lists across pages and if some but not all of the | ||
| 4287 | + pages in the output did not reference all the fonts and | ||
| 4288 | + images. Using the | ||
| 4289 | + <option>--preserve-unreferenced-resources</option> option | ||
| 4290 | + would work around the incorrect behavior. This bug was the | ||
| 4291 | + result of a typo in the code and a deficiency in the test | ||
| 4292 | + suite. The case that triggered the error was known, just not | ||
| 4293 | + handled properly. This case is now exercised in qpdf's test | ||
| 4294 | + suite and properly handled. | ||
| 4295 | + </para> | ||
| 4296 | + </listitem> | ||
| 4297 | + </itemizedlist> | ||
| 4298 | + </listitem> | ||
| 4299 | + <listitem> | ||
| 4300 | + <para> | ||
| 4301 | + Library Enhancements | ||
| 4302 | + </para> | ||
| 4303 | + <itemizedlist> | ||
| 4304 | + <listitem> | ||
| 4305 | + <para> | ||
| 4306 | + Add method | ||
| 4307 | + <function>QUtil::possible_repaired_encodings()</function> to | ||
| 4308 | + generate a list of strings that represent other ways the | ||
| 4309 | + given string could have been encoded. This is the method the | ||
| 4310 | + QPDF CLI uses to generate the strings it tries when | ||
| 4311 | + recovering incorrectly encoded Unicode passwords. | ||
| 4312 | + </para> | ||
| 4313 | + </listitem> | ||
| 4314 | + <listitem> | ||
| 4315 | + <para> | ||
| 4316 | + Add new versions of | ||
| 4317 | + <function>QPDFWriter::setR{3,4,5,6}EncryptionParameters</function> | ||
| 4318 | + that allow more granular setting of permissions bits. See | ||
| 4319 | + <filename>QPDFWriter.hh</filename> for details. | ||
| 4320 | + </para> | ||
| 4321 | + </listitem> | ||
| 4322 | + <listitem> | ||
| 4323 | + <para> | ||
| 4324 | + Add new versions of the transcoders from UTF-8 to | ||
| 4325 | + single-byte coding systems in <classname>QUtil</classname> | ||
| 4326 | + that report success or failure rather than just substituting | ||
| 4327 | + a specified unknown character. | ||
| 4328 | + </para> | ||
| 4329 | + </listitem> | ||
| 4330 | + <listitem> | ||
| 4331 | + <para> | ||
| 4332 | + Add method <function>QUtil::analyze_encoding()</function> to | ||
| 4333 | + determine whether a string has high-bit characters and is | ||
| 4334 | + appears to be UTF-16 or valid UTF-8 encoding. | ||
| 4335 | + </para> | ||
| 4336 | + </listitem> | ||
| 4337 | + <listitem> | ||
| 4338 | + <para> | ||
| 4339 | + Add new method | ||
| 4340 | + <function>QPDFPageObjectHelper::shallowCopyPage()</function> | ||
| 4341 | + to copy a new page that is a “shallow copy” of a | ||
| 4342 | + page. The resulting object is an indirect object ready to be | ||
| 4343 | + passed to | ||
| 4344 | + <function>QPDFPageDocumentHelper::addPage()</function> for | ||
| 4345 | + either the original <classname>QPDF</classname> object or a | ||
| 4346 | + different one. This is what the <command>qpdf</command> | ||
| 4347 | + command-line tool uses to copy the same page multiple times | ||
| 4348 | + from the same file during splitting and merging operations. | ||
| 4349 | + </para> | ||
| 4350 | + </listitem> | ||
| 4351 | + <listitem> | ||
| 4352 | + <para> | ||
| 4353 | + Add method <function>QPDF::getUniqueId()</function>, which | ||
| 4354 | + returns a unique identifier for the given QPDF object. The | ||
| 4355 | + identifier will be unique across the life of the | ||
| 4356 | + application. The returned value can be safely used as a map | ||
| 4357 | + key. | ||
| 4358 | + </para> | ||
| 4359 | + </listitem> | ||
| 4360 | + <listitem> | ||
| 4361 | + <para> | ||
| 4362 | + Add method <function>QPDF::setImmediateCopyFrom</function>. | ||
| 4363 | + This further enhances qpdf's ability to allow a | ||
| 4364 | + <classname>QPDF</classname> object from which objects are | ||
| 4365 | + being copied to go out of scope before the destination | ||
| 4366 | + object is written. If you call this method on a | ||
| 4367 | + <classname>QPDF</classname> instances, objects copied | ||
| 4368 | + <emphasis>from</emphasis> this instance will be copied | ||
| 4369 | + immediately instead of lazily. This option uses more memory | ||
| 4370 | + but allows the source object to go out of scope before the | ||
| 4371 | + destination object is written in all cases. See comments in | ||
| 4372 | + <filename>QPDF.hh</filename> for details. | ||
| 4373 | + </para> | ||
| 4374 | + </listitem> | ||
| 4375 | + </itemizedlist> | ||
| 4376 | + </listitem> | ||
| 4377 | + <listitem> | ||
| 4378 | + <para> | ||
| 4379 | + Build Improvements | ||
| 4380 | + </para> | ||
| 4381 | + <itemizedlist> | ||
| 4382 | + <listitem> | ||
| 4383 | + <para> | ||
| 4384 | + Add new configure option | ||
| 4385 | + <option>--enable-avoid-windows-handle</option>, which causes | ||
| 4386 | + the preprocessor symbol | ||
| 4387 | + <literal>AVOID_WINDOWS_HANDLE</literal> to be defined. When | ||
| 4388 | + defined, qpdf will avoid referencing the Windows | ||
| 4389 | + <classname>HANDLE</classname> type, which is disallowed with | ||
| 4390 | + certain versions of the Windows SDK. | ||
| 4391 | + </para> | ||
| 4392 | + </listitem> | ||
| 4393 | + <listitem> | ||
| 4394 | + <para> | ||
| 4395 | + For Windows builds, attempt to determine what options, if | ||
| 4396 | + any, have to be passed to the compiler and linker to enable | ||
| 4397 | + use of <function>wmain</function>. This causes the | ||
| 4398 | + preprocessor symbol <literal>WINDOWS_WMAIN</literal> to be | ||
| 4399 | + defined. If you do your own builds with other compilers, you | ||
| 4400 | + can define this symbol to cause <function>wmain</function> | ||
| 4401 | + to be used. This is needed to allow the Windows | ||
| 4402 | + <command>qpdf</command> command to receive Unicode | ||
| 4403 | + command-line options. | ||
| 4404 | + </para> | ||
| 4405 | + </listitem> | ||
| 4406 | + </itemizedlist> | ||
| 4407 | + </listitem> | ||
| 4408 | + </itemizedlist> | ||
| 4409 | + </listitem> | ||
| 4410 | + </varlistentry> | ||
| 4411 | + <varlistentry> | ||
| 3978 | <term>8.3.0: January 7, 2019</term> | 4412 | <term>8.3.0: January 7, 2019</term> |
| 3979 | <listitem> | 4413 | <listitem> |
| 3980 | <itemizedlist> | 4414 | <itemizedlist> |
| @@ -5079,8 +5513,6 @@ print "\n"; | @@ -5079,8 +5513,6 @@ print "\n"; | ||
| 5079 | </itemizedlist> | 5513 | </itemizedlist> |
| 5080 | </listitem> | 5514 | </listitem> |
| 5081 | </varlistentry> | 5515 | </varlistentry> |
| 5082 | - </variablelist> | ||
| 5083 | - <variablelist> | ||
| 5084 | <varlistentry> | 5516 | <varlistentry> |
| 5085 | <term>6.0.0: November 10, 2015</term> | 5517 | <term>6.0.0: November 10, 2015</term> |
| 5086 | <listitem> | 5518 | <listitem> |