mutool clean¶
The clean command pretty prints and rewrites the syntax of a PDF file. It can be used to repair broken files, expand compressed streams, filter out a range of pages, etc.
mutool clean [options] input.pdf [output.pdf] [pages]
Note
Command line parameters within square brackets [] are optional.
[options]Options are as follows:
-ppasswordUse the specified password if the file is encrypted.
-gGarbage collect unused objects.
-ggIn addition to
-gcompact xref table.-gggIn addition to
-ggmerge duplicate objects.-ggggIn addition to
-gggcheck streams for duplication.-lLinearize PDF.
-DSave file without encryption.
-EencryptionSave file with new encryption (
rc4-40,rc4-128,aes-128, oraes-256).-Oowner_passwordOwner password (only if encrypting).
-Uuser_passwordUser password (only if encrypting).
-PpermissionPermission flags (only if encrypting).
-aASCII hex encode binary streams.
-dDecompress streams.
-zDeflate uncompressed streams.
-fCompress font streams.
-iCompress image streams.
-cClean content streams.
-sSanitize content streams.
-ACreate appearance streams for annotations.
-AARecreate appearance streams for annotations.
-mPreserve metadata.
input.pdfInput file name. Must be a PDF file.
[output.pdf]The output file. Must be a PDF file.
Note
If no output file is specified, it will write the cleaned PDF to “out.pdf” in the current directory.
[pages]Comma separated list of page numbers and ranges. If no pages are supplied then all document pages will be considered for the output file.
This software is provided AS-IS with no warranty, either express or implied. This software is distributed under license and may not be copied, modified or distributed except as expressly authorized under the terms of that license. Refer to licensing information at artifex.com or contact Artifex Software, Inc., 39 Mesa Street, Suite 108A, San Francisco, CA 94129, USA, for further information.