Skip to content

About

Node.js service that converts any document (PDF, DOCX, PPTX, etc.) to its HTML equivalent.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

📝 Doc-to-HTML Conversion Service

A Node.js-based service that converts .docx and .pdf documents to HTML with high layout fidelity. Ideal for resume parsing, previews, and web-based document viewers.


🚀 Features

  • 🧠 Converts .docx using LibreOffice
  • 🖼️ Converts .pdf using pdf2htmlEX
  • 📄 Preserves original layout, fonts, and formatting
  • ⚙️ Built with Node.js + Docker
  • 🌐 Preview rendered HTML directly in the browser

📁 Project Structure

doc-to-html-service/
├── Dockerfile
├── docker-compose.yml
├── server.js
├── package.json
├── uploads/               # Uploaded files (auto-created)
├── converted/             # Output HTML files (auto-created)
└── public/
    └── index.html         # Simple HTML upload interface

🧑‍💻 Prerequisites


⚙️ Setup & Run

# Build the container
docker compose build --no-cache

# Start the service
docker compose up

Once running, open your browser to:

http://localhost:3000

Upload a .docx or .pdf file and preview the converted HTML in the embedded iframe.


📦 API

POST /upload

Upload a file using multipart/form-data.

Field name: document

Response:

{
  "message": "Converted successfully",
  "htmlUrl": "/converted/your-file-name.html"
}

🧠 Technologies Used


🧹 Notes

  • All uploaded and converted files are stored locally in uploads/ and converted/.
  • You can mount volumes or persist data externally in production.
  • pdf2htmlEX builds from source (adds time to Docker build).

📜 License

ISC

About

Node.js service that converts any document (PDF, DOCX, PPTX, etc.) to its HTML equivalent.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages