Information générale
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
>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.
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement