Click or drag to resize

FaxResourceSend Method (String)

Sends the specified document as a fax from the specified file and path.

Namespace:  VoiceElements.Client
Assembly:  VoiceElementsClient (in VoiceElementsClient.dll) Version: 8.6.1.1
Syntax
public FaxResult Send(
	string filename
)

Parameters

filename
Type: SystemString
This is the path and filename of the document file you would like to send as a Fax.

Return Value

Type: FaxResult
This method returns a Fax Result. See the enumeration definition for an explanation of all possible results.
Remarks
Getting Your Fax Resource

Before calling this method, you will want to use the Get Fax Resource to acces a Fax Resource object on which to call the receive method. Also note that at any time you may query the Fax Resource Property of the Channel to get access to this object.

Make Sure You Have Fax Licenses

Note that Fax Resources are limited to the number of Fax licenses you have purchased. To obtain licenses, contact Inventive Labs sales. Email us with this link.

Use Tiff File Format - Best Practices

Voice Elements uses Tiff graphic files for transport. It is always a good idea to clean up a Tiff file for transport (get the resolution right and more). We have provided a simple way to do this using the Tiff to Tiff method. You should call this before transport as shown in the sample code below.

Don't Have Tiff Files? Convert Them

Voice Elements uses Tiff graphic files for transport. If you don't have Tiff files to send, we have created simple ways to convert files using the Jpeg to Tiff method and the Pdf to Tiff method. This is shown in the sample code below.

Don't Forget the Fax Result

Although the example below doesn't show this, you may want to switch on the reult and take actions in your application accordingly.

Examples
The example below shows using the returned Fax Resource to Send or Receive faxes using your channel.

Please note that in your production code, you will generally need to handle an New Inbound Call Event to receive a fax or place an oubopund call using a Dial Method call. What is shown below is simply to illustrate the use of the resource and send / receive.

public static void SendReceiveFax()
{
  // To get a channel, you must first get a link to a Telephony Server.  You may need to pass a username password here.
  TelephonyServer m_TelephonyServer = new TelephonyServer();

  // Get your channel resource from the server
  ChannelResource m_ChannelResource = m_TelephonyServer.GetChannel();

  // Get a Fax Resource for the channel
  FaxResource m_FaxResource = m_ChannelResource.GetFaxResource();

  // Set a variable to send or recieve, you will want your code to deteremine this elsewhere
  string FaxCommand = "Send";

  // Note here:  If you have a jpg file, use this to convert it to a TIFF for transport.  If your file is already a TIFF, comment out the line that follows
  m_TelephonyServer.JpgToTif("test.jpg", "test.tif");
  // Note here:  It is always a good idea to clean up a raw graphic file for transport using the tif2tif function
  m_TelephonyServer.TifToTif("test.tif", "testfinal.tif");

  // Set variable for the file to send or receive, you will want your code to deteremine this elsewhere
  string FaxFile = @"C:\FaxFiles\testfinal.tif";

  switch (FaxCommand)
  {
    case "Send":
      m_FaxResource.Send(FaxFile);
      break;
    case "Receive":
      m_FaxResource.Receive(FaxFile);
      break;
  }
}
See Also