Member-only story
Create a PDF file using Python
Sep 15, 2024
pip install reportlab
from reportlab.pdfgen import canvas
# create a new PDF file
pdf_file = canvas.Canvas("clcodingpdff.pdf")
# add text to the PDF file
pdf_file.drawString(72, 720, "Hello, World!")
pdf_file.drawString(72, 700, "Fre PDF Document ")
pdf_file.drawString(72, 680, "Like | Share ")
pdf_file.drawString(72, 660, "Subscribe ")
pdf_file.drawString(72, 640, "clcoding.com ")
pdf_file.drawString(72, 620, "thank you ")
# save the PDF file
pdf_file.save()