Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
TIFF printer driver
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Produits tierce partie
Divers
Thread ID:
00659904
Message ID:
00660173
Vues:
12
I don't know if this will be of help to you, but I use a fax printer driver to print VFP report forms to TIFF file and it works very well with no UI dialog popping up. This is the code that I use. The name of the fax printer is stored in variable M._FAXPRINTERDRIVER
function report2tiff
	Parameters m.rptfrx,m.outfilename
	*** parameter1 = report form name with path
	*** parameter2 = name of file to save the report to;.  Example "myreport"
        *** returns filename with fullpath if file was created
	m.r2tretval = ""
	m.r2t_retdefault = sys(5)+sys(2003)
	m.r2t_oldprinter = set("printer",3)
	if type("M._FAXPRINTERDRIVER") <> "C" .or. empty(M._FAXPRINTERDRIVER)
  		Return ""
	endif
        dimension aprndrvrlist[1]
	if aprinters(aprndrvrlist) > 0
		for m.lnI = 1 to alen(aprndrvrlist,1)
                  if upper(aprndrvrlist[m.lnI,1]) = upper(M._FAXPRINTERDRIVER)
                      M._FAXPRINTERDRIVER = aprndrvrlist[m.lnI,1]
                      exit
                  endif
		next
		if ascan(aprndrvrlist,M._FAXPRINTERDRIVER) = 0 
		  *!* FAX Printer is NOT available
			return ""
		endif
	endif
	do case
		case type("m.rptfrx") <> "C" .or. empty( m.rptfrx)
			return ""
		case type("m.outfilename") <> "C" 
			return ""
	endcase

	SET PRINTER TO NAME (M._FAXPRINTERDRIVER)

	REPORT FORM (m.rptfrx) NOEJECT NOCONSOLE TO file (m.outfilename)

	set printer to name (m.r2t_oldprinter)

	if file(m.outfilename)
		m.r2tretval = locfile(m.outfilename)
	endif

	if m.r2t_retdefault <> sys(5)+sys(2003)
		set default to (m.r2t_retdefault)
	endif

	Return m.r2tretval 
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform