Hello everybody.

Can someone please tell me how to stop the page ejecting from the printer after the printing of the print document has completed?

I use VB.Net and have tried setting the HasMorePages of the PrintPageEventArgs to false. However, it does not work. I have to print on a paper roll, so I cannot let the printer push the paper forward to complete the page height.

Here is the code sample.

pDoc is the PrintDocument object.

VB Code:
  1. Private sub pDoc_PrintPage(sender as object, e as PrintPageEventArgs) Handles pDoc.PrintPage
  2.     'Printing Code goes here.
  3.    
  4.     'After the printing is finished
  5.     e.HasMorePages = False
  6. End Sub

Please help me. It is urgent.

Thanks in advance.

NIKHIL