Preview and save to pdf at the same time

Preview and save to pdf at the same time

Postby hua » Mon Jul 02, 2018 11:10 am

How to preview a report using tprinter and at the same time have a copy of it silently saved as a pdf in the background?

My experiment so far tends to have the exe just silently terminates. I was using FWH15.01 and FWSavePreviewToPdf()

TIA
FWH 11.08/FWH 19.12
BCC5.82/BCC7.3
xHarbour/Harbour
hua
 
Posts: 1072
Joined: Fri Oct 28, 2005 2:27 am

Re: Preview and save to pdf at the same time

Postby puenteda » Mon Dec 31, 2018 7:48 pm

I made this changes in rpreview.prg, in:

METHOD PrintPage() CLASS TPreview

....

if ! lCancel
MsgRun( ::oDevice:cDocument, "Imprimiendo Reporte",;
{ || ::PrintPrv( nil, nOption, nFirst, nLast ) } )

// daniel 2016-07-29

* ? 'ACA GUARDAR PDF',oApp:lGuardarPDF,oApp:cImprimiendo

IF oApp:lGuardarPDF

IF oApp:cImprimiendo == 'RECIBO'
cRutaPDF:=oApp:cRutaPDFRecibos
ELSEIF oApp:cImprimiendo == 'FE'
cRutaPDF:=oApp:cRutaPDFFE
ELSEIF oApp:cImprimiendo == 'PRESUPUESTO'
cRutaPDF:=oApp:cRutaPDFPresupuestos
ENDIF

MsgRun( ::oDevice:cDocument, "Guardando PDF",;
{ || ::SaveAs( .t.,cRutaPdf+'\'+::oDevice:cDocument,.F. ) } )
ENDIF

endif
puenteda
 
Posts: 24
Joined: Thu Oct 02, 2014 3:51 am


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 61 guests