Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Print PDF file
Message
 
 
To
16/02/2006 09:34:48
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01096718
Message ID:
01096736
Views:
13
>I want to print two PDF files in the same time on two different printers. I am trying to use the following solution:
>
>SetDefaultPrinter('Printer1')
>ShellExecute(0, 'print', 'c:\file1.pdf', '', '', 0)
>
>SetDefaultPrinter('Printer2')
>ShellExecute(0, 'print', 'c:\file2.pdf', '', '', 0)
>
>But both files are printed to the Printer2. Any idea how to do that?
>
>Thanks

the shellexecute acts externally, and out of process to the foxpro code it does the same thing to the file as you right clicking it and selecting print from the popup menu in explorer, imagine doing that in explorer and the time it takes windows between clicking it and it actually getting printed. I think what is happening is a matter of timing, before windows/acrobat has decided to actually get the default printer name to print file1 to your code has already called the function to change it to printer2, so both go there.

try putting an inkey(10) between the first shellexecute and the second setDefaultPrinter.

as for making it work without a guesswork delay... I dont think there is a way.

if it was postscript files you could send them straight to the ip address of the desired printer but thats not an option with pdfs.

Sorry I couldn't help more.

Ken.
Previous
Reply
Map
View

Click here to load this message in the networking platform