Page 1 of 1

DCPS how not to preview in Acrobat

Posted: Thu Jun 18, 2015 11:51 am
by bamunz@earthlink.net
How can I save it to a PDF without previewing in Acrobat with the DCPS ?

Re: DCPS how not to preview in Acrobat

Posted: Thu Jun 18, 2015 12:01 pm
by Leon Berger
bamunz@earthlink.net wrote:How can I save it to a PDF without previewing in Acrobat with the DCPS ?
Add a printer named "PDF-Document" to your Printer array, then chose this printer as target.

Code: Select all

_p := "Test-File"

do case
case cPrinterName = "PDF-Document"
   PSSetDevice(DEV_PDFFILE)
   PSSetFileName(_p)
otherwise
   PSSetPrinter(nPrinter)
endcase

PSBeginDoc(nPrinter, _p, APS_PORTRAIT, 1)   

Re: DCPS how not to preview in Acrobat

Posted: Fri Jun 19, 2015 8:56 am
by bamunz@earthlink.net
PSSetDevice(DEV_PDFFILE)

PSSetFileName("Test"+ ".pdf")

DCPS BEGINDOC TITLE "Sales Receipt" ORIENTATION 1 PAGESIZE DMPAPER_LETTER

@ 20, 8, 275, 210 DCPS FRAME THICKNESS 2 FILLCOLOR GRA_CLR_WHITE
@ 27 , 75 DCPS SAY " S A L E S R E C E I P T " FONT '16.Arial Bold'
@ 35 , 15 DCPS SAY 'SALES RECEIPT # ' FONT '8.Arial'
@ 35 , 175 DCPS SAY " Today's Date " FONT '8.Arial'

DCPS OFF

It displays it in acrobat which I would like to stop.

Re: DCPS how not to preview in Acrobat

Posted: Fri Jun 19, 2015 9:36 am
by Zdeno Bielik
Hi,

just add one line at end of this function(located in dcps.prg) – works ok for me.
May be Roger can add any get/set function for enable/disable preview window.


FUNCTION DC_PsEndDoc()

LOCAL cFileName := PSSetFileName()

PsEndDoc()

IF !Empty(cFileName)
DC_SpawnUrl(cFileName)
ENDIF

PSSetFileName( ”” ) <- add this

RETURN nil


HTH
Zdeno

Re: DCPS how not to preview in Acrobat

Posted: Fri Jun 19, 2015 10:40 am
by bamunz@earthlink.net
That worked thanks.