Problem with Default Printer in the VB 6

The Amyuni PDF Converter is our Printer Driver that enables you to convert any documents to PDF format. If you have any questions about installing and using the Amyuni PDF Converter please post them here.
Post Reply
Wesley
Posts: 4
Joined: Thu Jan 30 2003

Problem with Default Printer in the VB 6

Post by Wesley »

I have installed version 2.5 of your evaluation version of the developer edition of your converter and creator. In my application I need to print either to regular paper printer or to PDF File using your printer driver. What I have noticed is that if I first print to paper printer and then try to print to your PDF printer then the second copy goes also to the paper printer eventhough PDF printing codes executes. If i first print to PDF printer and then try to print to paper printer then my second copy is not going to paper printer and is lost. I am doing proper SetDefaultPrinter as well as RestoreDefaultPrinter logic. When I look at Printers under Control Panel everything seems to be working fine. Is it something about VB6?

This is very important that my application is allowed to switch to either printer over the course of running.
Please help.

Wesley
Wesley
Posts: 4
Joined: Thu Jan 30 2003

Post by Wesley »

I forgot to mention that I am using VB Printer object to print.
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Attempting to change the default printer is a source of troubles and is not recommended. What you should do is use the "Set Printer = " instruction of VB to direct the printout to the right printer. You can loop through the list of printers in the VB "Printers" collection then set the destination printer, e.g.:
if Printers(n).Name = "My Application PDF Export" then
Set Printer = Printers(n)
end if
Joan
Amyuni Team
Posts: 2799
Joined: Wed Sep 11 2002
Contact:

Post by Joan »

Hello,

Attempting to change the default printer is a source of troubles and is not recommended. What you should do is use the "Set Printer = " instruction of VB to direct the printout to the right printer. You can loop through the list of printers in the VB "Printers" collection then set the destination printer, e.g.:
if Printers(n).Name = "My Application PDF Export" then
Set Printer = Printers(n)
end if
Post Reply