Special File Handling
*PLUSFAX* FAX Print Interface
  This functionality is a +PxPlus Exclusive
Formats OPEN (chan[,fileopt])"*PLUSFAX*[;option][;option] [...]"

Where:

chan Channel or logical file number.
fileopt File options. Supported options for opening *PLUSFAX* include:
ERR=stmtref Error transfer.
OPT=options Additional PlusFax output parameters (See Output Parameters below).
options Supported parameters for defining output. (See Output Parameters described below.)
*PLUSFAX* Case insensitive keyword. Special device file name, enclosed in quotation marks within OPEN directive. (Include asterisks in syntax.)
   
Description The *PLUSFAX* interface allows for the generation and sending of FAXes directly from the application program. When a *PLUSFAX* file is opened and written to, the output produced is automatically converted to a PDF and then emailed to a fax server for subsequent transmission.

An account with an internet based service is required to use "*PLUSFAX*".

*PLUSFAX* Output Parameters

The following options can be used to define the fax output.

Option Description
FAXNO=nnnnnnnnnn This is used to define the destination fax number. The number must contain the desired area code.
SUBJECT=string The text in 'string' will be placed in the Subject line on the cover page of the fax.
COVER=string The text in 'string' may contain the comment to appear on the cover page or "NO" to indicate no cover page is to be generated. If a long message is required, the string may start with a % to indicate that the cover page message can be found in a global string variable. (e.g. COVER=%NOTE would indicate that the message is in the global variable %NOTE$). A global variable should be used if the message text contains a semi-colon.
FILE=FileName Allows for specification of the output file pathname. By default, a temporary PDF file is created by the system, however; you can override the pathname of the PDF file.
FROMNAME=string This is the logical name to be used with the email address and override the default userid and settings file. In some instances this will be used by the fax service supplier to identify your account.
DIRECTORY=directory Option used to override the directory where the interface maintains the settings, control and temporary PDF files. By default, this will be 'plusfax'.
PAPERSIZE=FormNumber Allows for specification of form via an internal form number (see Forms Handling in PDF).

All other parameters will be passed to the PDF output driver and can be used to control the margins etc. See PDF Print Interface.

   
Configuration Before using "*PLUSFAX*", you will need to create a working directory that will be used to store the temporary PDF files, the control file (history.dat) and the 'settings' file.

The 'settings' file:

The settings file contains information pertaining to the transmission of the faxes. This file is required by the fax interface. It will define the Email account, which will be used to send the faxes, your email server settings, and userids. The values that must be placed in the settings file:

Option Description
FAXTO=string This defines the output send fax address. The value %1 within the string will be replaced by the destination fax number. The target domain (the part following the @) will be used by the for determining the format of the email header.
FROMEMAIL=string This defines the sending email account that is to be used to send the email fax (e.g mike.king@pvxplus.com)
FROMNAME=string This is the logical name to be used with the email address. In some instances this will be used by the fax service supplier to identify your account. If set to -none- no name will provided -- only the from email address.
SMTPSERVER=string This string contains the TCP/IP address/host name for the email server used to forward the fax email. By default, the standard SMTP port of 25 is used; however, a specific port number may be appended to the address field, separated by a semi-colon.
LOGON=string If your email server requires you to logon to send email, you may enter the userid and password required in the string separated by a semi-colon or a comma.
Fax server Account information
CODE=string This is the account access code provided by your fax supplier. Not all suppliers have a passcode.
USERNAME=string This defines the internet based account used to send the fax and will be inserted into the out bound email. Not all suppliers require a user name.

As the fax output will be generated using the PDF drivers built into PxPlus, all PDF output commands and options are supported however, some may not be applicable to fax output (e.g. bookmarks).

The settings required will vary between fax suppliers. For example Trustfax.com requires a CODE= and USERNAME= as in the following 'settings' file:

smtpserver=mail.mydomain.com
fromemail=f.smith@mydomain.com
fromname=Fred Smith
faxto=<%1@trustfax.com>
username=fred_smith
code=1234

   
User Interface If no fax number is provided on the OPEN command, the PLUSFAX interface will prompt the user to provide it along with a subject line and option comment for the cover page.

In order to prompt the user for these fields, the system will run either a user supplied program in "*ext/plusfax" or, if not present, a system program in "*ext/system/plusfax". These programs are required to define values in FAXNO$, SUBJECT$, and COVER$.

   
Examples The following are a couple of examples using "*PLUSFAX*" for output:

This example sends a listing of itself to a fax recipient (Fax demo program):

0010 INPUT "Fax number:",FAXNO$
0020 INPUT "Attention:",PERSON$
0030 !
0040 LET %MSG$="Please forward this cover sheet and fax to:"+SEP
0050 LET %MSG$+=SEP
0060 LET %MSG$+=PERSON$+SEP
0070 LET %MSG$+=SEP
0080 LET %MSG$+="This is a sample fax generated using the PVX Plus Technologies *PLUSFAX* interface. It includes both a cover sheet and program listing"
0090 !
0100 LET OPTION$="FAXNO="+FAXNO$
0110 LET OPTION$+=";SUBJECT=Attention "+PERSON$
0120 LET OPTION$+=";COVER=%MSG" ! Message text in variable
0130 !
0140 OPEN (1,OPT=OPTION$)"*plusfax*;margin=1i:1i:1i:1i"
0150 PRINT (1)'FONT'("Arial",1),'DF','+S',
0160 PRINT (1)'RECTANGLE'(-10,-10,@X(MXC(1))+10,@Y(MXL(1))+10),
0170 PRINT (1)"The following is a listing of the program that generated this fax"
0180 PRINT (1)DIM(MXC(1),"=")
0190 LIST (1)
0200 PRINT (1)DIM(MXC(1),"=")
0210 PRINT (1)"You are able to use all text and graphical print commands"
0220 PRINT (1)"this includes graphic drawing and images."
0230 PRINT (1)'CIRCLE'(@X(30),@Y(45),@X(15)),
0240 PRINT (1)'PICTURE'(@X(20),@Y(40),@X(40),@Y(50),"smlogo.jpg",6),
0250 END

The example shows a typical report using normal print directives:

0010 BEGIN
0020 LET %NOTE$="Dear Sirs;"+SEP+SEP+"The following is a report of the stuff that you asked about formatted in a way that is similar to what you asked for however using a better solution than what you currently have."
0030 OPEN (1,OPT="cover=%note;subject=Your Report")"*plusfax*;faxno=8889757587"
0040 PRINT (1)'FONT'("Arial",1),'DF','+S',
0050 WHILE 1
0060 READ DATA COMPANY$,CUSTNO$,NAME$,ADDR$,OWES,END=*BREAK
0070 IF LINESLEFT<1 OR COMPANY$<>CURCOMP$ THEN GOSUB NEWPAGE
0080 PRINT (1)CUSTNO$,@(10),NAME$,@(40),ADDR$,@(70),OWES:"-$###,##0.00"
0090 LINESLEFT--
0100 WEND
0110 END
0120 !
0130 NEWPAGE:
0140 IF PAGENO<>0 THEN PRINT (1)'FF',
0150 PAGENO++
0160 PRINT (1)"Page:",PAGENO:"###0",@(30),"Client list for "+COMPANY$
0170 PRINT (1)
0180 PRINT (1)"Client",@(10),"Name",@(40),"Address",@(70),"Balance"
0190 PRINT (1)"------",@(10),DIM(20,"-"),@(40),DIM(20,"-"),@(70),"------------"
0200 PRINT (1)
0210 LET LINESLEFT=50
0220 LET CURCOMP$=COMPANY$
0230 RETURN
0240 DATA "ABC","000047","Cyclops Car Dealer","6675 Cherry",3.12
0250 DATA "ABC","000122","Global Undergarments","823 Maple Lodge Court",99.54
0260 DATA "ABC","000192","The Hungry Incorporated","5582 2nd Avenue",.55
0270 DATA "ABC","000295","The Hungry Magazine","8576 Major Mackenzie",71.74
0280 DATA "ABC","000310","New Dimensions Company","8052 Center Avenue",5.93
0290 DATA "ABC","000332","Cyclops Computing","7723 Fantasy Island",7.61
0300 DATA "DEF","000355","Kitty Kay Undergarments","2124 Major Mackenzie",4.55
0310 DATA "DEF","000385","New Age Importers","1743 Allstate Parkway",73.84
0320 DATA "DEF","000461","SOTA Golf club","4377 Major Mackenzie",63.66
0330 DATA "DEF","000555","Mike was here","8450 Buga-Buga Drive",11.43
0340 DATA "DEF","000598","Yorktown Body Shop","5674 One-way Street",8.53
0350 DATA "DEF","000874","Elephant Importers","8656 Main",74.63
0360 DATA "DEF","000899","Silly Walks Computing","3920 North Tacoma",60.31
0370 DATA "DEF","000978","Crimson Magazine","2303 Steep Hill Drive",86.16
0380 DATA "DEF","001072","Flagship Trading Limited","2782 Aurora Road",90.15
0390 DATA "DEF","001081","Snap Dragon Grocers","3682 East West Street",49.51

Notice that we used %NOTE$ to store the cover page note since, the contents of the note contained a semi-colon.