Hey guys, I have found a cool module to print anything to pdf format. The name of the module is reportlab. If you have pip installed in your system then simply write the following in command prompt.
>>> pip install reportlab
The reportlab will automatically be detected anddownloaded if you have a proper internet connection.
Below is a simple code to run and print pdf file form python -
>>> pip install reportlab
The reportlab will automatically be detected anddownloaded if you have a proper internet connection.
Below is a simple code to run and print pdf file form python -
from reportlab.pdfgen import *
def hello(c):
c.drawString(100,100,"Hello World")
c=canvas.Canvas("hello.pdf")
hello(c)
c.showPage()
c.save()
The code will create a file hello.pdf with "Hello World" written on it. If you want to learn more about reportlab below is the link to learn more -