diff --git a/backend/app/main.py b/backend/app/main.py index 1c0d934..a990a31 100644 --- a/backend/app/main.py +++ b/backend/app/main.py @@ -1783,7 +1783,11 @@ def export_inspection_to_pdf( pdf_url = f"{S3_ENDPOINT}/{S3_PDF_BUCKET}/{s3_key}" inspection.pdf_url = pdf_url db.commit() - return {"pdf_url": pdf_url} + # Descargar el PDF directamente + buffer.seek(0) + return StreamingResponse(buffer, media_type="application/pdf", headers={ + "Content-Disposition": f"attachment; filename={filename}" + }) # ============= HEALTH CHECK =============