DCPS how not to preview in Acrobat

This forum is for eXpress++ general support.
Post Reply
Message
Author
bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

DCPS how not to preview in Acrobat

#1 Post by bamunz@earthlink.net »

How can I save it to a PDF without previewing in Acrobat with the DCPS ?

Leon Berger
Posts: 36
Joined: Thu Jan 28, 2010 2:30 pm

Re: DCPS how not to preview in Acrobat

#2 Post 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)   
Best regards
Leon

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: DCPS how not to preview in Acrobat

#3 Post 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.

Zdeno Bielik
Posts: 147
Joined: Thu Jan 28, 2010 9:24 am
Location: Nitra, Slovakia
Contact:

Re: DCPS how not to preview in Acrobat

#4 Post 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

bamunz@earthlink.net
Posts: 23
Joined: Fri Apr 17, 2015 11:09 am

Re: DCPS how not to preview in Acrobat

#5 Post by bamunz@earthlink.net »

That worked thanks.

Post Reply