Send the apropriate printer-setup (escape) codes to the printer to select the required paperformat or paperbin, perhaps?
There is no reliable way, except to open the printer manually and measure the paper, to determine if the correct papersize is loaded on the printer. If you are sure it is loaded, but also other papersizes are available, select the correct paperbin using printercodes.
Your program should be aware of the correct amount of information (or lines) to send to the printer to fill up the page.
Why does that get you stuck? The larger copier/printer machines at the office automatically select the correct paperbin when asked for different size paper. This is probably handles by the Windows driver. But as Clipper programs usually don't use Windows drivers, we'll have to send the correct codes ourselves. If you can't find the codes, then probably Google is your friend, if it doesn't support direct programming with codes, the use a Windows printerdriver...
There are commercial libraries offering that, but also the open source harbour-project.org or xharbour.org xBase/Clipper compilers have a decent solution.
(x)Harbour offers a Winprint library class, that handles the selection of papersizes, and printing on your installed Windows printers. It's not a simple drop-in replacement, but shuld be manageble, assuming you are a little more experienced in the Clipper programming arena. If your a passing by, help me out please, type of programmer, it can cost a bit more effort to get this all going.
Major advantage of switching to (x)harbour would be the 32 bit executable, giving all sorts of speed and stability improvements, and that can also run your app on Windows x64, if need comes by.
Most manufactors have the codes on a web site were you can pull them from. I use the codes to change pitch, bold, landscape, legal, underline, trays. It's no big deal you can either use the actual code or the CHR value, plug them in, then turn them off. Use the ?? to turn them on & off.
Thanks all for your help. Everything working fine now. So my program is old, stable as can be using clp 5.2e and fivewin 1.92 (very old but works great), I'd like to convert to 32bits. Any suggestions?
My program works quite well in Vista and with Fivewin front end it functions as any windows program But one day Micro Soft will do us 16bit guys in. 2010 is new Vista. Will we survive it?
My guess is that they will figure out a way to make it backwards compatible. Just a guess, but I think they'll figure out it's in their best interest to make it work for the 16 bit legacy stuff. Vista hasn't been a big success for them and I think they'll be looking to get try to do as much as they can to make the market happy.
(x)Harbour and FiveWin for (x)Harbour would be the most 32 bit solution available to you. With the proper 64 bit compiler, it can even go 64 bit if you need it :-D
Fivewin development is closely following to the development of (x)Harbour, and they usually have the latest versions available. (I'm not a Fivewin user)
Apart from a mandatory MAIN procedure in your (main) Clipper prg, there aren't much prerequisites on switching to (x)Harbour. Btw: I'm writing (x) in front of Harbour to emphasize the fact that both Harbour-project and xHarbour are capable of compiling and running your Clipper applications.
I've been using the compilerswitch to generate c-code instead of p-code (as Clipper does, and (x)Harbour also by default, AFAIK) to get the most speed of my apps as I can, and they seem to fly compared to the executionspeed of Clipper programs.
If you're currently running a x64 version of Windows you'll have trouble getting your 16 bit Clipper apps to run...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.