purelprint

Applications, Games, Tools, User libs and useful stuff coded in PureBasic
t57042
Enthusiast
Enthusiast
Posts: 205
Joined: Fri Feb 22, 2008 12:28 pm
Location: Belgium

purelprint

Post by t57042 »

Hi,

I downloaded the PureLprint library. The testprogram runs but nothing is printed. It is as the printer is willing to start but it doesn't. A simple text with notepad prints.
Version of PureBasic is 4.1 -OS is XP - printer is Lexmark Z640.
THe program doesn't give any error message and the printerdriver thinks it printed.

Any suggestions?

THanks
Richard
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Re: purelprint

Post by gnozal »

t57042 wrote:Hi,
I downloaded the PureLprint library. The testprogram runs but nothing is printed. It is as the printer is willing to start but it doesn't. A simple text with notepad prints.
Version of PureBasic is 4.1 -OS is XP - printer is Lexmark Z640.
THe program doesn't give any error message and the printerdriver thinks it printed.
Any suggestions?
You mean this test program ?

Code: Select all

OpenConsole()
MyPrinter.s = LPRINT_GetDefaultPrinter()
If LPRINT_OpenPrinter(MyPrinter)
  Debug "Open " + MyPrinter
  PrintN("Open " + MyPrinter)
  If LPRINT_StartDoc("MyJob")
    LPRINT_Print(Chr(27) + "E") ; PCL reset for HP Printers
    LPRINT_Print("Line 1")
    LPRINT_PrintN("Same Line")
    LPRINT_PrintN("Line 2")
    LPRINT_PrintN("")
    LPRINT_PrintN("Line 4")
    LPRINT_NewPage() ; Form feed
    LPRINT_Print("Line 1 (Page 2)")
    LPRINT_EndDoc()
  Else
    Debug "Could not start job"
    PrintN("Could not start job")
  EndIf
  LPRINT_ClosePrinter()
  Debug("Done!")
  PrintN("Done!")
Else
  Debug "Printer " + MyPrinter + " not found"
  PrintN("Printer " + MyPrinter + " not found")
EndIf
CloseConsole()
I don't know if your printer is HP compatible, but I would try without this line :

Code: Select all

LPRINT_Print(Chr(27) + "E") ; PCL reset for HP Printers
Please note that PureLPRINT won't work with GDI only / POSTSCRIPT printers (check your drivers).
PS : do you use the correct userlib version (PureLPRINT-PB410-Installer.exe for PB4.10) ?
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
t57042
Enthusiast
Enthusiast
Posts: 205
Joined: Fri Feb 22, 2008 12:28 pm
Location: Belgium

Post by t57042 »

Hi gnozal,
I reduced the testprogram to the minimum:

MyPrinter.s = LPRINT_GetDefaultPrinter()
If LPRINT_OpenPrinter(MyPrinter)
Debug "Open " + MyPrinter
If LPRINT_StartDoc("MyJob")

LPRINT_Print("Line 1")
LPRINT_PrintN("Same Line")
LPRINT_PrintN("Line 2")
LPRINT_PrintN("")
LPRINT_PrintN("Line 4")
LPRINT_NewPage() ; Form feed
LPRINT_Print("Line 1 (Page 2)")
LPRINT_EndDoc()
Else
Debug "Could not start job"
EndIf
LPRINT_ClosePrinter()
Debug("Done!")

Else
Debug "Printer " + MyPrinter + " not found"
EndIf

It does not work with or without the ESC E line.
I don't know if the Lexmark z640 is HP compatible.
The testprogram acts as if it printed. But all it does is a carriage return.

Richard
gnozal
PureBasic Expert
PureBasic Expert
Posts: 4229
Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:

Post by gnozal »

t57042 wrote:Hi gnozal,
I reduced the testprogram to the minimum:
..
It does not work with or without the ESC E line.
I don't know if the Lexmark z640 is HP compatible.
The testprogram acts as if it printed. But all it does is a carriage return.
The library sends data directly to the printer, in 'raw' mode. Maybe your Lexmark printer needs some extra command [like the HP PCL escape commands].
Sorry I can't help more.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).
Post Reply