File Conversion API
Product Page | Docs | Demos | API Reference | Blog | Search | 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.
Features
- Wide Format Support: Supports over 10,000 conversion pairs across popular formats like Microsoft Office, PDF, HTML, and more.
- Flexible Conversion Options: Convert entire documents, specific pages, page ranges, or files within document containers such as compressed files.
- Format Detection: Automatically detects the format of input files.
Supported File Formats
GroupDocs.Conversion supports a wide range of file formats. For a complete list, see the full list of supported formats.
- Microsoft Office (Word, Excel, PowerPoint)
- PDF (Standard PDFs, PDF/A)
- OpenDocument (ODT, ODS, ODP)
- Images (JPEG, PNG, TIFF)
- Email (EML, MSG)
- eBook (EPUB, MOBI)
- Text/Markdown (TXT, MD)
- HTML/Web (HTML, MHTML)
- AutoCAD (DWG, DXF)
- 3D Models (OBJ, 3DS)
Get Started
Ensure that Python 3.9 and the .NET 6 runtime (or higher) are installed on your system.
To install the package, run:
pip install groupdocs-conversion-net
If you already have the package installed and want to update to the latest version, run:
pip install --upgrade groupdocs-conversion-net
Here are some common use cases to get started.
Example 1: Convert a Document to Another Format
The following example demonstrates how to convert a DOCX file to PDF:
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
def convert_document_to_another_format():
with Converter("./business-plan.docx") as converter:
pdf_convert_options = PdfConvertOptions()
converter.convert("./business-plan.pdf", pdf_convert_options)
if __name__ == "__main__":
convert_document_to_another_format()
Example 2: Convert All Pages of a Document
The following example demonstrates how to convert each slide in a PPTX presentation to a PNG image and save the output images to a specified folder.
from groupdocs.conversion import Converter
from groupdocs.conversion.filetypes import ImageFileType
from groupdocs.conversion.options.convert import ImageConvertOptions
def convert_all_document_pages():
with Converter("./basic-presentation.pptx") as converter:
png_convert_options = ImageConvertOptions()
png_convert_options.format = ImageFileType.PNG
converter.convert_by_page("./converted-pages", png_convert_options)
if __name__ == "__main__":
convert_all_document_pages()
Example 3: Convert Files Within Document Container
The following example demonstrates how to convert each compressed file in ZIP archive to PDF:
from groupdocs.conversion import Converter
from groupdocs.conversion.options.convert import PdfConvertOptions
def convert_files_within_document_container():
with Converter("./compressed.zip") as converter:
pdf_convert_options = PdfConvertOptions()
converter.convert_multiple("./converted-files", pdf_convert_options)
if __name__ == "__main__":
convert_files_within_document_container()
More Resources
Find more details and examples in the GroupDocs.Conversion for Python via .NET documentation.
We also provide GroupDocs.Conversion packages for other platforms:
Product Page | Docs | Demos | API Reference | Blog | Search | Free Support | Temporary License