Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How can I print a PDF file from VFP?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01387355
Message ID:
01387358
Vues:
175
>Hello
>
>Thanks for any help, it is really appreciated. I have a set of existing PDF files that I need to print from my VFP application, I can't find the way to achieve this.
>
>I do not need to generate the pdfs since they are already on the disk, I just need to send them to the printer.
>
>Thanks a lot!!!!
>
>Juan Urbina

Check FAQ #8134. The only thing you should do is to change this line:

lnResult=ShellExecute(FindWindow( 0, _SCREEN.caption), "Open", tcDocument, "", "c:\temp\", 1)

to
lnResult=ShellExecute(FindWindow( 0, _SCREEN.caption), "Print", tcDocument, "", "c:\temp\", 1)

and because you use VFP9 you can use _screen.hWnd instead of FindWindow( 0, _SCREEN.caption)

So final edition may look like this:

lnResult=ShellExecute(_SCREEN.hWnd, "Print", tcDocument, "", "c:\temp\", 1)

or
lnResult=ShellExecute(0, "Print", tcDocument, "", "c:\temp\", 1)
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform