Spaces:
Runtime error
Runtime error
Commit ·
8dc1ac9
1
Parent(s): 57e5629
fpdf2
Browse files
app/DocumentGeneration/live_pdf_generator.py
CHANGED
|
@@ -6,7 +6,7 @@ import io
|
|
| 6 |
import tempfile
|
| 7 |
import os
|
| 8 |
from typing import Dict, Any, Optional, AsyncGenerator
|
| 9 |
-
from
|
| 10 |
import base64
|
| 11 |
|
| 12 |
import sys
|
|
|
|
| 6 |
import tempfile
|
| 7 |
import os
|
| 8 |
from typing import Dict, Any, Optional, AsyncGenerator
|
| 9 |
+
from fpdf2 import FPDF
|
| 10 |
import base64
|
| 11 |
|
| 12 |
import sys
|
app/DocumentGeneration/pdf_generator.py
CHANGED
|
@@ -37,7 +37,7 @@ from utils import sort_sections_by_order
|
|
| 37 |
def calculate_real_page_numbers(request: ExportRequest, filtered_sections):
|
| 38 |
"""Calculate real page numbers by creating a temporary PDF with all content INCLUDING charts"""
|
| 39 |
try:
|
| 40 |
-
from
|
| 41 |
except ImportError:
|
| 42 |
raise Exception("fpdf2 is not installed. Please install it with: pip install fpdf2")
|
| 43 |
|
|
@@ -183,7 +183,7 @@ def create_pdf_document(request: ExportRequest):
|
|
| 183 |
"""Create a PROFESSIONAL PDF document from the business plan data using FPDF2
|
| 184 |
NOTE: Now uses matplotlib charts exclusively - old base64 chart logic commented out"""
|
| 185 |
try:
|
| 186 |
-
from
|
| 187 |
except ImportError:
|
| 188 |
raise Exception("fpdf2 is not installed. Please install it with: pip install fpdf2")
|
| 189 |
|
|
|
|
| 37 |
def calculate_real_page_numbers(request: ExportRequest, filtered_sections):
|
| 38 |
"""Calculate real page numbers by creating a temporary PDF with all content INCLUDING charts"""
|
| 39 |
try:
|
| 40 |
+
from fpdf2 import FPDF
|
| 41 |
except ImportError:
|
| 42 |
raise Exception("fpdf2 is not installed. Please install it with: pip install fpdf2")
|
| 43 |
|
|
|
|
| 183 |
"""Create a PROFESSIONAL PDF document from the business plan data using FPDF2
|
| 184 |
NOTE: Now uses matplotlib charts exclusively - old base64 chart logic commented out"""
|
| 185 |
try:
|
| 186 |
+
from fpdf2 import FPDF
|
| 187 |
except ImportError:
|
| 188 |
raise Exception("fpdf2 is not installed. Please install it with: pip install fpdf2")
|
| 189 |
|