A web application that translates Word and PDF documents to different languages while preserving formatting, and exports the result as a Word document.
- Upload DOCX / PDF documents
- Extract text and formatting (bold, italic, headers, lists)
- Translate content to multiple languages using OpenAI's API
- Preserve document structure and formatting as much as possible
- Export as Word document (.docx)
- Node.js 18 or later
- npm or yarn
- OpenAI API key
-
Clone the repository:
git clone <repository-url> cd translate-pdf-to-word
-
Install dependencies:
npm install
-
Create a
.envfile in the root directory and add your OpenAI API key:OPENAI_API_KEY=your_api_key_here -
Start the development server:
npm run dev
-
Open http://localhost:3000 in your browser.
- Click the upload button to select a file
- Choose the source and target languages
- Enable/disable formatting preservation
- Add any custom translation instructions (optional)
- Click "Translate" to start the process
- Review and edit the translated content in the preview
- Click "Download as Word" to save the document
- Next.js 14
- TypeScript
- TipTap Editor
- PDF.js
- docx
- OpenAI GPT-4
- Tailwind CSS
- Shadcn/ui
- Mammoth
MIT