Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -62,8 +62,7 @@ def website_to_pdf(url):
|
|
62 |
pdf = FPDF()
|
63 |
pdf.set_auto_page_break(auto=True, margin=15)
|
64 |
pdf.add_page()
|
65 |
-
pdf.
|
66 |
-
pdf.set_font('DejaVu', size=12)
|
67 |
|
68 |
for page_url in all_links:
|
69 |
content = get_page_content(page_url)
|
@@ -71,7 +70,7 @@ def website_to_pdf(url):
|
|
71 |
pdf.ln(5)
|
72 |
for text in content:
|
73 |
try:
|
74 |
-
pdf.multi_cell(0, 10, txt=text)
|
75 |
except Exception as e:
|
76 |
logger.error(f"Error writing text to PDF: {str(e)}")
|
77 |
pdf.add_page()
|
|
|
62 |
pdf = FPDF()
|
63 |
pdf.set_auto_page_break(auto=True, margin=15)
|
64 |
pdf.add_page()
|
65 |
+
pdf.set_font("Arial", size=12)
|
|
|
66 |
|
67 |
for page_url in all_links:
|
68 |
content = get_page_content(page_url)
|
|
|
70 |
pdf.ln(5)
|
71 |
for text in content:
|
72 |
try:
|
73 |
+
pdf.multi_cell(0, 10, txt=text[:200]) # Limit text length to avoid issues
|
74 |
except Exception as e:
|
75 |
logger.error(f"Error writing text to PDF: {str(e)}")
|
76 |
pdf.add_page()
|