Skip to content

Apolake/pptxdocx2pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Office ⇄ PDF Converter

Node.js + React app to batch-convert DOCX/PPTX to PDF and PDF back to DOCX/PPTX using LibreOffice headless mode.

Prerequisites

  • Node.js 18+
  • LibreOffice installed.
    • Preferred: add soffice to PATH.
    • Windows: set SOFFICE_PATH in server/.env to the full exe path, e.g. C:\\Program Files\\LibreOffice\\program\\soffice.exe.
    • If you see spawn soffice ENOENT, the backend cannot find the binary—set SOFFICE_PATH or add LibreOffice to PATH and restart npm run dev.

Quick start

  1. Backend
cd server
npm install
cp .env.example .env  # on Windows: copy .env.example .env
npm run dev
  1. Frontend (new terminal)
cd web
npm install
npm run dev
  1. Open the UI at the URL printed by Vite (defaults to http://localhost:5173). The UI proxies API calls to http://localhost:4000.

API

  • POST /api/convert
    • Form-data fields: files (one or many), targetFormat (pdf | docx | pptx)
    • Response: { jobId, targetFormat, results: [{ input, output, url, status, error? }] }
  • GET /api/health

Supported directions:

  • targetFormat=pdf → accepts .doc, .docx, .ppt, .pptx
  • targetFormat=docx → accepts .pdf (LibreOffice draw import → DOCX)
  • targetFormat=pptx → accepts .pdf (LibreOffice draw import → PPTX)

Outputs are served for download from /downloads/{jobId}/{file} and cleaned after OUTPUT_TTL_MINUTES (default 60).

Configuration

Set in server/.env:

  • PORT (default 4000)
  • CONCURRENCY (queue parallelism, default 1 for sequential safety)
  • SOFFICE_PATH (path to LibreOffice executable)
  • CONVERSION_TIMEOUT_MS (per-file cap)
  • CONVERSION_RETRIES (per-file attempts, default 5)
  • OUTPUT_TTL_MINUTES (how long to keep artifacts)

Notes

  • PDF→DOCX/PPTX quality depends on LibreOffice import fidelity; complex layouts may shift.
  • Temp uploads are removed after each job; output folders are pruned on an interval.

Key files

OIIAI

signed by Otaku

About

Converts Files from pptx and docx to pdf and vice versa in Node.JS and using LibreOffice

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors