This service is a simple Flask-based application that converts DOCX documents to PDFs using LibreOffice. It was containerized via Docker.
- 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.
-
Install Dependencies:
pip install -r requirements.txt
-
Run the Application:
python app.py
The server will start on port 8820.
-
Build the Docker Image:
docker build -f DockerFile -t docx-to-pdf .
-
Run the Docker Container:
docker run -p 8820:8820 docx-to-pdf
-
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.
- 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.