diff --git a/backend/app/routers/translate.py b/backend/app/routers/translate.py index fd68f65..69e75b2 100644 --- a/backend/app/routers/translate.py +++ b/backend/app/routers/translate.py @@ -596,8 +596,10 @@ async def download_translated_pdf( try: # Get source file path for images if available source_file_path = None - if task.file_path and Path(task.file_path).exists(): - source_file_path = Path(task.file_path) + if task.files and len(task.files) > 0: + stored_path = task.files[0].stored_path + if stored_path and Path(stored_path).exists(): + source_file_path = Path(stored_path) success = pdf_generator_service.generate_translated_pdf( result_json_path=result_json_path,