summaryrefslogtreecommitdiffstats
path: root/manual
diff options
context:
space:
mode:
authorJay Berkenbilt <ejb@ql.org>2019-08-31 21:11:11 +0200
committerJay Berkenbilt <ejb@ql.org>2019-08-31 21:51:21 +0200
commitd492bb0a90e30c8c57f36434479ddb708d322e79 (patch)
tree3e721d5622acb0fe6f74ab0889b317cde7daf7a2 /manual
parentbabd12c9b2b824416d2e5992d961396090e2bfea (diff)
downloadqpdf-d492bb0a90e30c8c57f36434479ddb708d322e79.tar.zst
Add --replace-input option (fixes #321)
Diffstat (limited to 'manual')
-rw-r--r--manual/qpdf-manual.xml34
1 files changed, 30 insertions, 4 deletions
diff --git a/manual/qpdf-manual.xml b/manual/qpdf-manual.xml
index bfdefc41..01d1b9cf 100644
--- a/manual/qpdf-manual.xml
+++ b/manual/qpdf-manual.xml
@@ -331,10 +331,12 @@ make
<option>outfilename</option> does not have to be seekable, even
when generating linearized files. Specifying
&ldquo;<option>-</option>&rdquo; as <option>outfilename</option>
- means to write to standard output. However, you can't specify the
- same file as both the input and the output because qpdf reads data
- from the input file as it writes to the output file. QPDF attempts
- to detect this case and fail without overwriting the output file.
+ means to write to standard output. If you want to overwrite the
+ input file with the output, use the option
+ <option>--replace-input</option> and omit the output file name.
+ You can't specify the same file as both the input and the output.
+ If you do this, qpdf will tell you about the
+ <option>--replace-input</option> option.
</para>
<para>
Most options require an output file, but some testing or
@@ -450,6 +452,21 @@ make
</listitem>
</varlistentry>
<varlistentry>
+ <term><option>--replace-input</option></term>
+ <listitem>
+ <para>
+ If specified, the output file name should be omitted. This
+ option tells qpdf to replace the input file with the output.
+ It does this by writing to
+ <filename>.~qpdf-temp.<replaceable>infilename</replaceable>#</filename>
+ and, when done, overwriting the input file with the temporary
+ file. If there were any warnings, the original input is saved
+ as
+ <filename><replaceable>infilename</replaceable>.~qpdf-orig</filename>.
+ </para>
+ </listitem>
+ </varlistentry>
+ <varlistentry>
<term><option>--copy-encryption=file</option></term>
<listitem>
<para>
@@ -4421,6 +4438,15 @@ print "\n";
<itemizedlist>
<listitem>
<para>
+ The <option>--replace-input</option> option may be given in
+ place of an output file name. This causes qpdf to overwrite
+ the input file with the output. See the description of
+ <option>--replace-input</option> in <xref
+ linkend="ref.basic-options"/> for more details.
+ </para>
+ </listitem>
+ <listitem>
+ <para>
The <option>--recompress-flate</option> instructs
<command>qpdf</command> to recompress streams that are
already compressed with <literal>/FlateDecode</literal>.