@@ -292,20 +292,19 @@ def generate_pdf_with_cover_and_toc(base_url, pages_with_titles):
292
292
margin-top: 10px !important;
293
293
}
294
294
@page {
295
- margin: 0.5in 0.1in 0 .5in 0.1in ; /* Default margin for all pages */
295
+ margin: 0.7in 0.2in 1 .5in 0.2in ; /* Increased bottom margin for all pages */
296
296
}
297
-
298
297
@page:first {
299
- margin: 0 !important ; /* Adjust or remove the margin for the first page */
298
+ margin: 0 0.2in 2in 0.2in ; /* Adjusted bottom margin for the first page */
300
299
padding: 0 !important;
301
- }
300
+ }
302
301
""" )
303
302
304
303
page .pdf (
305
304
path = output_path ,
306
305
format = "A4" ,
307
306
print_background = True ,
308
- margin = {"top" : "1in" , "bottom" : "1in " },
307
+ margin = {"top" : "1in" , "bottom" : "1.2in " }, # Adjust bottom margin
309
308
display_header_footer = True ,
310
309
header_template = f'''
311
310
<div style="
@@ -317,21 +316,24 @@ def generate_pdf_with_cover_and_toc(base_url, pages_with_titles):
317
316
font-weight: bold;
318
317
border-bottom: 0.5px solid #7393B3;
319
318
font-variant-caps: small-caps;
319
+ box-sizing: border-box; /* Prevent overflow issues */
320
320
">
321
321
{ title }
322
322
</div>
323
323
''' ,
324
324
footer_template = f'''
325
325
<div style="
326
326
font-size: 12px;
327
- padding-left: 20px;
328
- padding-right: 20px;
329
- padding-bottom: 5px;
327
+ padding: 5px 20px; /* Reduced padding for footer */
330
328
width: 100%;
331
329
display: flex;
332
330
justify-content: space-between;
333
331
align-items: center;
334
- font-style: italic;">
332
+ font-style: italic;
333
+ box-sizing: border-box; /* Ensure proper sizing */
334
+ border-top: 0.5px solid #7393B3; /* Optional separator line */
335
+ background-color: #f9f9f9; /* Optional background for clarity */
336
+ ">
335
337
<div style="text-align: left;">
336
338
© Nomana-IT | Edited: { edited_date }
337
339
</div>
0 commit comments