Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing a PDF
Message
De
20/03/2008 07:02:34
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Vista
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Divers
Thread ID:
01303771
Message ID:
01303784
Vues:
19
Hi Robin,

as already mentioned by Agnes, all you need for printing is a pdf-viewer like Foxit Reader.

For programmatically printing a pdf you should use 'shellexecute'.

(The code is grabbed from one of my blog-entries and roughly reduced)
DECLARE Integer ShellExecute ;
	IN shell32.dll ;
	Integer hwndParent, ;
	String cVerb, ;
	String cFilename, ;
	String cParameters, ;
	String cDirectory, ;
	Integer nCmdShow

LOCAL	lcTyp as String, lcFile as String, lcPrinter as String, ;
	liHwndMain as Integer
		
liHwndMain = _SCREEN.HWnd

STORE [] TO lcTyp, lcFile, lcPrinter

lcTyp		= [Document:doc,pdf;Text:txt;Table:xls;Picture:jpg,bmp,tif,gif,png]
lcFile		= GETFILE(lcTyp,[Select],[open],1,[Select file])
lcPrinter	= GETPRINTER()
IF FILE(lcFile)
	liReturn = ShellExecute(liHwndMain,[printto],lcFile,["] + lcPrinter + ["],[],0)
	IF liReturn <= 32
		* Display Message
	ENDIF
ENDIF

RELEASE llExistsErrorCrs, llDeclareStatus, ;
		lcTyp, lcFile, lcPrinter, ;
		lcMailto, lcSubject, lcBody, ;
		liHwndMain, liReturn

CLEAR DLLS [ShellExecute]
Best Regards
-Tom

Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it.

Oh, and BTW: 010101100100011001010000011110000101001001101111011000110110101101110011
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform