AcroRd32.exe /t path "printername" "drivername" "portname" —
Initiates Adobe Reader and prints a file, whose path must be fully specified, while
suppressing the Print dialog box.
The four parameters of the /t option evaluate to path, printername, drivername,
and portname (all strings).
● printername — The name of your printer.
● drivername — Your printer driver’s name, as it appears in your printer’s properties.
● portname — The printer’s port. portname cannot contain any "/" characters; if it
does, output is routed to the default port for that printer.
WaitRun( 'sumatraPDF -print-to-default -exit-on-print "salida.pdf"',0 )
oActiveX = TActiveX():New( oWnd, "AcroPDF.PDF.1" , 1, 1, 20, 50 )
oWnd:oClient = oActiveX
oActiveX : Do( "LoadFile", "salida.pdf" )
oActiveX : Do( "SetCurrentPage", 1 )
oActiveX : Do( "PrintAll" )
#Include "FiveWin.ch"
//-----------------------//
Function Main()
Local oLoc,oWmi,oList,oItem
local aPrinter := {}
local aDriver := {}
oLoc:= CreateObject( "wbemScripting.SwbemLocator" )
oWmi:= oLoc:ConnectServer()
If oWmi == NIL
? "Sorry!! No Wmi"
Return
Endif
oList := oWmi:ExecQuery("Select Name, PortName from Win32_Printer where default=1")
FOR EACH oItem IN oList
AAdd( aPrinter, {oItem:Name, oItem:PortName} ) // lista de impresoras
Next
xbrowse( aPrinter )
oList := oWmi:ExecQuery("Select * from Win32_PrinterDriver")
FOR EACH oItem IN oList
AAdd( aDriver, oItem:name ) // lista de impresoras
Next
xbrowse( aDriver )
oList = NIL
oWmi = NIL
oLoc = NIL
Return NIL
WaitRun( 'acrord32 /n /t l:\mayapos\colegios\fillpdf\salida.pdf "Brother MFC-6490CW Printer" "USB001" "Brother MFC-6490CW Printer,3, WindowsNT x86" ', 0 )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 80 guests