CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Location
    India
    Posts
    173

    Help needed while Printing

    Please help Me.

    I have a report to be printed on DOT Matrix printer.

    Is it possible to print to a DOT Marix printer without giving the Page Size?

    I am using the page size of 4 inch by 6 inch.

    The problem is the report will get data from Table(s), which may be either 1 or 2 or 3 or many. So, when the printing goes on, (I'm using continuous stationary) The first page may contain only 2 records, the second page may contain 10 records and so. During this process, after printing the first page which is containing only 2 records, it will print blank lines and then goes to second page. During this, the output will be very odd.
    Even though I have set the Top and Bottom Margin to 0, "it prints 1 blank line space in between the pages".

    Can anybody help me to avoid printing of unnecessary blank lines between the different pages.

    That is, in the report, there should be no blank lines which is given by the printer on its own because, the gaps which are required are given by the report.

    It is very much required.

    Thank You.



  2. #2
    Join Date
    Mar 2000
    Posts
    145

    Re: Help needed while Printing

    What method are you using to print? Two methods are available:

    1 Use VB print methods (which also uses Windows print driver). An example is like

    Printer.CurrentX = 100
    Printer.CurrentY = 75
    Printer.Print "Line 1"

    2 Use a Windows API called "WritePrinter" to send raw printer data. This method will give you complete control over everything sent to the printer and does not use the Windows printer driver. This is the best for dot matrix printers where you need complete control of all placement, etc.

    I recommend you use method 2 for better results. I can get you some examples of the WritePrinter API or you can look on http://msdn.microsoft.com . Search for "raw data printer". Also, go to http://www.codehound.com and search for WritePrinter. If you're trying to use the Printer.Print method, the printer driver is constantly modifying your output based on what it thinks you want. This does not work well with a dot-matrix printer.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured