How to draw a line?

Can somebody please write a sample code on how to draw a simple line?

P.S. Im not using designer (which means i call Document class method that ouputs everything).