dtussman wrote:Thanks Silvio. Tried that but it won't compile, doesn't recognize oApp
FUNCTION Main()
PRIVATE cDirPleno := GETCURDIR()
RETURNÿNIL
function FWSavePreviewToPDF( oDevice, cPDF, lOpen ) // oDevice can be oPrinter or oPreview
local cOrient, oPDF, cPRGPATH
local hWnd
if oDevice:IsKindOf( "TPREVIEW" )
hWnd := oDevice:oWnd:hWnd
oDevice := oDevice:oDevice
endif
#ifndef USEGDI
if LoadFreeImage() <= 32
MsgAlert( FWString( "freeimage.dll not found" ), FWString( "Alert" ) )
return nil
endif
#endif
PRIVATE CDIRPLENO
// AQUI
cPRGPATH := cFILEPATH( "C:\NFEPDF\" )
lCHDIR(cPRGPATH) // AQUI
// ? hb_CurDrive() + ":\" + CurDir() + "\"
DEFAULT cPDF := cGetFile( FWString( "PDF files | *.pdf |" ),;
FWString( "Select PDF File to Save" ),, ;
CurDir(), .T.,,,;
hb_CurDrive() + ":\" + CurDir() + "\" + ;
If( oDevice:IsKindOf( "TPreview" ),;
oDevice:cName, oDevice:cDocument ) + ".pdf" )
if ! Empty( cPDF )
cPDF = cFileSetExt( cPDF, "pdf" )
CursorWait()
cOrient = If( oDevice:nHorzSize() > oDevice:nVertSize(), 'L', 'P' )
oPdf = fwPdf():New( cPdf, cOrient )
AEval( oDevice:aMeta, { | cMeta | oPdf:AddMeta( cMeta ) } )
oPdf:Close()
CursorArrow()
DEFAULT lOpen := MsgYesNo( If( FWLanguageID() == 2, FWString( "¿" ) + " ", "" ) + ;
FWString( "View" ) + ;
" " + cPDF + " " + FWString( "(Y/N)" ) + " ?",;
FWString( "Please select" ) )
if lOpen
ShellExecute( IfNil( hWnd, GetWndDefault() ), "open", cPDF )
endif
else
cPDF := nil
endif
// RETURN TO MASTER - // AQUI
lCHDIR( cDirPleno )
// ? hb_CurDrive() + ":\" + CurDir() + "\"
return cPDF
Otto wrote:Hello Silvio,
sure no rights on the RDP server where you save the preview.
Best regards,
Otto
::cDir = GetEnv( "TEMP" )
if Empty( ::cDir )
::cDir = GetEnv( "TMP" )
endif
if Right( ::cDir, 1 ) == "\"
::cDir = SubStr( ::cDir, 1, Len( ::cDir ) - 1 )
endif
if ! Empty( ::cDir )
if ! lIsDir( ::cDir )
::cDir = GetWinDir()
endif
else
::cDir := GetWinDir()
endif
local cUmgebungTMP := GETENV("TMP")
*----------------------------------------------------------
if lIsDir( cUmgebungTMP ) = .f.
? "TEMP DIR erstellen " + cUmgebungTMP
lMKDir( cUmgebungTMP )
endif
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: No registered users and 110 guests