Skip to content

Commit 9ba7d98

Browse files
committed
Update margin for printing
1 parent ff7904f commit 9ba7d98

26 files changed

+19
-17
lines changed
16.6 KB
Binary file not shown.

pdf/ly_user_guide.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -292,20 +292,19 @@ def generate_pdf_with_cover_and_toc(base_url, pages_with_titles):
292292
margin-top: 10px !important;
293293
}
294294
@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 */
296296
}
297-
298297
@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 */
300299
padding: 0 !important;
301-
}
300+
}
302301
""")
303302

304303
page.pdf(
305304
path=output_path,
306305
format="A4",
307306
print_background=True,
308-
margin={"top": "1in", "bottom": "1in"},
307+
margin={"top": "1in", "bottom": "1.2in"}, # Adjust bottom margin
309308
display_header_footer=True,
310309
header_template=f'''
311310
<div style="
@@ -317,21 +316,24 @@ def generate_pdf_with_cover_and_toc(base_url, pages_with_titles):
317316
font-weight: bold;
318317
border-bottom: 0.5px solid #7393B3;
319318
font-variant-caps: small-caps;
319+
box-sizing: border-box; /* Prevent overflow issues */
320320
">
321321
{title}
322322
</div>
323323
''',
324324
footer_template=f'''
325325
<div style="
326326
font-size: 12px;
327-
padding-left: 20px;
328-
padding-right: 20px;
329-
padding-bottom: 5px;
327+
padding: 5px 20px; /* Reduced padding for footer */
330328
width: 100%;
331329
display: flex;
332330
justify-content: space-between;
333331
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+
">
335337
<div style="text-align: left;">
336338
© Nomana-IT | Edited: {edited_date}
337339
</div>
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)