473,686 Members | 2,753 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Tiff File Creation For Fax With FAXCOMLib

Hi All,

I am trying to create a .tiff file to fax using the windows fax service
FAXCOMLib.
I have created an array of images (bitmaps) and converted them to 1pbb
format in order to allow CCITT3/4 compression for faxing.

The .Tiff file appears to be created successfully however when I try to send
the file as a fax I get the error:
System.Runtime. InteropServices .COMException (0x8007000D): The data is
invalid.

Most other file formats (.txt, .doc etc) send are sent using my faxing code
fine.
My code to send the fax is:

Dim fs As New FAXCOMLib.FaxSe rverClass
fs.Connect(Envi ronment.Machine Name) '//specifies the machinename
Dim obj As Object = fs.CreateDocume nt(pathToImage)
Dim fd As FAXCOMLib.FaxDo c = CType(obj, FAXCOMLib.FaxDo c)
fd.FaxNumber = txtNumber.Text
Dim i As Integer = fd.Send()
fd = Nothing
fs.Disconnect()
fs = Nothing

As the code above appears to function correctly when not sending one of the
tiff images I have created, Im guessing that Im doing something wrong in my
Tiff image creation code:

Private Function createTiffImage (ByVal bitmapArray() As Bitmap) As String
'get the codec for tiff files
Dim info As ImageCodecInfo = Nothing
Dim ice As ImageCodecInfo
Dim faxPath As String = Application.Sta rtupPath & "\SPLREP\Fax.ti ff"

For Each ice In ImageCodecInfo. GetImageEncoder s()
If ice.MimeType = "image/tiff" Then
info = ice
End If
Next ice

'use the save encoder
Dim enc As Encoder = Encoder.SaveFla g
Dim enc1 As Encoder = Encoder.Compres sion

Dim ep As New EncoderParamete rs(2)

ep.Param(0) = New EncoderParamete r(enc, CLng(EncoderVal ue.MultiFrame))
ep.Param(1) = New EncoderParamete r(enc1,
CLng(EncoderVal ue.CompressionC CITT3))

Dim pages As Bitmap = Nothing
Dim i As Integer = 0

For i = 0 To bitmapArray.Get UpperBound(0) Step 1
If i = 0 Then
'save the first frame
pages = bitmapArray(i)
pages.Save(faxP ath, info, ep)
Else
'save the intermediate frames
ep.Param(0) = New EncoderParamete r(enc,
CLng(EncoderVal ue.FrameDimensi onPage))
ep.Param(1) = New EncoderParamete r(enc1,
CLng(EncoderVal ue.CompressionC CITT3))
pages.SaveAdd(b itmapArray(i), ep)
End If

If i = bitmapArray.Get UpperBound(0) Then
'flush and close.
ep.Param(0) = New EncoderParamete r(enc, CLng(EncoderVal ue.Flush))
ep.Param(1) = New EncoderParamete r(enc1,
CLng(EncoderVal ue.CompressionC CITT3))
pages.SaveAdd(e p)
End If
Next
Return faxPath
End Function

The Tiff images seem to be recognised by image manipulation programs (e.g.
IrfanView) but are invalid as fax files. What do I need to do to make the
Tiff image a valid fax file?

Thanx very much in advance for all your help.

Will @ Multepos

Nov 21 '05 #1
0 2009

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1433
by: Ponty | last post by:
HI, I'm trying to send a fax to our server via a .net web page, but I keep getting permission errors. The code works fine on win xp, but on 2000, i get System.UnauthorizedAccessException: Access is denied. at FAXCOMLib.IFaxDoc.Send() at faxtest.WebForm1.Page_Load(Object sender, EventArgs e)
0
1692
by: Will Arrowsmith | last post by:
Hi All, I am aiming to create a multiframe Tiff file that I can fax using the windows fax service FAXCOMLib. I have created an array of Bitmaps (pages I want in my fax doc) and succesfully converted them all to be 1bppIndexed. I then combine all bitmaps into a single multiframed Tiff file (with CCITT3 compression) before attempting to fax the file. When I call the send method of the fax routine I get the error:
5
7345
by: Eddie Leung | last post by:
Hi All, As I know that the tiff contain header information, I can use one software called tifftags.exe to get tiff tag information. However, I can't get any reference from vb.net to do such feature. Please advise.. Thanks. Eddie
6
10029
by: qysbc | last post by:
I have a web page and there is a link to open a TIFF file. The way I do it is to have the server code open a binary stream, set the content type to "image/tiff" and call Response.BinaryWrite. On the client machine, the file type TIFF is associated with Kodak Imaging Preview. This app works on most client machines. When you click on the link, Kodak Imaging Preview will open the TIFF file on the client machine. However, on some machines, the...
5
15003
by: Sameer Gupta | last post by:
what are options for opening / handling tiff files in .Net framework ? which is the best library, namespace ? Please help Regards Sameer Gupta C# Designer & Developer Siemens UK
0
1408
by: Stedak | last post by:
We are scanning images and saving them as TIFF's in a database. We are running into some problems because in the creation of the TIFF the EncoderValue.CompressionLZW is ignored. It does not seem to do anything with the compression parameter and image size ends up being enormous. An image is 4000kb when creating the TIFF in code compared to 300kb when the scanner saves the image directly to the hard drive. As a result our database is...
7
3785
by: Ben | last post by:
Hi We are looking for a component that offers that offers the below for Tiff files: Image clean-up (deskew, despeckle) Printing capabilities from VB The ability to add text to image, e.g. time / date Nice to have:
8
1497
by: Robert Dufour | last post by:
I been trying to look for samplecodes on how to create a simple tif file. I found a lot of commercial and stuff but I would prefer to roll my own. I only need to put some formatted text in a tif file so it can be faxed out. Does anyone now where I could find some sample source code. It can`t be all that big a secret :-) Regards, Bob
2
4974
by: mndprasad | last post by:
hi all i am doing a project in java where i need to convert 10 jpeg images into a single tiff image..conversion of single jpeg image to single tiff is happening but embedding all the 10 jpeg images into a single tiff is not happening..i hav tried out with single image conversion.. My code is *********************** import java.awt.image.BufferedImage; import java.io.File; import java.io.IOException; import javax.imageio.ImageIO;
0
8584
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9054
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8932
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8768
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8778
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7599
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6440
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5796
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
2945
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.