Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Generate PDF Files Automatically.
Message
 
 
À
19/07/2000 22:59:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de rapports & Rapports
Divers
Thread ID:
00390104
Message ID:
00394923
Vues:
65
>Dear Nadya,
>
>I got it, thanks! But I tried your sample, the Save As dialog is still prompted. I try to add the REPORT FORM command before CLEAR DLLS command and after CLEAR DLLS command. Any idea about this?
>
>Thanks you very much ...
>
>Best Regards,
>
>Justy Chow

Justy,

I'd like to post this program again. If you want to see, how it works, uncomment *?, you'll see output on the screen. You should invoke this program with an actual file name just before REPORT FORM command. After this command say SET PRINTER TO DEFAULT.
*******************************************************************************
*  Description.......: CreatePDF - creates PDF for specified filename
*  Calling Samples...: CreatePDF('c:\temp\temp.pdf')
*  Parameter List....: pcFileName
*  Created by........: Houston Brennan 06/12/2000
*  Modified by.......: Nadya Nosonovsky 06/16/2000 10:56:51 AM
******************************************************************************
lparameters pcFileName
if empty(pcFileName)
     pcFileName='c:\windows\temp\tempfile.pdf'
endif

local cPDFFile, lcOldSafety, iInitialise, iIsNT, ;
     cPdfWriter, cPort, iInstalled, iDoPrompt, iSetFileName

lcOldSafety=set('safety')
cPdfDLLFile = "c:\Program Files\Adobe\Acrobat 4.0\Macros\Office95\PDFMon.DLL"

if not file(cPdfDLLFile )
     wait window nowait "Required Acrobat Writter DLL is not present on your local drive" +;
          chr(13)+"Will print to default printer..."
     return .t.
endif

clear dlls
declare integer PDFMonInitialize in (cPdfDLLFile)
declare integer PDFMonIsOSNT in (cPdfDLLFile)
declare integer IsPDFWriterInstalled in (cPdfDLLFile) ;
     string@ cPDFWriterName , ;
     string@ cPort
declare integer PDFMonDoPrompt in (cPdfDLLFile) ;
     integer iWhichProgram

declare integer PDFMonSetPrompt in (cPdfDLLFile) ;
     integer iWhichProgram , ;
     integer iNewValue

#define SETPROMPTOFF 0
#define SETPROMPTON 1

declare integer PDFMonSetOutputFilename in (cPdfDLLFile) ;
     string cFileName
declare integer PDFMonCleanup in (cPdfDLLFile)

iInitialise = PDFMonInitialize()
*? "Initialise : "
*?? iInitialise

iIsNT = PDFMonIsOSNT()
*? "Is NT : "
*?? iIsNT
set safety off
cPdfWriter = space(100)
cPort = space(100)
iInstalled = IsPDFWriterInstalled( @cPdfWriter, @cPort )
if iInstalled=1 && PDF Writer is installed
     set printer to name 'Acrobat PDFWriter'
endif
*? "Installed "
*?? iInstalled
*? "PDF Writer : "
*?? cPdfWriter
*? "Port : "
*?? cPort
*?

iDoPrompt = PDFMonDoPrompt( SETPROMPTOFF )
*? iDoPrompt
*cFileName = "c:\Temp\Test.Pdf"
iSetFileName = PDFMonSetOutputFilename(pcFileName)
*? iSetFileName
*!*     pcFileName = ""
*!*     iSetFileName = PDFMonSetOutputFilename(pcFileName)
*!*     ? iSetFileName

*? PDFMonCleanup()
clear dlls
set safety &lcOldSafety
*? "Finished."
return .t.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform