Jan 20 2011

Visual Fox Pro + PDF Creator (1.2.0)

lcOldPrinter = SET(“printer”,2)
oPDFC = Createobject(“PDFCreator.clsPDFCreator”,”pdfcreator”)
oPDFC.cStart(“/NoProcessingAtStartup”)
oPDFC.cOption(“UseAutosave”) = 1
oPDFC.cOption(“UseAutosaveDirectory”) = 1
oPDFC.cOption(“AutosaveFormat”) = 0
DefaultPrinter = oPDFC.cDefaultprinter
oPDFC.cDefaultprinter = “pdfcreator”
oPDFC.cClearCache
oPDFC.cOption(“AutosaveDirectory”) = “c:\temp\”
oPDFC.cprinterstop=.F.

# First Report
oPDFC.cOption(“AutosaveFilename”) = “myPdf_1”
nLastDocNo=oPDFC.cOption(“Counter”)
Report Form c:\test.frx To Printer

DO WHILE oPDFC.cOption(“Counter”) <= nLastDocNo

WAIT “Waiting for finish job …”WINDOW NOWAIT noclear
nKey=INKEY(1)
nQueueCount = opdfc.cCountOfPrintjobs

enddo

# Second Report
oPDFC.cOption(“AutosaveFilename”) = “myPdf_2”
nLastDocNo = oPDFC.cOption(“Counter”)
Report Form c:\test2.frx To Printer
DO WHILE oPDFC.cOption(“Counter”) <= nLastDocNo

WAIT “Waiting for finish job …”WINDOW NOWAIT noclear
nKey=INKEY(1)
nQueueCount = opdfc.cCountOfPrintjobs

enddo
…… and so on …

Set Printer To Name (lcoldPrinter)
oPDFC.cDefaultprinter = DefaultPrinter
oPDFC.cClearCache
Release oPDFC

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.