Docker container allowing you to convert docx files to pdf.
3.1K
This project contains Docx PDF Converter's code.
This web service allows you to send a docx file and get it in PDF.
You need the following softwares installed on your operating system:
poetryIn order to install poetry and make it available for all users, do the following:
$ sudo mkdir /opt/poetry$ sudo chown $USER:odoo /opt/poetry$ chmod g+w /opt/poetry$ curl -sSL https://install.python-poetry.org | POETRY_HOME=/opt/poetry python3 -sudo vim /etc/profile.d/poetry.shexport PATH="/opt/poetry/bin:$PATH", save & exit ([ESC] + :wq)To install the project, do the following:
poetry installgunicorn docx_web_service.app:app)The route to convert a .docx document to .pdf document is /convert.
The application expects a multipart-data form in the request. If you are using curl you can convert a document by running curl --insecure -X POST http://<docx-converter-host-ip>:8000/convert -F "file=@tests/fixtures/test.docx" --output output.pdf.
The Content-Type of the response is application/pdf so the service's response is a binary response.
To run the tests, simply run make test.
To lint the files, run make lint.
To formate the code, run make fix.
Docker container allowing you to convert docx files to pdf.
Dockerfile linksHere is an example of docker-compose.yml.
version: '3.9'
services:
converter:
image: vnvsa/docx-pdf-converter:latest
ports:
- '8000:8000'
you can then convert files using curl:
curl --request POST \
--url http://localhost:8000/convert \
--header 'content-type: multipart/form-data' \
--form 'file=@full_path_to_file\test.docx'
Pull requests, bug reports, and feature requests are welcome.
If you want to use this with Eole :
docker-compose.yml filevnv.odt.template.config.pdf.server.url. Set the value http://host.docker.internal:8000 or http://<container_name>:8000 for the parameter. For example : http://odoo-stack-docx_pdf_converter-1:8000 in the second case.MIT License. See the LICENSE file.
Content type
Image
Digest
sha256:a80199aae…
Size
706.8 MB
Last updated
4 days ago
docker pull vnvsa/docx-pdf-converter