Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Printing Problem 1

Status
Not open for further replies.

MaxRaceSoftware

Programmer
Jun 10, 2002
36
US
a computer program (.EXE) i wrote, prints out a report
immediately on some computers..but on other computers
the Print goes into action immediately..then stops..then Red Light flashes on Printer...if you then press the red button, printing resumes normally and the page is printed and ejected

any ideas on how to make the page printout everytime on different computers/printers ??


MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
Not knowing what is in the report, the most likely candidate
is an escape or control sequence causing the printer to pause or creating a false error (i assume the report ends up looking ok).

Windows-only printers can be hard or almost impossible to
print on from qbasic (that's why they are called that),so
my advice is NEVER buy a windows-only printer. You are severly limited, and there are other operating systems which
may not be able to use it.

That said, does the report print ok if it's one page text ?

(that is, text only).

Or, is it multiple pages causing the problem by chance ?

If all else fails, you could try creating an html file of the report, calling iexplore.exe and have the user print it
from there.

There is also a dos print program for printing epson ESC/P
reports to most any printer that is set up.
 
i thought by now a lot of people/programmers would have run into this same problem ??..and someone would have had a quick & easy fix already :)

tested on 6 different computers ( Win95, Win98,ME, XP-Pro so far) all with various models of HP printers

the only one working perfectly everytime is Win98 with HP 990 printer..will always printout .

i 1st noticed this problem years ago with Win95 HP printer
having to push the flashing red light button on the Printer to finish the print job ...prints out great after that . i use to tell the customer just press the red button it will printout OK, but now want to solve the problem.

i've since rewritten/converted code to VBDOS 1.0 but still same problem as QB4.5 or QB7.1-PDS versions

just writting and executing this simple Code in VBDOS
will cause this problem with Printer

Printer.Print ""
Printer.ENDDOC

will cause the Printer to initially and immediately start the Print job..but then pause until red light flashes..and to continue the Printing, you have to push this button..then resumes and Printed page is OK
=======================================================

That said, does the report print ok if it's one page text ?

(that is, text only).

Or, is it multiple pages causing the problem by chance ?
-----------------------------
Doesn't matter..same results
even if you try to Print simple (VBDOS1.0)
Printer.Print "Hello"
Printer.ENDDOC

or just simple

LPRINT "Hello" in QB4.5 or QB7.1-PDS

=======================================================

If all else fails, you could try creating an html file of the report, calling iexplore.exe and have the user print it
from there.
-------------------
yes i thought about that also, but probably will just RUN a Visual Basic 1.0 version EXE that will take the VBDOS generated Text file with Color and Font tags built in to change Font size and style along with Colors printing thru the VB-Win 1.0 EXE from VBDOS EXE..probably better in long run,,just thought someone would have had an answer by now ?















MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
how about a chr$(12) at the end
or endpage for VB/PB before enddoc
 
Did you happen to use OPEN LPT1, for LPRINT does that for you.

Also, if these are Windows Printer, that means that they have Windows Drivers. Qbasic LPRINT talks to DOS drivers, which are different (I think it uses the driver, it might talk to the printer itself), but either way the printer is designed to notice that he command is not coming from its driver and will ask you what to do.
 
printer.PRINT "Hello"
printer.PRINT CHR$(12)
printer.ENDDOC

Thanks Buff1 the CHR$(12) worked !!
but now the Page Prints out immediately, but then the Red Flashing Light on the HP Printer comes on "after" the page is printed

a small step in the right direction ?? :)
now you have to push the red light button to turn it off :)
but atleast you have the page

Thanks QBasicKing also



MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
Heres the actual code i'm using and trying to PRINT with

DIM Cnt AS INTEGER
DIM Y AS INTEGER, X AS INTEGER, Num AS INTEGER
DEF SEG = &HB800

Num = FREEFILE
OPEN "LPT1:" FOR OUTPUT AS #Num
WIDTH #Num, 100
PRINT #Num, ""


FOR Y = 2 TO 25 '-----50 or 25, depending on screen height
FOR X = 1 TO 80
PRINT #Num, CHR$(PEEK(160 * (Y - 1) + (X - 1) * 2));
NEXT X
PRINT #Num,
NEXT Y

PRINT #Num, ""

FOR Cnt = 8 TO (List1.ListCount - 1)
PRINT #Num, List1.List(Cnt)
NEXT

IF LEN(Note$) THEN
PRINT #Num, ""
PRINT #Num, "File Name: " + FileName$
PRINT #Num, ""
PRINT #Num, Note$
END IF

CLOSE #Num
DEF SEG
Printer.ENDDOC

END SUB


MaxRace Software - Larry Meaux
ET_Analyst for DragRacers
Support Israel - Genesis 12:3
 
try Width #num,255

This prevents a CRLF (or CR) if it goes past what would be
Column 80 on an 8.5 x 11 at 10CPI.

 
so are you trying to print what's displayed on the screen
with the peek ?

looking at a page of memory for the screen ?

if that is true, why not just use x$=screen(x,y):print #num%,x$;

(i think that's the right syntax)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top