Estoy tratando de enviar archivos .pdf directo a la impresora por defecto, pero mi código ya no funciona, he probado con todas estas opciones:
Code: Select all
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
*-------------------------------------------------------------------------
PROC Cotizacion_PdfPrint( nOperId , cDocNum , cDocFec )
LOCAL dEmision , cPdfTipo , cPdfRuta , cPdfFile , cPrinter
IF nOperId > 0
dEmision := CTOD( cDocFec )
cPdfRuta := PATHCPE + STR(YEAR(dEmision),4) + '\' + STRZERO(MONTH(dEmision),2) + '\' + STRZERO(DAY(dEmision),2)
cPdfFile := cPdfRuta + "\" + SIS_RUC + "_00_" + cDocNum + ".pdf"
IF FILE(cPdfFile)
cPrinter := GetDefaultPrinter()
msginfo( cPdfFile + chr(13) + cPrinter )
// ShellExecute( GetDesktopWindow() , 'printto' , cPdfFile , '"' + cPrinter + '"' , "" , 7 )
// ShellExecute( 0 , 'printto' , cPdfFile , '"' + cPrinter + '"' , , 0 )
ShellExecute( 0 , "printto" , '"' + cPdfFile + '"' , '"' + cPrinter + '"' , 0 , 0 )
// wapi_ShellExecute( 0, 'printto' , cPdfFile , cPrinter , , 0 )
MSGINFO( '.pdf enviado a la impresora.')
ELSE
msginfo("No existe el archivo "+cPdfFile)
ENDIF
ENDIF
RETURN
A la espera de sus comentarios, reciban un cordial saludo amigos.