2

I have created an invoice in Rich text box (which will send to printer for printing using dos command bill.rtf>>prn).because my Printer is dot matrix it will not stop paper if i am not send print command using dos. so i need to draw a lines in invoice to look proper invoice so is there any way to draw a line in rich text box using c#. now invoice look like this i want to draw proper lines between them

-------------------------------------------------
Customer : Test  Address: 
Invoice No:4933  Date:05/15/2013  
-------------------------------------------------
SNo|Item Name         |Size|Qty |Rate  |T.Amt |
-------------------------------------------------
1   CP+ESR              1    1   200.0  200
2   ECG                 1    1   100.0  100
-------------------------------------------------
                  Medicine Amount      : 300
                  Doctor Fees          : 0
                  ----------------------------------
                  Total Amount         : 300
svick
  • 236,525
  • 50
  • 385
  • 514
imran khan
  • 474
  • 5
  • 10
  • “because my Printer is dot matrix it will not stop paper if i am not send print command using dos” That doesn't make any sense to me. You should try to figure out how to print properly, instead of trying to work around it using rich text boxes. – svick Jun 03 '13 at 09:22
  • Possible duplicate of [Richtextbox draw an rtf line](http://stackoverflow.com/questions/8324801/richtextbox-draw-an-rtf-line) – CJBS Feb 16 '16 at 22:07

1 Answers1

1

I don't know if rtf supports lines. You can use use a string of underscores ("___") maybe.

Medicine Amount      : 300
Doctor Fees          : 0
__________________________
Total Amount         : 300

See this SO question, looks like lines can be drawn https://stackoverflow.com/a/8657918/146167

Also, why are you using rtf to print? You can easily print crystal reports or word files for that matter on dot matrix.

Community
  • 1
  • 1
unlimit
  • 3,672
  • 2
  • 26
  • 34
  • how i will draw horizontal lines if i use under score u see their is gap between doctor fees and line i want to draw proper line with the help of code like we draw a line in print method g.drawline() etc.. – imran khan Jun 03 '13 at 08:40
  • Have edited my answer with a link to a SO question, it may be of help. – unlimit Jun 03 '13 at 09:29