>>We are using multiple size stationeries for the printing. So, it is very difficult to change the paper size of the printer
>
>Why would this be "very difficult"? If you are printing on a certain stationary that is 4" (4 inches) high, send the commands to change the page size, then immediately print the reports. The command for the page size should be part of the program that produces the report.
For Epson dot-matrix printers, the code to change the page length are ESC "C" n, where n is the number of lines.
For exaple, if you need 4 inches, with the normal 6 lines per inch that would be 24 lines, and you send the code chr(27) + "C" + chr(24), where chr(27) is the ESC code, and chr(24) sends the number 24, converted to character, as a parameter.
My printing codes, for printing in text mode, are normally something like this (simplified, I am trying to give you the main idea):
local lcReportInMemory
lcReportInMemory = FileToStr("myreport.txt")
lcPrinterCodes = chr(27) + "C" + chr(24)
??? lcPrinterCodes + lcReportInMemory
Of course, instead of naming the report file "myreport.txt" a random filename is used, to avoid problems with multiple users.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)