Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Printing a PDF
Message
From
20/03/2008 07:02:34
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 9
OS:
Vista
Network:
Windows 2000 Pro
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01303771
Message ID:
01303784
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform