fix table

This commit is contained in:
2026-09-02 15:42:48 +03:00
parent dd235f675c
commit 22c7ab7140
7 changed files with 554 additions and 42 deletions
+7 -3
View File
@@ -31,10 +31,12 @@ from app.services.pdf_export import export_pdf
from app.services.project_service import get_project_full, ingest_zip, project_dir
from app.services.project_settings import (
TABLE_SETTINGS_META,
get_property_names,
get_font_stretch,
get_project_params_map,
get_property_names,
get_table_settings,
resolve_inscriptions,
save_cell_overflows,
update_table_settings,
)
from app.services.table_service import (
@@ -328,11 +330,13 @@ def export_document(project_id: int, body: ExportRequest, db: Session = Depends(
)
if body.format == "pdf":
try:
data = export_pdf(body.table_type, rows, resolved_inscriptions)
stretch = get_font_stretch(db, project_id, body.table_type)
result = export_pdf(body.table_type, rows, resolved_inscriptions, font_stretch=stretch)
save_cell_overflows(db, project_id, body.table_type, result.overflows)
except ValueError as e:
raise HTTPException(400, str(e)) from e
return Response(
content=data,
content=result.data,
media_type="application/pdf",
headers={
"Content-Disposition": f'attachment; filename="{project.name}_{body.table_type}.pdf"'