# Change: Add Translated PDF Export ## Why The current translation feature produces JSON output files (`{filename}_translated_{lang}.json`) but does not support generating translated PDFs. Users need to download translated documents in PDF format with the original layout preserved but with translated text content. This is essential for document localization workflows where the final deliverable must be a properly formatted PDF. ## What Changes - **PDF Generator**: Add translation parameter support to `PDFGeneratorService` - **Translation Merger**: Create logic to merge translation JSON with UnifiedDocument - **API Endpoint**: Add `POST /api/v2/translate/{task_id}/pdf` endpoint - **Frontend UI**: Add "Download Translated PDF" button in TaskDetailPage - **Batch Translation Enhancement**: Improve batch response parsing for edge cases ## Impact - **Affected specs**: `translation`, `result-export` - **Affected code**: - `backend/app/services/pdf_generator_service.py` - Add translation rendering - `backend/app/services/translation_service.py` - Add PDF generation integration - `backend/app/routers/translate.py` - Add PDF download endpoint - `frontend/src/pages/TaskDetailPage.tsx` - Add PDF download button - `frontend/src/services/apiV2.ts` - Add PDF download API method ## Non-Goals - Editing translated text before PDF export (future feature) - Supporting formats other than PDF (Excel, Word) - Font substitution for different target languages