Solved

Printing in a matrix printer

Posted on 1998-07-24
3
346 Views
Last Modified: 2013-12-03
I am doing a report with de printer object in a matrix printer. This report is bigger than one page. I use fontsize 10 and font type courier, the first page is printed well. In the second page start the problem, it appears characters bigger than the space destinated to them. Then, the print has like a half of the line printed and continue witth the next half line that must be a complet line, and it follows until the end of the page.
I change the fontsize and font each time there is a new page.What is happening, and how I can solve my problem ?
Thank you
pd The printer is an Epson, and it has only few fonts like courier, orator, pica, etc.
Pepe
0
Comment
Question by:al361345
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
kamall earned 200 total points
ID: 1466611
al361345, here is the answer:

Fix Printer Object Font/Paging Quirk
An ‘undocumented feature’ of the VB Printer Object requires that each new page be initialized before the font can be changed.
You would think that the following code would change the current font of the default printer in VB, but you’d be wrong:

    With Printer.Font
    .Name = "Arial"
    .Size = 11
    End With

    sText = "What a waste it is to lose one’s mind."
    Printer.Print sText


This code works as expected:

    ' Start new page
    Printer.Print
    With Printer
    ' Set margins as desired
    .ScaleMode = vbTwips
    .CurrentX = 720
    .CurrentY = 720
    ' Now you can set the font
    With .Font
    .Name = "Arial"
    .Size = 11
    End With

    End With

    sText = "If we don’t succeed, we run the risk of failure."
    Printer.Print sText
    Printer.EndDoc

You MUST initialize each new page using similar code.

Best regards.
0
 

Author Comment

by:al361345
ID: 1466612
Thanks, kamall. I have now another problem. I already wrote my question on the discussion group.
Thank you again.
Pepe
0
 
LVL 7

Expert Comment

by:kamall
ID: 1466613
You are welcome Pepe.
I will check you new question and see if I can help.
Best regards.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question