Skip to content

velesco/pdfConvert

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

DOCX to PDF Converter Service

This service is a simple Flask-based application that converts DOCX documents to PDFs using LibreOffice. It was containerized via Docker.

Files

  • app.py: Main Flask application that handles document conversion.
  • DockerFile: Docker configuration to build the container image.
  • requirements.txt: Python dependencies required for the application.

How to Run Locally

  1. Install Dependencies:

    pip install -r requirements.txt
    
  2. Run the Application:

    python app.py
    

The server will start on port 8820.

Using Docker

  1. Build the Docker Image:

    docker build -f DockerFile -t docx-to-pdf .
    
  2. Run the Docker Container:

    docker run -p 8820:8820 docx-to-pdf
    

API Endpoint

API Endpoint

  • POST /convert

    • Description: Convert an uploaded DOCX file to a PDF.
    • Form Data:
      • document — DOCX file to convert.
    • Response: On success, returns the converted PDF file as an attachment.

Troubleshooting

  • Ensure Docker is installed if running in a container.
  • Confirm LibreOffice is correctly installed in the Docker image.
  • Check logs for any errors printed by the application.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages