don770omr commited on
Commit
101650b
·
verified ·
1 Parent(s): 50bfc11

Update utils.py

Browse files
Files changed (1) hide show
  1. utils.py +10 -6
utils.py CHANGED
@@ -47,23 +47,27 @@ def generate_pdf(df_combined, company_name, address, unit):
47
  # Create a canvas for the PDF
48
  c = canvas.Canvas(buffer, pagesize=letter)
49
  width, height = letter
50
-
 
51
  # Company details
52
  c.setFont("Helvetica", 12)
53
- c.drawString(30, height - 40, f"Company Name: {company_name}")
54
- c.drawString(30, height - 60, f"Address: {address}")
 
55
 
56
  # Draw a line under the address
 
57
  c.setStrokeColor(colors.black)
58
  c.setLineWidth(1)
59
- c.line(30, height - 70, width - 30, height - 70) # Draw line under the address
60
 
61
  # Title
 
62
  c.setFont("Helvetica-Bold", 16)
63
- c.drawString(30, height - 100, f"Dimensions Calculation Results: for units ({unit})")
64
 
65
  # Calculate the y-position to avoid overlapping
66
- y_position = height - 450
67
 
68
  # Create and style the table
69
  data = [["Sl no", "Type", "Outer Frame", "Shutter", "Glass", "Area"]] # Table Header
 
47
  # Create a canvas for the PDF
48
  c = canvas.Canvas(buffer, pagesize=letter)
49
  width, height = letter
50
+
51
+ y_position = height - 40
52
  # Company details
53
  c.setFont("Helvetica", 12)
54
+ c.drawString(30, y_position, f"Company Name: {company_name}")
55
+ y_position -= 20
56
+ c.drawString(30, y_position, f"Address: {address}")
57
 
58
  # Draw a line under the address
59
+ y_position -= 10
60
  c.setStrokeColor(colors.black)
61
  c.setLineWidth(1)
62
+ c.line(30, y_position, width - 30, y_position) # Draw line under the address
63
 
64
  # Title
65
+ y_position -= 30
66
  c.setFont("Helvetica-Bold", 16)
67
+ c.drawString(30, y_position, f"Dimensions Calculation Results: for units ({unit})")
68
 
69
  # Calculate the y-position to avoid overlapping
70
+ y_position -= 20
71
 
72
  # Create and style the table
73
  data = [["Sl no", "Type", "Outer Frame", "Shutter", "Glass", "Area"]] # Table Header