FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour OT: Fake Printer Driver
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
OT: Fake Printer Driver
Posted: Tue Jun 28, 2011 08:14 PM

Hi,

Does anyone know of a "printer driver" that will force the printer selection box to open.

I have a customer that is using a software package that will only print to the windows default printer but sometimes they need to print to a different printer.
It is a pain for them to keep switching the default printer.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: OT: Fake Printer Driver
Posted: Tue Jun 28, 2011 09:44 PM
Hello Jeff,

there is a Function

SetPrintDefault()

Sets the specified printer as the default printer.
Syntax:
SetPrintDefault( <cModel> ) --> nil
Parameters:
<cModel> The name of the new default printer.
Returns:
Nil

Source Code:
SOURCE\CLASSES\PRINTER.PRG


please search inside the Forum, to get the Informations You need.

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: OT: Fake Printer Driver
Posted: Tue Jun 28, 2011 10:47 PM

I'm not looking to do this via code. The software I am working with always prints to the windows default printer therefore the user cannot select a different printer.

What I'm looking for is a print diver that will pop up the printer selection window.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 1091
Joined: Thu Nov 17, 2005 11:08 AM
Re: OT: Fake Printer Driver
Posted: Wed Jun 29, 2011 12:26 PM

Jeff,
Which OS you're talking about?

Marco Boschi
info@marcoboschi.it
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: OT: Fake Printer Driver
Posted: Wed Jun 29, 2011 12:29 PM

Hi Marco,

Windows XP

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 4840
Joined: Fri Nov 18, 2005 04:52 PM
Re: OT: Fake Printer Driver
Posted: Thu Jun 30, 2011 03:22 PM

Jeff,

The best solution is to get the software producer to modify the software to allow printer selection.

Note that the standard is to print automatically to the default windows printer when selecting the print button, but to allow changing the printer when selecting File-Print. I presume you have already checked for that option.

The only workaround I can think of is to use a batch file to call a FW program that allows the user to change the Windows default printer, then runs the app, then runs another FW program that changes the default printer back to the original after the app is exited.

You could also do the same thing but change to a different printer automatically so there would be no user interaction required.

The downside is that changing the default Windows printer will also affect other programs that may be accessed while the specified app is still running.

As I mentioned at the start, the only good solution is to get the software modified to allow changing of the current printer in that app.

Regards,
James

FWH 18.05/xHarbour 1.2.3/BCC7/Windows 10
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: OT: Fake Printer Driver
Posted: Fri Jul 01, 2011 03:08 PM

Hi James,

I agree, having the software changed would be the best solution. However, since it is medical software, it is regulated by FDA so any change requires the manufacturer to resubmit paperwork to FDA. Manufacturers try to avoid this as it takes time and costs money.

The problem I am having is that they want to print to an HP laser so the doctor can look at the data and make his interpretation. Then they go back into the program and enter his comments. Then they want to print to a PDF printer to store the completed report.

I guess the only solution (as you mentioned) is to have 2 FW apps. One that set the HP as the default and the other that sets the PDF printer as the default. They would just need to make sure that they run the correct FW app before they launch the software.

I'm surprised that no one has created a printer driver that pops up the print select window but as you said, this should be done on the software side not the driver side :cry:

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 883
Joined: Thu Dec 24, 2009 12:46 AM
Re: OT: Fake Printer Driver
Posted: Fri Jul 01, 2011 03:33 PM

Hi Jeff, You can actually set the PDF printer as Default...

First make a small program that monitors the directory for certain file names...

For example File0

when file is found, print and erase (for example)

And then print File1, File2, File3, etc. with comments, so you move to another directory or leave in same directory but do not erase...

That would be easer than having to change printers, you only have to tell them to change the file name... (I assume the PDF printer should have to give you that option)

If the PDF does not checks for existing filenames in the target directory, then you can use the monitoring program to change to a correlative number or whatever the new file...(Example from File1 to File20110701-001)

This is just a wild idea I had, so I can only give you the recipe but not the medicine...

=====>

Bayron Landaverry
xBasePHP.com
(215)2226600 Philadelphia,PA, USA
MayaBuilders@gMail.com
Guatemala

FWH25.06--Harbour 3.0.0--BCC7.7--UEstudio 10.10
Windows 10

FiveWin, One line of code and it's done...

Posts: 117
Joined: Tue Jan 03, 2006 06:18 PM
Re: OT: Fake Printer Driver
Posted: Fri Jul 01, 2011 05:48 PM
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: OT: Fake Printer Driver
Posted: Mon Jul 04, 2011 01:10 PM

Thanks everyone.

Kok, the utility you pointed me to is perfect :) Simple and no code to write.

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)

Continue the discussion