Welcome to your editable document! You can type directly here to add and modify content. This is similar to how you edit a post in Blogger's compose view.
Example Content
Here's some example content to get you started:
Item 1: You can create lists.
Item 2: Lists are great for organizing information.
Item 3: Use ordered lists, or unordered lists.
Adding Images
While you can't directly upload images here, if you paste the URL of an image, it might show up, depending on Blogger's settings:
Important Notes
This is a simulated editable area. To add this to your Blogger page:
Go to your Blogger blog.
Create a new Page or edit an existing one.
Switch to HTML view (not Compose).
Copy the HTML code from this page (including the <style> tag).
Paste the code into the HTML view of your Blogger page.
Save and publish your Blogger page.
After saving in HTML view, you can switch back to compose view and the text will be there.
Preview
from reportlab.lib.pagesizes import letter
from reportlab.pdfgen import canvas
from reportlab.lib.units import inch
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.platypus import Paragraph
def create_national_anthem_pdf(filename="national_anthem_kannada.pdf"):
"""
Creates a PDF file containing the Indian National Anthem in Kannada.
Args:
filename (str): The name of the PDF file to create.
"""
c = canvas.Canvas(filename, pagesize=letter)
c.setFont("Helvetica", 12) # Choose a font
styles = getSampleStyleSheet()
normal_style = styles['Normal']
normal_style.fontName = "Helvetica" # Ensure the font is available
normal_style.fontSize = 14
normal_style.leading = 18 # Spacing between lines
# Kannada text of the National Anthem
anthem_text = """
ಜನ ಗಣ ಮನ ಅಧಿನಾಯಕ ಜಯ ಹೇ
ಭಾರತ ಭಾಗ್ಯ ವಿಧಾತಾ ।
ಪಂಜಾಬ ಸಿಂಧು ಗುಜರಾತ ಮರಾಠಾ
ದ್ರಾವಿಡ ಉತ್ಕಲ ಬಂಗ ।
ವಿಂಧ್ಯ ಹಿಮಾಚಲ ಯಮುನಾ ಗಂಗಾ
ಉಚ್ಛಲ ಜಲಧಿ ತರಂಗ ।
ತವ ಶುಭ ನಾಮೇ ಜಾಗೇ
ತವ ಶುಭ ಆಶಿಷ ಮಾಗೆ
ಗಾಹೇ ತವ ಜಯ ಗಾಥಾ ।
ಜನ ಗಣ ಮಂಗಳ ದಾಯಕ ಜಯ ಹೇ
ಭಾರತ ಭಾಗ್ಯ ವಿಧಾತಾ ।
ಜಯ ಹೇ, ಜಯ ಹೇ, ಜಯ ಹೇ,
ಜಯ ಜಯ ಜಯ ಜಯ ಹೇ ॥
"""
# Split the text into lines and create Paragraph objects
lines = anthem_text.strip().split('\n')
y = 750 # Starting y-position
for line in lines:
p = Paragraph(line.strip(), normal_style)
p.wrapOn(c, letter[0] - inch)
p.drawOn(c, inch, y)
y -= normal_style.leading # Move down for the next line
c.save()
print(f"PDF file '{filename}' created successfully.")
if __name__ == '__main__':
create_national_anthem_pdf()
Comments
Post a Comment