GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com β€” GitHub - CoderAyushman/pdf-converter: A Node.js backend to convert DOCX, PPTX, TXT, and other document formats to PDF using LibreOffice, with support for multiple uploads, Docker, and an EJS frontend.

BranchesTags
Open more actions menu

Latest commit

 

History

28 Commits
28 Commits

Folders and files

NameName
Last commit message
Last commit date
bin
bin
 
 
components
components
 
 
download
download
 
 
public
public
 
 
upload
upload
 
 
views
views
 
 
.gitignore
.gitignore
 
 
Dockerfile
Dockerfile
 
 
README.md
README.md
 
 
app.js
app.js
 
 
package-lock.json
package-lock.json
 
 
package.json
package.json
 
 

Repository files navigation

πŸ“„ PDF Converter – Node.js + LibreOffice + Docker

This is a file conversion backend built with Node.js that allows users to convert files like .docx, .txt, .pptx, etc., into PDF format using LibreOffice via the libreoffice-convert Node.js library. It supports multiple file uploads, uses Multer for handling file uploads, and Docker to ensure consistent LibreOffice availability across environments.


πŸš€ Features

  • βœ… Convert files to PDF (e.g. DOCX β†’ PDF, TXT β†’ PDF, PPTX β†’ PDF)
  • βœ… Multiple file upload support
  • βœ… Uses LibreOffice for high-quality conversion
  • βœ… Optional Docker setup for consistent environment
  • βœ… EJS web interface for quick browser testing
  • βœ… Organized code structure and response format

πŸ›  Tech Stack

  • Node.js
  • Express.js
  • Multer (File Upload Middleware)
  • LibreOffice (via libreoffice-convert)
  • Docker (optional)
  • EJS (for testing via browser)

πŸ“ Folder Structure

pdf-converter/
β”œβ”€β”€ upload/ # Uploaded input files
β”œβ”€β”€ download/ # Converted output PDFs
β”œβ”€β”€ components/
β”‚ └── fileConverter.js # Conversion logic using libreoffice-convert
β”œβ”€β”€ views/
β”‚ └── homepage.ejs # Web form to test file upload and conversion
β”œβ”€β”€ app.js # Main Express server
β”œβ”€β”€ Dockerfile # Docker config for LibreOffice
└── README.md


πŸ“¦ Supported Input File Types

The following MIME types and extensions can be accepted and converted to PDF:

<input type="file" name="files" accept=".doc,.docx,.xls,.xlsx,.ppt,.pptx,.odt,.ods,.odp,.txt,.rtf,.html,.csv" multiple />

Supported extensions:

    .doc, .docx

    .xls, .xlsx

    .ppt, .pptx

    .odt, .ods, .odp

    .txt, .rtf, .csv

    .html, .htm

βš™οΈ Setup Instructions
1. Clone the Repository

git clone https://github.com/CoderAyushman/pdf-converter.git
cd pdf-converter

2. Install Dependencies

npm install

🐳 Docker Setup

To ensure LibreOffice works in all environments, use Docker:
1. Build Docker Image

docker build -t pdf-converter .

2. Run Docker Container

docker run -p 4000:4000 pdf-converter

    LibreOffice is installed inside the Docker container, so you don’t need to install it manually.

🌐 Web Interface (EJS)

A simple HTML frontend is available:

http://localhost:4000

About

A Node.js backend to convert DOCX, PPTX, TXT, and other document formats to PDF using LibreOffice, with support for multiple uploads, Docker, and an EJS frontend.

pdf-converter-3dyd.onrender.com

Topics

dockerdocument-conversiondocx-to-pdfejsexpressjsfile-uploadfiles-to-pdflibreofficemulternodejspdf-converterpptx-to-pdftxt-to-pdf

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Contributors

Languages

You are visitor 01402520 β€” GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Γ—600. No cookies required.