Command Line Interface

Installing the groupdocs-conversion-net package also puts a groupdocs-conversion console script on your PATH. It is a thin wrapper over the Python API, built for the cases where spinning up a Python script is overkill — shell pipelines, Make rules, CI steps, and one-off conversions.

Prerequisites

The CLI ships inside the package, so no extra installation is needed. Make sure groupdocs-conversion-net is installed (see the Quick Start Guide), then verify the console script is available:

groupdocs-conversion --version

You should see the package version printed, for example groupdocs-conversion 26.5.0.

Note
If the groupdocs-conversion command is not found, the package’s script directory may not be on your PATH. You can always invoke the CLI through the Python module form instead: python -m groupdocs.conversion. The two are equivalent.

Commands

The CLI exposes four subcommands. Run groupdocs-conversion --help for the full flag listing, or groupdocs-conversion <command> --help for a specific subcommand.

convert

Convert a document to another format. The target format is inferred from the output file extension; pass --format to override it.

# Extension picks the target format
groupdocs-conversion convert business-plan.docx business-plan.pdf

# Override the format when the output name doesn't carry a usable extension
groupdocs-conversion convert business-plan.docx output.bin --format pdf

# Convert a single page (1-indexed) — useful for raster targets
groupdocs-conversion convert annual-review.pdf page1.png --page 1 --count 1

# Open a password-protected source
groupdocs-conversion convert protected.docx protected.pdf --password "secret"
OptionDescription
--formatTarget format token (overrides the output extension).
--passwordPassword for a protected source document.
--pageFirst page to convert, 1-indexed.
--countNumber of pages to convert.

On success the command prints the output path and exits with code 0.

info

Print basic information about a document — format, size, page count, and creation date when available.

groupdocs-conversion info annual-review.pdf
format:         pdf
size:           291788
pages_count:    10

Use --password for protected sources.

list-formats

List every target format the engine can produce for a given input document, split into primary and secondary targets.

groupdocs-conversion list-formats business-plan.docx

Use --password for protected sources.

list-all-formats

Print the full source-to-target conversion matrix known to the engine — every input format and the targets it can be converted to.

groupdocs-conversion list-all-formats

This command takes no input file.

Global options

These options apply to every command:

OptionDescription
--license PATHApply a license file before running the command.
--versionPrint the CLI version and exit.
--helpShow usage help and exit.

Apply a license up front by placing --license before the subcommand:

groupdocs-conversion --license GroupDocs.Conversion.lic convert business-plan.docx business-plan.pdf
Note
The CLI also honours the GROUPDOCS_LIC_PATH environment variable — if it is set, the license is applied automatically and you can omit --license. See the Licensing topic for details.

Format tokens

convert maps the output extension — or the --format value, lowercased — to the matching convert options and file type. The supported tokens are:

CategoryTokens
PDFpdf
Word processingdoc, docx, rtf, odt, txt, md
Spreadsheetxls, xlsx, xlsm, ods, csv, tsv
Presentationppt, pptx, pptm, odp
Webhtml, htm, mhtml
Imagejpg, jpeg, png, bmp, gif, tiff, tif, webp, svg
eBookepub, mobi, azw3

An unknown token causes the command to exit with code 2 and print the list of accepted tokens.

Exit codes

CodeMeaning
0Success.
2User error — unknown format token or missing input file.
1Runtime error — the underlying .NET exception message is printed to standard error.

These codes make the CLI easy to branch on in shell scripts and CI pipelines.

When to use the Python API instead

The CLI covers the common single-document conversion cases. For anything beyond that — per-page callbacks, in-memory streams, watermark, font, or cell-range options, and multi-document container hierarchies — use the Python API directly. It exposes a richer surface than the CLI flags. See the Developer Guide for the full feature set.

Next Steps

Close
Loading

Analyzing your prompt, please hold on...

An error occurred while retrieving the results. Please refresh the page and try again.