My thanks to Michael J Levene of www.computalink-systems.com for supplying me with the following tip.
If you have ADOBE ACROBAT version 5.0 this shows how you can completely automate the generation of PDF files without any user intervention. Apparently someone else has been trying to sell a driver to do this, but this method is completely FREE, and even works on a network.
Here are the steps you need to go through:-
c:\windows\desktop\*.pdf
Figure 1 - Acrobat Distiller Printer settings

Figure 2 - ADOBE PDF Settings

tempdir = c:\windows\temp acrobat = true acrodir = c:\windows\desktopNote:
acrodir MUST match the directory used for the port in step (2)
Figure 3 - define Uniface printer

Figure 4 - logical to physical mapping for the printer

These logical print definitions are stored in the user section of the Registry at the following location:
entry PRINT_PROC
params
string po_FileName : OUT
endparams
variables
string lv_TempDir
boolean lv_Acrobat
string lv_AcroDir
numeric lv_Count
numeric lv_Error
endvariables
lv_TempDir = $logical("tempdir")
if (lv_TempDir = "")
message "TEMPDIR not defined in [logicals] section of assignment file"
return(-1)
endif
; is acrobatic writer installed?
lv_Acrobat = $logical("acrobat")
lv_AcroDir = $logical("acrodir")
; Generate a unique reference number for the report
call GET_NEXT_NUMBER("PRINT", v_count)
if (lv_Acrobat)
; the acrobat name is the form title therefore
; change the formtitle to be the report name we want
$formtitle = "Acro_%%lv_Count"
print "ACROBAT", "C"
if ($status = 0)
po_FileName = "%%v_AcroDir%%%\%%$formtitle%%%.pdf"
return(0)
else
message "Print to PDF file failed"
return(-1)
endif
else
print "FILE","C"
if ($status = 0)
po_FileName = "%%lv_TempDir%%%\rpt_%%lv_Count%%%.txt"
activate "WINAPI".COPYFILE($result, po_Filename, lv_Error)
if (lv_Error < 0)
message "COPY failed"
return(-1)
endif
return(0)
else
message "Print failed"
return(-1)
endif
endif
return(0)
end PRINT_PROC
This proc puts the printed output into a file and returns the name of that file to the calling procedure. What happens next is entirely up to you. One possible option would be to e-mail the file to someone.
Tony Marston
24th May 2002
mailto:tony@tonymarston.net
mailto:TonyMarston@hotmail.com
http://www.tonymarston.net