A simple Streamlit application for translating PDF documents using the DeepL API.
- Two-column layout: Upload on the left, view translated document on the right
- PDF information display: Shows number of pages and file size
- Real-time translation progress: Displays spinner with time remaining
- PDF viewer: Built-in PDF.js viewer for the translated document
- Download functionality: Download the translated PDF
- Multiple languages: Support for Spanish, French, German, Italian, Portuguese, Russian, Chinese, and Japanese
-
Clone the repository (if applicable) or ensure you have all the files
-
Install dependencies:
pip install -r requirements.txt
-
Get a DeepL API key:
- Go to DeepL API
- Sign up for an account
- Get your API key from the dashboard
-
Run the Streamlit app:
streamlit run app.py
-
Enter your DeepL API key in the sidebar
-
Select target language from the dropdown in the sidebar
-
Upload a PDF file using the file uploader on the left side
-
View document info: The app will display the number of pages and file size
-
Click "Translate Document" to start the translation process
-
Monitor progress: Watch the spinner and time remaining on the right side
-
View and download: Once complete, view the translated PDF and download it
- Python 3.7+
- DeepL API key (Free or Pro account)
- Internet connection for API calls
streamlit
: Web app frameworkdeepl
: Official DeepL Python clientPyPDF2
: PDF manipulation libraryrequests
: HTTP library for API callsstreamlit-pdf-viewer
: PDF viewing component
- PDF files only (
.pdf
)
- Spanish (ES)
- French (FR)
- German (DE)
- Italian (IT)
- Portuguese (PT)
- Russian (RU)
- Chinese (ZH)
- Japanese (JA)
- The app uses DeepL's document translation API which preserves formatting
- Translation time depends on document size and API response time
- Free DeepL accounts have usage limits
- Large files may take longer to process
- API Key Issues: Make sure your DeepL API key is valid and has sufficient quota
- PDF Reading Errors: Ensure your PDF is not corrupted or password-protected
- Translation Failures: Check your internet connection and API quota
- Display Issues: Try refreshing the page if the PDF viewer doesn't load properly