Coder Social home page Coder Social logo

codespearhead / word-to-pdf-api Goto Github PK

View Code? Open in Web Editor NEW
6.0 1.0 3.0 51 KB

Simple Flask API to convert Microsoft Word files (DOC/DOCX) to PDF

License: Apache License 2.0

Python 87.22% Dockerfile 12.78%
doc-to-pdf docx-to-pdf pdf-generation word-to-pdf

word-to-pdf-api's Introduction




Simple Flask API to convert Microsoft Word files (DOC/DOCX) to PDF


QuickStart

Note: You'll need to have the latest version of the Docker Engine and Docker Compose installed on your machine

  1. Clone the repository and cd into it:
git clone https://github.com/codespearhead/doc-to-file-api
cd doc-to-file-api
  1. Spin up the API

Note: The container will take a while to boot because "libreoffice" is a rather large dependency. Luckily, Flask's built-in web server will auto-reload the Flask app once changes are made to the server.py and saved, since the Flask app's running in debug mode.

docker compose up
  1. Check if the API is working:

3.1. (UI) Go to http://localhost:5000/doc_to_pdf, select a local DOC or DOCX file, such as the one in ./mre/dummy_doc.docx, then press upload and see whether a PDF file is either displayed on the browser or downloaded automatically.

3.2. (API) Send a dummy DOC or DOCX file to it via a POST request and see whether a file named "output.pdf" has been created in the project's root directory:

python client.py

word-to-pdf-api's People

Contributors

blackphlox avatar codespearhead avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.