Skip to main content

This package aims to convert Office file types to PDF using Microsoft Office or LibreOffice.

Project description

msoffice2pdf

This package aims to convert Microsoft Office file types to PDF. This lib uses the comtypes package which makes it easy to access and implement custom, dispatch-based COM interfaces or LibreOffice software.

For use in Windows environment and soft="msoffice" Microsoft Office must be installed.

For use in Windows environment and soft="libreoffice" you need the latest version of LibreOffice(soffice) installed.

For Ubuntu(linux) environment it is only possible to use soft="libreoffice", that is, LibreOffice(soffice).

Supported files: [".doc", ".docx", ".xls", ".xlsx", ".ppt", ".pptx", ".txt", ".xml"]

Installation

Step 1:

pip3 install msoffice2pdf

Step 2(Windons Only):

Delete all cache files from the folder below in case there is any error with Microsoft Office conversion: C:\Users\<User>\AppData\Local\Programs\Python\Python39\Lib\site-packages\comtypes\gen

Example:

from msoffice2pdf import convert

output = convert(source="C:/Users/<User>/Downloads/file.docx", output_dir="C:/Users/<User>/Downloads", soft="msoffice")

print(output)

Project details


Download files

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

Source Distribution

msoffice2pdf-0.0.6.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

msoffice2pdf-0.0.6-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

Details for the file msoffice2pdf-0.0.6.tar.gz.

File metadata

  • Download URL: msoffice2pdf-0.0.6.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for msoffice2pdf-0.0.6.tar.gz
Algorithm Hash digest
SHA256 aabbb5c6c2a40c889c97dee8c3ce8ef9a6cc4ee0cd72371fbcbff3f51b7c8ad1
MD5 4cf93fd26be3e88b96ba04aebc73b584
BLAKE2b-256 240af85831d0c738c7f1386daf6569759d3969f8f292e8639ab467c36d358e12

See more details on using hashes here.

File details

Details for the file msoffice2pdf-0.0.6-py3-none-any.whl.

File metadata

  • Download URL: msoffice2pdf-0.0.6-py3-none-any.whl
  • Upload date:
  • Size: 3.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.23.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5

File hashes

Hashes for msoffice2pdf-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 525fc8c1c9fda3978d16281674d7f96de1ced2f30acd6c58e6dae81ef78580bd
MD5 af84af781846bb13c0994972b5cbe5bb
BLAKE2b-256 dab73addedc255f43c3bd0793bf5e7c41be142d9070a9e0ab40794433ee35513

See more details on using hashes here.

Supported by

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