Skip to main content

GroupDocs.Conversion for Python via .NET - Document conversion API supporting 10,000+ format combinations

Project description

banner

PyPI PyPI - Python Version

Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

GroupDocs.Conversion for Python via .NET is a document conversion API that lets you easily convert the most popular file formats, including DOCX, XLSX, PPTX, PDF, CAD drawings, and many more. It preserves layout and formatting while offering customization options for each format.

Get Started

pip install groupdocs-conversion-net
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("document.docx") as converter:
    converter.convert("output.pdf", PdfConvertOptions())

How It Works

The package is a self-contained Python wheel (~200 MB) that includes everything needed to process documents. No external software installation is required - just pip install and start converting. The wheel works across Python 3.5 - 3.14 on Windows, Linux, and macOS (Intel + Apple Silicon).

Features

  • Wide Format Support: Over 10,000 conversion pairs across Microsoft Office, PDF, HTML, images, CAD, and more.
  • Flexible Options: Convert entire documents, specific pages, page ranges, or files within archives.
  • Format Detection: Automatically detects input file format.
  • No External Dependencies: No Microsoft Office or other software required.
  • Cross-Platform: Windows x64/x86, Linux x64, macOS x64/ARM64.

Supported File Formats

For a complete list, see supported formats.

  • Microsoft Office (Word, Excel, PowerPoint)
  • PDF (Standard PDFs, PDF/A)
  • OpenDocument (ODT, ODS, ODP)
  • Images (JPEG, PNG, TIFF, BMP, SVG, WebP)
  • Email (EML, MSG)
  • eBook (EPUB, MOBI)
  • Text/Markup (TXT, MD, HTML, MHTML)
  • AutoCAD (DWG, DXF)

Examples

Convert DOCX to PDF

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with Converter("./business-plan.docx") as converter:
    converter.convert("./business-plan.pdf", PdfConvertOptions())

Convert with Advanced Options

from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
from groupdocs.conversion.options.load import WordProcessingLoadOptions

load_options = WordProcessingLoadOptions()
load_options.password = "12345"

with Converter("./protected.docx", load_options) as converter:
    options = PdfConvertOptions()
    options.dpi = 300
    options.page_number = 1
    options.pages_count = 2
    converter.convert("./output.pdf", options)

Get Document Info

from groupdocs.conversion import Converter

with Converter("./document.pdf") as converter:
    info = converter.get_document_info()
    print(f"Pages: {info.pages_count}")

Convert from Stream / BytesIO

import io
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions

with open("document.docx", "rb") as stream:
    with Converter(stream) as converter:
        converter.convert("output.pdf", PdfConvertOptions())

buf = io.BytesIO(downloaded_bytes)
with Converter(buf) as converter:
    converter.convert("output.pdf", PdfConvertOptions())

Command Line

Installing the wheel also puts groupdocs-conversion on PATH. Target format is inferred from the output extension; pass --format to override.

# Convert (extension picks the format)
groupdocs-conversion convert input.docx output.pdf
groupdocs-conversion convert input.docx page1.jpg --page 1 --count 1
groupdocs-conversion convert protected.docx out.pdf --password "secret"

# Inspect
groupdocs-conversion info input.pdf
groupdocs-conversion list-formats input.docx       # primary + secondary targets
groupdocs-conversion list-all-formats              # full source -> target matrix

# Apply a license up-front
groupdocs-conversion --license license.lic convert in.docx out.pdf

# Equivalent module form
python -m groupdocs.conversion convert in.docx out.pdf

Exit codes: 0 success, 2 user error (unknown format, missing input), 1 runtime error.

AI Agent & LLM Friendly

This package is designed for seamless integration with AI agents, LLMs, and automated code generation tools.

  • AGENTS.md in the package — AI coding assistants (Claude Code, Cursor, GitHub Copilot) auto-discover the API surface, usage patterns, and troubleshooting tips from the installed package
  • MCP server — connect your AI tool to GroupDocs documentation for on-demand API lookups:
    { "mcpServers": { "groupdocs-docs": { "url": "https://docs.groupdocs.com/mcp" } } }
    
  • Machine-readable docs — full documentation available as plain text for RAG and LLM context:
    • Single file: https://docs.groupdocs.com/conversion/python-net/llms-full.txt
    • Per page: append .md to any docs URL

Evaluation Mode

The API works without a license in evaluation mode with the following limitations:

  • A watermark is added to output documents.
  • Only the first 3 pages are processed.

To remove these limitations, apply a license or request a temporary license:

from groupdocs.conversion import License
License().set_license("path/to/license.lic")

Or set the environment variable (auto-applied at import):

export GROUPDOCS_LIC_PATH="path/to/license.lic"

Troubleshooting

Issue Platform Fix
System.Drawing.Common is not supported Linux/macOS apt-get install libgdiplus (Linux) or brew install mono-libgdiplus (macOS)
Garbled text or missing fonts in PDF Linux apt-get install ttf-mscorefonts-installer fontconfig && fc-cache -f
The type initializer for 'Gdip' threw an exception macOS brew install mono-libgdiplus
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT errors Linux Do NOT set this variable. ICU must be available.

System Requirements

  • Python 3.5 - 3.14
  • Windows x64/x86, Linux x64, macOS x64/ARM64

More Resources

Also available for other platforms: .NET | Java | Node.js


Product Page | Docs | Demos | API Reference | Blog | Free Support | Temporary License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

groupdocs_conversion_net-26.5.0-py3-none-win_amd64.whl (201.6 MB view details)

Uploaded Python 3Windows x86-64

groupdocs_conversion_net-26.5.0-py3-none-macosx_11_0_arm64.whl (200.0 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

groupdocs_conversion_net-26.5.0-py3-none-macosx_10_14_x86_64.whl (202.2 MB view details)

Uploaded Python 3macOS 10.14+ x86-64

File details

Details for the file groupdocs_conversion_net-26.5.0-py3-none-win_amd64.whl.

File metadata

File hashes

Hashes for groupdocs_conversion_net-26.5.0-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 70bcb1f7096c22ce67b01c4deb408694ebd5efa75363a360101c47b862643a08
MD5 5a2ea849ffce8389aa339a09a71e4af8
BLAKE2b-256 bb9164dbff9a0865ec2156823bc6b4edb126bbc52262f3458d13c15496735790

See more details on using hashes here.

File details

Details for the file groupdocs_conversion_net-26.5.0-py3-none-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for groupdocs_conversion_net-26.5.0-py3-none-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 a9fd5245f15e63d212dcbb79b44b91f8d504d9d8e6ef84ff889b03873474fda1
MD5 be6f5a2d458a9ebf0e9fa9a376842b0b
BLAKE2b-256 abd83e5ed5533baa560de7359d84e62bd62f0e48ed6ab458932a3a11701b9481

See more details on using hashes here.

File details

Details for the file groupdocs_conversion_net-26.5.0-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for groupdocs_conversion_net-26.5.0-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 04090c6c50cae2977886e8da1c6e08fc90a0479d84614cf773a2d8ffe6db853f
MD5 1733603d58bb8931bdde6759ac496522
BLAKE2b-256 b563c19c7d20c57d683f963204cec184e8960d2e5c93c1829f4303a4ebc7a3c6

See more details on using hashes here.

File details

Details for the file groupdocs_conversion_net-26.5.0-py3-none-macosx_10_14_x86_64.whl.

File metadata

File hashes

Hashes for groupdocs_conversion_net-26.5.0-py3-none-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 a1f49cd472ec454ce24df996d8aa52c302a30297614f5c364cb46be0c7777d32
MD5 505697eb40af9e735000024469ad8c78
BLAKE2b-256 1e946c876d463d77977165f16fd38bc0e0ca17864387481f2e694d8d1a3f26be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page