Advertisement
Advertisement
| 05.06.2008 at 04:13PM PDT, ID: 23381224 |
|
[x]
Attachment Details
|
||
1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40: 41: 42: 43: 44: 45: 46: 47: 48: 49: 50: 51: 52: 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: |
Imports FAXCOMEXLib
Imports System
Imports Microsoft
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Btn1.Click
'Parameters for the fax server console
'library that connects to faxserver
Dim FaxServer As New FAXCOMEXLib.FaxServer
'FaxServer.ListenToServerEvents(FAX_SERVER_EVENTS_TYPE_ENUM.fsetOUT_QUEUE)
'Faxserver which events are logged
Dim Connection As String
'define a new document
Dim FaxDocument As New FaxDocument
Dim FaxRPTtoSend As String
'added to project for converting pdf's to tif images to
'be able to fax them over without user interaction
Dim PdfConverter As New PDF2ImageConverter
Dim TifDocument As String
Dim User As String
Dim FaxNo As String
'fill in my variables
FaxNo = Txtbx1.Text
User = Txtbx2.Text
FaxRPTtoSend = Txtbx3.Text
TifDocument = FaxRPTtoSend & ".tif"
'Converts specified document if multipage it creates a multipage 'tif in fax format for you.
'go to http://www.verypdf.com/pdf2tif/pdf-to-image-sdk.htm
PdfConverter.ConvertPDFToImage(FaxRPTtoSend, TifDocument, "", "", 160, 170, 1, PDF2ImageConverter.CompressionType.COMPRESSION_CCITTFAX3, 1, False, True, -1, -1)
Connection = Txtbx5.Text
FaxServer.Connect(Connection)
Try
FaxDocument.Recipients.Add(FaxNo, User)
FaxDocument.CoverPageType = FAX_COVERPAGE_TYPE_ENUM.fcptNONE
'The actual document
FaxDocument.Body = TifDocument
FaxDocument.DocumentName = Txtbx6.Text
'Priority
FaxDocument.Priority = FAX_PRIORITY_TYPE_ENUM.fptHIGH
'Sends the document
FaxDocument.Submit(Connection)
Catch ex As Exception
MsgBox("Fax Error" & vbNewLine & ex.Message)
Finally
FaxServer.Disconnect()
End Try
End Sub
End Class
|