Send Fax

Simple Fax Example

The following example demonstrates how to send a PDF document as a fax. Sending a fax is similar to sending a PDF to a printer except you should use the FaxPrintJob rather than the PrintJob and you will want to use the name of the fax service instead of the printer name.

FaxPrintJob faxPrintJob = new FaxPrintJob("FaxPrinterName", "9,1-555-389-4567", pdfFilePath);
faxPrintJob.Print();        
Dim MyFaxPrintJob As FaxPrintJob = New FaxPrintJob("FaxPrinterName", "9,1-555-389-4567", pdfFilePath)
MyFaxPrintJob.Print()      

Fax with Cover Page Example

This example demonstrates adding a cover page to a PDF document and sending it as a fax.

FaxPrintJob faxPrintJob = new FaxPrintJob("FaxPrinterName", "9,1-555-389-4567", pdfFilePath);
faxPrintJob.FaxOptions.CoverPage = new ServerCoverPage("confdent2"); // If FaxOptions.CoverPage is null, no cover page is added
//faxPrintJob.FaxOptions.CoverPage = new LocalCoverPage("C:\\\\Temp\\\\Custom.cov"); // uses a local .cov file
            
faxPrintJob.FaxOptions.CoverPage.Note = "Note";
faxPrintJob.FaxOptions.CoverPage.RecipientCity = "RecipientCity";
faxPrintJob.FaxOptions.CoverPage.RecipientCompany = "RecipientCompany";
faxPrintJob.FaxOptions.CoverPage.RecipientCountry = "RecipientCountry";
faxPrintJob.FaxOptions.CoverPage.RecipientDepartment = "RecipientDepartment";
faxPrintJob.FaxOptions.CoverPage.RecipientFaxNumber = "RecipientFaxNumber";
faxPrintJob.FaxOptions.CoverPage.RecipientHomePhone = "RecipientHomePhone";
faxPrintJob.FaxOptions.CoverPage.RecipientName = "RecipientName";
faxPrintJob.FaxOptions.CoverPage.RecipientOfficeLocation = "RecipientOfficeLocation";
faxPrintJob.FaxOptions.CoverPage.RecipientOfficePhone = "RecipientOfficePhone";
faxPrintJob.FaxOptions.CoverPage.RecipientState = "RecipientState";
faxPrintJob.FaxOptions.CoverPage.RecipientStreetAddress = "RecipientStreetAddress";
faxPrintJob.FaxOptions.CoverPage.RecipientTitle = "RecipientTitle";
faxPrintJob.FaxOptions.CoverPage.RecipientZip = "RecipientZip";
faxPrintJob.FaxOptions.CoverPage.SenderAddress = "SenderAddress";
faxPrintJob.FaxOptions.CoverPage.SenderCompany = "SenderCompany";
faxPrintJob.FaxOptions.CoverPage.SenderDepartment = "SenderDepartment";
faxPrintJob.FaxOptions.CoverPage.SenderFaxNumber = "SenderFaxNumber";
faxPrintJob.FaxOptions.CoverPage.SenderHomePhone = "SenderHomePhone";
faxPrintJob.FaxOptions.CoverPage.SenderName = "SenderName";
faxPrintJob.FaxOptions.CoverPage.SenderOfficeLocation = "SenderOfficeLocation";
faxPrintJob.FaxOptions.CoverPage.SenderOfficePhone = "SenderOfficePhone";
faxPrintJob.FaxOptions.CoverPage.SenderTitle = "SenderTitle";
faxPrintJob.FaxOptions.CoverPage.Subject = "Subject";
faxPrintJob.Print();        
Dim MyFaxPrintJob As FaxPrintJob = New FaxPrintJob("FaxPrinterName", "9,1-555-389-4567", pdfFilePath)
MyFaxPrintJob.FaxOptions.CoverPage = New ServerCoverPage("confdent2")  ' If FaxOptions.CoverPage is null, no cover page is added
'MyFaxPrintJob.FaxOptions.CoverPage = new LocalCoverPage("C:\\Temp\\Custom.cov"); ' uses a local .cov file

MyFaxPrintJob.FaxOptions.CoverPage.Note = "Note"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientCity = "RecipientCity"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientCompany = "RecipientCompany"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientCountry = "RecipientCountry"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientDepartment = "RecipientDepartment"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientFaxNumber = "RecipientFaxNumber"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientHomePhone = "RecipientHomePhone"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientName = "RecipientName"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientOfficeLocation = "RecipientOfficeLocation"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientOfficePhone = "RecipientOfficePhone"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientState = "RecipientState"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientStreetAddress = "RecipientStreetAddress"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientTitle = "RecipientTitle"
MyFaxPrintJob.FaxOptions.CoverPage.RecipientZip = "RecipientZip"
MyFaxPrintJob.FaxOptions.CoverPage.SenderAddress = "SenderAddress"
MyFaxPrintJob.FaxOptions.CoverPage.SenderCompany = "SenderCompany"
MyFaxPrintJob.FaxOptions.CoverPage.SenderDepartment = "SenderDepartment"
MyFaxPrintJob.FaxOptions.CoverPage.SenderFaxNumber = "SenderFaxNumber"
MyFaxPrintJob.FaxOptions.CoverPage.SenderHomePhone = "SenderHomePhone"
MyFaxPrintJob.FaxOptions.CoverPage.SenderName = "SenderName"
MyFaxPrintJob.FaxOptions.CoverPage.SenderOfficeLocation = "SenderOfficeLocation"
MyFaxPrintJob.FaxOptions.CoverPage.SenderOfficePhone = "SenderOfficePhone"
MyFaxPrintJob.FaxOptions.CoverPage.SenderTitle = "SenderTitle"
MyFaxPrintJob.FaxOptions.CoverPage.Subject = "Subject"
MyFaxPrintJob.Print()

In this topic