Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Acrobat Writer + VFP
Message
 
 
To
25/04/2001 23:03:18
Agnes Cheng
DynamicTech Consultants Ltd.
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Miscellaneous
Thread ID:
00499965
Message ID:
00499987
Views:
30
Hi Agnes,

Just few days ago I got a private e-mail from Vladimir Kaplinsky with the exact same problem. Well, my advices could be:
1) Clean up Tag1, Tag2 fields in your report + remove printer specific info from Expr field (carefully).

2) Use _fpreset function. See commented lines in the code bellow for its declaration. It seems, like _fpreset solved the problem, though we're not certian.
*******************************************************************************
*  Description.......: CreatePDF - creates PDF for specified filename
*  Calling Samples...: CreatePDF('c:\temp\temp.pdf')
*  Parameter List....: tcFileName
*  Created by........: Houston Brennan 06/12/2000
*  Modified by.......: Nadya Nosonovsky 06/16/2000 10:56:51 AM
******************************************************************************
lparameters tcFileName
if empty(m.tcFileName) or vartype(m.tcFileName)<>"C"
     tcFileName='c:\windows\temp\tempfile.pdf' && Hardcoded name
else
     tcFileName=forceext(m.tcFileName,"PDF")
endif
if file(m.tcFileName)
     delete file (m.tcFileName)
     flush
endif
*!*     declare _fpreset in msvcrt20.dll
*!*     =_fpreset()
declare integer Sleep in Win32API integer
Sleep(100) && Wait a little

local cPDFDllFile, lcOldSafety, iInitialize, iIsNT, ;
     cPdfWriter, cPort, iInstalled, iDoPrompt, iSetFileName
cPDFDllFile = "c:\Program Files\Adobe\Acrobat 4.0\Macros\Office95\PDFMon.DLL" && or locate this DLL

if not file(m.cPDFDllFile)
     =messagebox("Required Acrobat Writer DLL is not present on your local drive." + ;
          chr(13)+"Will print to default printer...",48,"Error in CreatePDF")
     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)
*PDFMonCleanup()
iInitialize = PDFMonInitialize()
if iInitialize=1
*? "Initialize : "
*?? iInitialize

*iIsNT = PDFMonIsOSNT()
*? "Is NT : "
*?? iIsNT
     lcOldSafety=set('safety')
     set safety off && don't want to be prompted
     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(m.tcFileName)
*? iSetFileName
*!*     tcFileName = ""
*!*     iSetFileName = PDFMonSetOutputFilename(tcFileName)
*!*     ? iSetFileName
     PDFMonCleanup()
else
     =messagebox("Adobe Acrobat Write could not be initialized. "+ ;
          chr(13)+"Will print to default printer...",48,"Error in CreatePDF")
endif
if m.lcOldSafety='ON'
     set safety on
endif
*? "Finished."
return .t.
>In My vfp application, I design a command.
>as the use make a *.pdf report. they can press that button.
>
>the coding is.
>report form myreport to printer name 'Acrobat Writer'.
>
>My client said, As They run this command, The report can output as *.pdf.
>
>BUT , The PC hangs suddenly. Everytimes, They Try, They got such problem.
>BUT. if they use the Micorsoft Word To OutPut the *.doc AS *.pdf.
>This problem didn't happended.
>
>Does Any requirement of PC when using Acrobat Writer ??
>OR. Acrobat Writer + vfp. Need some special techq. ??
>
>Thanks
>From Agnes
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