fix table
This commit is contained in:
@@ -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"'
|
||||
|
||||
Reference in New Issue
Block a user