ChristopherJKoen commited on
Commit
bcb6323
·
1 Parent(s): 6df55ab

Pre Data Trans

Browse files
frontend/src/pages/ExportPage.tsx CHANGED
@@ -290,6 +290,7 @@ export default function ExportPage() {
290
  </button>
291
  </div>
292
  </div>
 
293
  </div>
294
  </div>
295
 
 
290
  </button>
291
  </div>
292
  </div>
293
+
294
  </div>
295
  </div>
296
 
server/app/api/routes/sessions.py CHANGED
@@ -310,6 +310,8 @@ def export_pdf(
310
  )
311
 
312
 
 
 
313
  @router.get("/{session_id}/export.xlsx")
314
  def export_excel(
315
  session_id: str, store: SessionStore = Depends(get_session_store)
 
310
  )
311
 
312
 
313
+
314
+
315
  @router.get("/{session_id}/export.xlsx")
316
  def export_excel(
317
  session_id: str, store: SessionStore = Depends(get_session_store)
server/app/services/pdf_reportlab.py CHANGED
@@ -218,6 +218,10 @@ def render_report_pdf(
218
  header_h = 20 * mm
219
  footer_h = 8 * mm
220
  gap = 4 * mm
 
 
 
 
221
 
222
  gray_50 = colors.HexColor("#f9fafb")
223
  gray_200 = colors.HexColor("#e5e7eb")
@@ -264,7 +268,7 @@ def render_report_pdf(
264
  if path and path.exists():
265
  label = _safe_text(item.get("name") or path.name)
266
  photo_entries.append({"path": path, "label": label})
267
- chunks = _chunk(photo_entries, 6) or [[]]
268
  for chunk_index, chunk in enumerate(chunks):
269
  print_pages.append(
270
  {
@@ -563,7 +567,7 @@ def render_report_pdf(
563
  y -= 8 * mm
564
 
565
  photo_area_top = y
566
- photo_area_height = max(40 * mm, photo_area_top - content_bottom)
567
 
568
  if photos:
569
  columns = 1 if len(photos) == 1 else 2
@@ -605,4 +609,3 @@ def render_report_pdf(
605
 
606
  pdf.save()
607
  return output_path
608
-
 
218
  header_h = 20 * mm
219
  footer_h = 8 * mm
220
  gap = 4 * mm
221
+ photo_col_gap = 6 * mm
222
+ min_photo_cell_w = 80 * mm
223
+ two_col_cell_w = (width - 2 * margin - photo_col_gap) / 2
224
+ max_photos_per_page = 6 if two_col_cell_w >= min_photo_cell_w else 2
225
 
226
  gray_50 = colors.HexColor("#f9fafb")
227
  gray_200 = colors.HexColor("#e5e7eb")
 
268
  if path and path.exists():
269
  label = _safe_text(item.get("name") or path.name)
270
  photo_entries.append({"path": path, "label": label})
271
+ chunks = _chunk(photo_entries, max_photos_per_page) or [[]]
272
  for chunk_index, chunk in enumerate(chunks):
273
  print_pages.append(
274
  {
 
567
  y -= 8 * mm
568
 
569
  photo_area_top = y
570
+ photo_area_height = max(0, photo_area_top - content_bottom)
571
 
572
  if photos:
573
  columns = 1 if len(photos) == 1 else 2
 
609
 
610
  pdf.save()
611
  return output_path