Coders Packet

Convert Word file to PDF file using Python

By Suryansh Mamgain

A python script that will help you to convert docx file to pdf file using the docx2pdf module.

Python can be used to do too many amazing stuff and one of them is to convert docx to pdf.

For this, we will require the docx2pdf library of python.

Requirements:

    1. Install the docx2pdf module using the command given below in the terminal because this module doesn't come with python:

       pip install docx2pdf

Methodology:

    1. Import convert from docx2pdf module

    2. Pass the word file location and the pdf location inside the convert function

    3. Run the program

Download Complete Code

Comments

No comments yet