Command reference

edit

Synopsis

Meziantou.Framework.FileConversion.Tool [<inputs>...] [options]

Description

Convert files from one format to another: images (PNG, JPEG, WebP, AVIF, HEIC, JPEG XL, TIFF, GIF...), PDF, EPUB, Markdown, HTML, comic book archives (CBZ, CBR, CB7, CBT) and archives (zip, 7z, RAR, tar...)

Arguments

ArgumentDescription
<inputs>The files to convert, or glob patterns such as 'scans/*.jpg'. The files a pattern matches are sorted in natural order (page2 before page10)

Options

OptionDescriptionDefault
-o, --output <output>The path of the output files, with the placeholders {name}, {ext}, {dir}, {page}, {index} and {count}. {page:000} pads the number with zeros. Default: '{dir}/{name}.{ext}', or '{dir}/{name}-{page}.{ext}' when an input gives several images
--input-format <input-format>The format of the inputs, when it must not be detected from their content
--output-format <output-format>The format of the outputs. Default: the format of the extension of --output
--overwriteReplace the output files that already exist
--per-inputConvert each input to its own PDF, comic book archive or TIFF file, instead of all the inputs to one file
--per-pageWrite each page to its own PDF, comic book archive or TIFF file, such as to split a PDF file. The output template needs {page} or {index}
--pages <pages>The pages of each input to convert, such as '1-3,7,10-'. Default: all the pages
--list-formatsList the formats, their extensions and their options
--max-width <max-width>Shrink the images to this width, in pixels, keeping their aspect ratio
--max-height <max-height>Shrink the images to this height, in pixels, keeping their aspect ratio
--dpi <dpi>The resolution of the images of the PDF and EPUB pages, in dots per inch150
--background <background>The color the transparent pixels are composited over in JPEG output, in hexadecimal notation#ffffff
--jpeg-quality <jpeg-quality>The quality of the JPEG images, from 1 to 100. Default: 90
--webp-quality <webp-quality>The quality of the lossy WebP images, from 0 to 100
--webp-losslessCompress the WebP images without loss
--avif-quality <avif-quality>The quality of the lossy AVIF images, from 0 to 100
--avif-effort <avif-effort>The compression effort of the AVIF images, from 0 (fastest) to 9 (smallest)
--avif-losslessCompress the AVIF images without loss
--heic-quality <heic-quality>The quality of the lossy HEIC images, from 0 to 100
--jxl-quality <jxl-quality>The quality of the lossy JPEG XL images, from 0 to 100
--jxl-losslessCompress the JPEG XL images without loss
--png-compression-level <Fastest\|NoCompression\|Optimal\|SmallestSize>The compression level of the PNG images
--tiff-compression <CcittGroup3\|CcittGroup4\|CcittModifiedHuffman\|Deflate\|Jpeg\|Lzw\|None\|PackBits>The compression of the TIFF images
--gif-max-colors <gif-max-colors>The maximum number of colors of the GIF images, from 2 to 256
--pdf-password <pdf-password>The password of the encrypted PDF inputs
--pdf-render-annotationsRender the annotations of the PDF pages (form fields, stamps, comments) in the images. Use '--pdf-render-annotations false' to leave them out. Default: true
--page-size <page-size>The size of the pages of the images in a PDF output: 'fit' (the size of each image), A3, A4, A5, Letter, Legal, or a size such as 210x297mm, 8.5x11in or 595x842ptfit
--page-margin <page-margin>The margin around the images in a PDF output, in millimeters0
--page-orientation <Auto\|Landscape\|Portrait>The orientation of the pages of a fixed --page-size. Auto turns the page of a landscape imageAuto
--pdf-image-encoding <Auto\|Jpeg\|Lossless>The compression of the images in a PDF output. Auto embeds the JPEG files as they are, and compresses the other images without lossAuto
--pdf-conformance <None\|PdfA2B\|PdfA2U\|PdfA3B\|PdfA3U>Save the PDF output as PDF/A, for archiving. PdfA2B is the usual choice; the U levels also make the text extractable as Unicode, and PDF/A-3 allows embedded files of any formatNone
--pdf-output-intent <pdf-output-intent>The ICC profile of the output intent of a PDF/A output, such as the CMYK profile of its printing condition. Default: sRGB
--pdf-max-image-dpi <pdf-max-image-dpi>Resample the images of the PDF output whose resolution is above this one, in dots per inch, to make the file smaller
--pdf-optimizeRemove the resources the pages do not use and the page thumbnails from the PDF output
--pdf-linearizeLinearize the PDF output (fast web view): a viewer shows the first pages before the file is downloaded
--pdf-output-password <pdf-output-password>Encrypt the PDF output (AES-256) with this password, which is needed to open it
--pdf-owner-password <pdf-owner-password>Encrypt the PDF output (AES-256) with this owner password, which allows every operation. Without --pdf-output-password, the file opens without a password, with the --pdf-permissions
--pdf-permissions <All\|Annotate\|Assemble\|CopyContent\|ExtractForAccessibility\|FillForms\|Modify\|None\|Print\|PrintHighQuality>The operations allowed without the owner password, separated by commas: None, Print, PrintHighQuality, Modify, CopyContent, Annotate, FillForms, ExtractForAccessibility, Assemble, All. Needs --pdf-owner-password. Default: All
--pdf-flatten-formsDraw the form fields of the PDF inputs in the content of their pages, so that their values are kept in the PDF output. Without it, the PDF output leaves the form fields out
--epub-mode <Auto\|Images\|Render>How the EPUB pages are made. Auto uses the images of a book whose pages are images (comics), and lays out the text of the other booksAuto
--layout-page-size <layout-page-size>The size of the pages the text of EPUB, Markdown and HTML documents is laid out on: A3, A4, A5, Letter, Legal, or a size such as 148x210mm. Default: A5 for EPUB, A4 for Markdown and HTML
--layout-margin <layout-margin>The margin of the pages the text of EPUB, Markdown and HTML documents is laid out on, in millimeters15
--layout-font-size <layout-font-size>The size of the text of EPUB, Markdown and HTML documents laid out on pages, in points. Default: the size of the style sheets of the document
--html-root <html-root>The folder whose files (images, style sheets, fonts) Markdown and HTML documents laid out on pages can load, such as the root of a documentation site. Default: the folder of each document. Nothing is loaded from the network
--markdown-extensions <markdown-extensions>The Markdown extensions of a Markdown input, separated by '+': 'common' for CommonMark only, 'advanced' (tables, task lists, footnotes, alerts...), or extensions such as 'pipetables+tasklists+emojis'advanced
--markdown-disable-htmlWrite the raw HTML of a Markdown input as text, for a document from an untrusted source
--html-fragmentWrite only the content of the body of the HTML output, without <html>, <head> and <body>
--html-title <html-title>The title of the HTML output. Default: the title of the front matter of the Markdown document, its first heading, or its file name
--html-stylesheet <html-stylesheet>The URL of a style sheet the HTML output links to. Repeat the option for several style sheets
--markdown-heading-style <Atx\|Setext>The style of the headings of the Markdown outputAtx
--markdown-code-block-style <Fenced\|Indented>The style of the code blocks of the Markdown outputFenced
--markdown-emphasis-marker <Asterisk\|Underscore>The marker of the emphasis of the Markdown outputAsterisk
--markdown-list-marker <markdown-list-marker>The marker of the unordered lists of the Markdown output: '-', '*' or '+'-
--markdown-unknown-elements <PassThrough\|Strip\|StripKeepContent>What the Markdown output does with the HTML elements Markdown cannot representPassThrough
--markdown-complex-tables <Flatten\|Html>What the Markdown output does with the tables a pipe table cannot representFlatten
--comic-image-format <Jpeg\|Keep\|Png\|WebP>The format of the images of a comic book archive output (CBZ, CB7, CBT). Keep copies the JPEG, PNG, GIF and WebP images as they are, and writes the other pages as PNGKeep
--archive-password <archive-password>The password of the encrypted archive inputs (zip, 7z, RAR)
--archive-compression-level <Fastest\|NoCompression\|Optimal\|SmallestSize>The compression level of an archive output. Default: Optimal, and no compression for the images of a comic book archive
--zip-compression-method <BZip2\|Deflate\|Lzma\|Ppmd\|Stored\|Xz\|Zstandard>The compression method of the entries of a zip output. Default: Deflate. Zstandard needs .NET 11
--zip-password <zip-password>Encrypt the entries of a zip output with this password
--zip-encryption <Aes128\|Aes192\|Aes256\|ZipCrypto>The encryption of the entries of a zip output, with --zip-password. ZipCrypto is weak, but older tools read only this oneAes256
--7z-compression-method <BZip2\|Copy\|Deflate\|Lzma\|Lzma2\|Ppmd>The compression method of a 7z output. Default: Lzma2
--7z-solidCompress the files of a 7z output together, which makes it smaller. Use '--7z-solid false' to compress each file on its own. Default: true
--7z-password <7z-password>Encrypt the content of a 7z output with this password (AES-256)
--7z-encrypt-headersAlso encrypt the names of the files of a 7z output, with --7z-password
-?, -h, --helpShow help and usage information
--versionShow version information