Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating a PDF
Message
From
06/02/2001 12:45:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Reports & Report designer
Title:
Creating a PDF
Miscellaneous
Thread ID:
00473009
Message ID:
00473009
Views:
51
Hello all,
  I just installed Adobe Acrobat 4.0 on my machine. I am trying to create a PDF
using code posted earlier on the UT by Houston Brennan and Nadya Nosonovsky.
The problem is, I get an error on the following line of code.

iInitialize = PDFMonInitialize()

The error states -

Cannot find entry point PdfMonInitialize in the DLL.

Can anyone help me out. Below is the rest of the code. Thanks in advance.

*****************************************************************************
* Description: CreatePDF - creates PDF for a 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
*****************************************************************************
PROCEDURE CreatePDF

LPARAMETERS tcFileName

IF EMPTY(tcFileName)
	tcFileName = "c:\windows\temp\tempfile.pdf" && Hardcoded Name
ENDIF

LOCAL cPdfDllFile, lcOldSafety, iInitialize, iIsNT, cPdfWriter, ;
		cPort, iInstalled, iDoPrompt, iSetFileName
		
lcOldSafety = SET("safety")
* cPdfDllFile = "c:\Program Files\Adobe\Acrobat 4.0\Macros\Office95\PDFMon.DLL" && or locate this DLL
* Randy's Fill In - Find the pdf DLL
* Pass - File name to find
* 		 Drive to search
*		 True to search entire network which overrides the drive to search parameter
SET PROCEDURE TO FindFileInNetwork ADDITIVE
cPdfDllFile = FindFileInNetwork("pdfmon.dll","c:\",.T.)
* End Fill In Code

IF NOT FILE(cPdfDllFile)
	MESSAGEBOX("Required Acrobat Writer DLL is not found." + ;
				CHR(13) + "Continue printing 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)

iInitialize = PdfMonInitialize()
iIsNT = PdfMonIsOSNT()

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

iDoPrompt = PdfMonDoPrompt(SETPROMPTOFF)
iSetFileName = PdfMonSetOutputFileName(tcFileName)

CLEAR DLLS

IF lcOldSafety = "ON"
	SET SAFETY ON
ENDIF

RETURN .T.

ENDPROC
Next
Reply
Map
View

Click here to load this message in the networking platform