import htmlfrom weasyprint import HTML# Create the PDF content in Arabic with elegant stylinghtml_content = """
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<title>شروط الخدمة - مركز سهل</title>
<style>
@page {
size: A4;
margin: 20mm 15mm;
background-color: #fafcfb; /* Subtle minty/clean tint for healthcare */
}
* {
box-sizing: border-box;
}
body {
font-family: 'Arial', sans-serif;
margin: 0;
padding: 0;
color: #2c3e50;
line-height: 1.6;
}
.header {
text-align: center;
border-bottom: 3px solid #2ecc71;
padding-bottom: 15px;
margin-bottom: 30px;
}
.logo-text {
font-size: 22pt;
font-weight: bold;
color: #27ae60;
margin: 0;
}
.subtitle {
font-size: 13pt;
color: #7f8c8d;
margin-top: 5px;
}
.card {
background: #ffffff;
border-right: 5px solid #2ecc71;
padding: 25px;
border-radius: 4px;
box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
h2 {
font-size: 15pt;
color: #2c3e50;
margin-top: 0;
margin-bottom: 15px;
}
.terms-list {
list-style: none;
padding: 0;
margin: 0;
}
.terms-list li {
font-size: 11pt;
margin-bottom: 12px;
padding-right: 15px;
position: relative;
}
.terms-list li::before {
content: "•";
color: #2ecc71;
font-weight: bold;
font-size: 14pt;
position: absolute;
right: 0;
top: -2px;
}
.footer {
margin-top: 40px;
text-align: center;
font-size: 10pt;
color: #95a5a6;
border-top: 1px solid #ecf0f1;
padding-top: 15px;
}
</style>
</head>
<body>
<div class="header">
<p class="logo-text">مركز سهل للحجامة</p>
<p class="subtitle">وثيقة شروط وإرشادات الخدمة لضمان سلامتكم</p>
</div>
<div class="card">
<h2>أهلاً بكم في مركز سهل، يرجى الالتزام بالشروط التالية لضمان فعالية الجلسة:</h2>
<ul class="terms-list">
<li><strong>الموعد المسبق:</strong> يتوجب على العميل إتمام عملية الحجز قبل موعد الجلسة بـ 24 ساعة على الأقل لتأكيد الاستقبال.</li>
<li><strong>التحضير للجلسة:</strong> يرجى الصيام التام والامتناع عن تناول الأطعمة والمشروبات قبل بدء الجلسة بساعتين كاملتين.</li>
<li><strong>الراحة البدنية:</strong> يُمنع بذل أي مجهود بدني شاق أو ممارسة التمارين الرياضية العنيفة بعد الانتهاء من الجلسة.</li>
<li><strong>النظام الغذائي:</strong> يجب تجنب تناول الأسماك، الحليب ومشتقات اللبن، والبيض طوال اليوم التالي للجلسة لسلامة جسدك.</li>
</ul>
</div>
<div class="footer">
مركز سهل - صحتكم وراحتكم هي أولويتنا دائماً.
</div>
</body>
</html>
"""# Save to html filewith open("sahled_terms.html", "w", encoding="utf-8") as f:
f.write(html_content)# Convert HTML to PDF using WeasyPrintHTML("sahled_terms.html").write_pdf("sahled_terms.pdf")
print("PDF created successfully as sahled_terms.pdf")
ناتج الرمز
PDF created successfully as sahled_terms.pd