Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Name a report
Message
 
 
To
15/11/2000 14:48:51
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Miscellaneous
Thread ID:
00442274
Message ID:
00442312
Views:
9
>I print a report to printer "ACROBAT" (adobe). (PDF)
>
> Automatically, the system give a name "Visual FoxPro" to my report.
>
> How can i change this name and control it.
>
>thanks for your help.

Hi Sylvain,

I got this code from Houston and it works great in my system, but I know cases, where it doesn't work (see my discussion with Steven Duke). It's OS dependable, I'm afraid. Another route would be to try Rick www classes... I'll probably add this code in FAQ section.
*******************************************************************************
*  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
Reply
Map
View

Click here to load this message in the networking platform