fork download
  1. # Laws_on_Hand_Presentation.py
  2. # Python 3 code to generate a presentation PDF
  3.  
  4. from fpdf import FPDF
  5.  
  6. # Create instance of FPDF class
  7. pdf = FPDF()
  8. pdf.set_auto_page_break(auto=True, margin=15)
  9.  
  10. # --- Slide 1: Title ---
  11. pdf.add_page()
  12. pdf.set_font("Arial", 'B', 16)
  13. pdf.cell(0, 10, "Laws on Hand", ln=True, align="C")
  14. pdf.set_font("Arial", '', 12)
  15. pdf.cell(0, 10, "A Legal Awareness Platform for Indian Citizens", ln=True, align="C")
  16. pdf.ln(10)
  17.  
  18. # --- Slides content ---
  19. slides = {
  20. "Introduction": [
  21. "Legal awareness is important in daily life",
  22. "Many people face legal issues due to lack of knowledge",
  23. "Most cases happen unwillingly"
  24. ],
  25. "Problem Statement": [
  26. "People are unaware of basic laws",
  27. "Legal terms are complex",
  28. "This leads to unnecessary legal trouble"
  29. ],
  30. "About Laws on Hand": [
  31. "Simple and informative legal website",
  32. "Designed for Indian citizens",
  33. "Easy to understand and use"
  34. ],
  35. "Purpose": [
  36. "Spread legal awareness",
  37. "Prevent unintentional legal cases",
  38. "Help people make informed decisions"
  39. ],
  40. "Key Features": [
  41. "Easy language explanations",
  42. "User-friendly interface",
  43. "Suitable for non-law users"
  44. ],
  45. "Language Support": [
  46. "English",
  47. "Hindi",
  48. "Tamil"
  49. ],
  50. "Benefits": [
  51. "Educates citizens on rights & duties",
  52. "Reduces legal confusion",
  53. "Promotes responsible citizenship"
  54. ],
  55. "Impact": [
  56. "Avoids legal mistakes",
  57. "Builds confidence",
  58. "Empowers people"
  59. ],
  60. "Conclusion": [
  61. "Laws on Hand helps Indians understand laws",
  62. "Prevents unwanted legal cases",
  63. "Builds a safer society"
  64. ],
  65. "Thank You": [
  66. "Thank You",
  67. "Any Questions?"
  68. ]
  69. }
  70.  
  71. # --- Add each slide to PDF ---
  72. for title, points in slides.items():
  73. pdf.add_page()
  74. pdf.set_font("Arial", 'B', 14)
  75. pdf.cell(0, 10, title, ln=True)
  76. pdf.ln(5)
  77. pdf.set_font("Arial", '', 12)
  78. for point in points:
  79. pdf.multi_cell(0, 8, "• " + point)
  80. pdf.ln(1)
  81.  
  82. # --- Save PDF ---
  83. #!/usr/bin/perl6
  84.  
  85. while (($_ = $*IN.get) != 42) { say $_ }
  86.  
Success #stdin #stdout 0.03s 25280KB
stdin
1
2
10
42
11
from fpdf import FPDF

# Create a new instance of the PDF class
pdf = FPDF()
pdf.add_page()
pdf.set_font("Arial", size=12)

# Company Information
pdf.cell(200, 10, "COMPANY NAME", ln=True, align='C')
pdf.cell(200, 10, "Company Address", ln=True, align='C')
pdf.cell(200, 10, "Phone: XXXXXXXXXX", ln=True, align='C')
pdf.ln(10)

# Employee Information
pdf.cell(100, 10, "Employee Name: Dipendra Dhakal", ln=True)
pdf.cell(100, 10, "Employee ID: 288550617", ln=True)
pdf.cell(100, 10, "Designation: Service Provider", ln=True)
pdf.cell(100, 10, "Month: June 2024", ln=True)
pdf.ln(10)

# Earnings
pdf.cell(100, 10, "Earnings:", ln=True)
pdf.cell(100, 10, "---------------------------", ln=True)
pdf.cell(100, 10, f"Service Provision: 2500.00 €", ln=True)
pdf.ln(5)
pdf.cell(100, 10, f"Gross Pay: 2500.00 €", ln=True)
pdf.ln(10)

# Deductions
pdf.cell(100, 10, "Deductions:", ln=True)
pdf.cell(100, 10, "---------------------------", ln=True)
pdf.cell(100, 10, f"IVA (23%): 575.00 €", ln=True)
pdf.cell(100, 10, f"IRS (11.5%): -287.50 €", ln=True)
pdf.cell(100, 10, f"Platform Usage Fee: -1.85 €", ln=True)
pdf.ln(5)
pdf.cell(100, 10, f"Total Deductions: 285.65 €", ln=True)
pdf.ln(10)

# Net Pay
pdf.cell(100, 10, f"Net Pay: 2214.35 €", ln=True)
pdf.ln(10)

# Footer
pdf.cell(100, 10, "Signature of Employer: ______________", ln=True)
pdf.cell(100, 10, "Date: 06 June 2024", ln=True)

# Save the PDF
pdf_output_path = "/mnt/data/Salary_Slip_Dipendra_Dhakal_2500.pdf"
pdf.output(pdf_output_path)

pdf_output_path
stdout
# Laws_on_Hand_Presentation.py
# Python 3 code to generate a presentation PDF

from fpdf import FPDF

# Create instance of FPDF class
pdf = FPDF()
pdf.set_auto_page_break(auto=True, margin=15)

# --- Slide 1: Title ---
pdf.add_page()
pdf.set_font("Arial", 'B', 16)
pdf.cell(0, 10, "Laws on Hand", ln=True, align="C")
pdf.set_font("Arial", '', 12)
pdf.cell(0, 10, "A Legal Awareness Platform for Indian Citizens", ln=True, align="C")
pdf.ln(10)

# --- Slides content ---
slides = {
    "Introduction": [
        "Legal awareness is important in daily life",
        "Many people face legal issues due to lack of knowledge",
        "Most cases happen unwillingly"
    ],
    "Problem Statement": [
        "People are unaware of basic laws",
        "Legal terms are complex",
        "This leads to unnecessary legal trouble"
    ],
    "About Laws on Hand": [
        "Simple and informative legal website",
        "Designed for Indian citizens",
        "Easy to understand and use"
    ],
    "Purpose": [
        "Spread legal awareness",
        "Prevent unintentional legal cases",
        "Help people make informed decisions"
    ],
    "Key Features": [
        "Easy language explanations",
        "User-friendly interface",
        "Suitable for non-law users"
    ],
    "Language Support": [
        "English",
        "Hindi",
        "Tamil"
    ],
    "Benefits": [
        "Educates citizens on rights & duties",
        "Reduces legal confusion",
        "Promotes responsible citizenship"
    ],
    "Impact": [
        "Avoids legal mistakes",
        "Builds confidence",
        "Empowers people"
    ],
    "Conclusion": [
        "Laws on Hand helps Indians understand laws",
        "Prevents unwanted legal cases",
        "Builds a safer society"
    ],
    "Thank You": [
        "Thank You",
        "Any Questions?"
    ]
}

# --- Add each slide to PDF ---
for title, points in slides.items():
    pdf.add_page()
    pdf.set_font("Arial", 'B', 14)
    pdf.cell(0, 10, title, ln=True)
    pdf.ln(5)
    pdf.set_font("Arial", '', 12)
    for point in points:
        pdf.multi_cell(0, 8, "• " + point)
        pdf.ln(1)

# --- Save PDF ---
#!/usr/bin/perl6

while (($_ = $*IN.get) != 42) { say $_ }