Has anyone used wwpdf.prg by Rick Strahl?
I am using a Win 2000 pc, VFP 6, and acrobat pdf writer 8.
Here is my calling code to test it.
The code successfully executes, except it only creates one file, a .ps file. The comments (included) indicate that it should create a 2nd file with a .ps.pdf extenstion. It renames that file to the final output pdf file. However, since it does not exist, it is unable to rename it and the output file is never created.
Here is sample code in wwpdf:
Using the SHELLEXECUTE API I am able to create the pdf files. It brings up the distiller. However, this is kind of a goofy work around. I suspect it should work, but maybe I am missing something simple?
Anyone have experience with this?
Jim Osieczonek
Delta Business Group, LLC
I am using a Win 2000 pc, VFP 6, and acrobat pdf writer 8.
Here is my calling code to test it.
Code:
#INCLUDE p:\r01plusdev\data\wconnect.h
* standard way
* use employee
* report form eestatus preview
IF !USED('employee')
SELECT 0
USE employee
ELSE
SELECT employee
ENDIF
SET PROCEDURE TO
SET PROCEDURE TO wwapi.prg ADDITIVE
SET PROCEDURE TO wwpdf.prg ADDITIVE
SET PROCEDURE TO wwutils.prg ADDITIVE
SET PROCEDURE TO wweval.prg ADDITIVE
loPdf = CREATEOBJECT('wwPDF40')
* method in wwpdf.prg
loPDF.printreport('eestatus', 'c:\$pdf\jotest.pdf')
The code successfully executes, except it only creates one file, a .ps file. The comments (included) indicate that it should create a 2nd file with a .ps.pdf extenstion. It renames that file to the final output pdf file. However, since it does not exist, it is unable to rename it and the output file is never created.
Here is sample code in wwpdf:
Code:
loEval = CREATE("wwEval")
loEval.ExecuteCommand("SET PRINTER TO NAME '" +THIS.cPrinterDriver +"'")
IF loEval.lError
wait window "ERROR: " + loEval.cErrorMessage
THIS.cErrorMsg = "Couldn't set printer to " + THIS.cPrinterDriver
RETURN .F.
ENDIF
SET PRINTER TO NAME (THIS.cPrinterDriver)
*** We'll create a Postscript Output File
* original code
lcTFile = SYS(2023) + "\" + SYS(2015) + ".ps"
lcTFile = "c:\$pdf\boo.ps"
REPORT FORM (lcReport) &lcExtraReportClauses NOCONSOLE TO FILE &lcTFile
SET PRINTER TO
*** Get rid of the PS file - empty.
*** Distiller will automatically create a PDF file with ps.pdf extension
*** Note: PDFWriter will create two files .ps and .ps.pdf
*** the latter of which contains the actual output data
* MY COMMENTS
***********************************************************
* NOTE: the .ps.pdf file is not created. Therefore, it cannot
* be renamed
***********************************************************
ERASE (lcTFile)
lcTFile = lcTFile + ".pdf"
IF FILE(lcTFile)
*** Move the temp file to the actual file name by renaming
RENAME (lcTFile) TO (lcOutputFile)
ELSE
THIS.cErrorMsg = "Output file not created"
RETURN .F.
ENDIF
RETURN .T.
Using the SHELLEXECUTE API I am able to create the pdf files. It brings up the distiller. However, this is kind of a goofy work around. I suspect it should work, but maybe I am missing something simple?
Anyone have experience with this?
Jim Osieczonek
Delta Business Group, LLC