Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
PDF files
Message
 
 
To
28/06/2000 11:21:57
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00385817
Message ID:
00386619
Views:
39
>Is there a way to print to a PDF file without the PDF dialog box appearing? Thanks for the help.

Hi Steven,

*******************************************************************************
* 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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform