Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -75,13 +75,15 @@ def website_to_pdf(url):
|
|
75 |
logger.info(f"Found {len(all_pages)} pages to process")
|
76 |
|
77 |
pdf = FPDF()
|
|
|
78 |
pdf.add_page()
|
79 |
pdf.set_font("Arial", size=12)
|
80 |
|
81 |
for page_url, content in all_pages:
|
82 |
-
pdf.cell(
|
|
|
83 |
for text in content:
|
84 |
-
pdf.multi_cell(0, 10, txt=text
|
85 |
pdf.add_page()
|
86 |
|
87 |
with tempfile.NamedTemporaryFile(delete=False, suffix='.pdf') as tmp:
|
|
|
75 |
logger.info(f"Found {len(all_pages)} pages to process")
|
76 |
|
77 |
pdf = FPDF()
|
78 |
+
pdf.set_auto_page_break(auto=True, margin=15)
|
79 |
pdf.add_page()
|
80 |
pdf.set_font("Arial", size=12)
|
81 |
|
82 |
for page_url, content in all_pages:
|
83 |
+
pdf.cell(0, 10, txt=page_url, ln=True)
|
84 |
+
pdf.ln(5)
|
85 |
for text in content:
|
86 |
+
pdf.multi_cell(0, 10, txt=text)
|
87 |
pdf.add_page()
|
88 |
|
89 |
with tempfile.NamedTemporaryFile(delete=False, suffix='.pdf') as tmp:
|