关于开发网络传真

vikey 2004-10-09 09:58:11
公司准备开发一套通过WEB发送传真的程序,集合到我们的办公软件中。
请各位朋友给个思路。
  (是不是先把要发送文件转换在传真格式*.tif.然后怎么发送???)
是否有相关源码,实例。
...全文
518 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
速马 2004-10-13
  • 打赏
  • 举报
回复
给你一段我的打印字符串到图片的函数(实际上写的非常烂...):

/// <summary>
/// create a tiff file from a string for fax
/// </summary>
/// <param name="content">the text content</param>
/// <param name="wideCharacter">open wide character support?</param>
/// <param name="folderPath">the temporary folder path</param>
/// <returns>physical path of the tiff file</returns>
public static string CreateFaxFile(string content,bool wideCharacter,string folderPath)
{
int lineCount = 1;
int charWidth;
if(wideCharacter)
{
lineCount += (int)Math.Ceiling(content.Length / 30);
charWidth = 16;
}
else
{
lineCount += (int)Math.Ceiling(content.Length / 60);
charWidth = 8;
}
lineCount += content.Length - content.Replace("\n","").Length;

Bitmap img = new Bitmap(600,100 + lineCount * 20);
Graphics graphic = Graphics.FromImage(img);
Font font = new Font("Courier New",11);
SolidBrush brush = new SolidBrush(Color.Black);

char[] data = content.ToCharArray();
int offsetX = 0;
int offsetY = 0;
for(int i = 0;i < data.Length;i++)
{
string s = data[i].ToString();
graphic.DrawString(s,font,brush,60 + offsetX,50 + offsetY * 20);
offsetX += charWidth;
if(s == "\t")
offsetX += charWidth;
if(offsetX == 480 || s == "\n")
{
offsetX = 0;
offsetY += 1;
}
}

if(folderPath == null || folderPath.Length == 0)
folderPath = Environment.GetEnvironmentVariable("TEMP");
else
{
if(!Directory.Exists(folderPath))
Directory.CreateDirectory(folderPath);
}
string filePath = folderPath + DateTime.Now.ToFileTime().ToString() + ".tif";
FileInfo file = new FileInfo(filePath);
FileStream fs = file.Open(FileMode.CreateNew,FileAccess.Write);
img.Save(fs,ImageFormat.Tiff);
fs.Close();

return filePath;
}
}
vikey 2004-10-13
  • 打赏
  • 举报
回复
up
vikey 2004-10-12
  • 打赏
  • 举报
回复
大家顶呀。关于如何将各种文档格式转换为tif格式,顶者有分
vikey 2004-10-11
  • 打赏
  • 举报
回复
谢谢Sunmast(速马|ALL STAR) 帮我解决了发传真问题.不过格式转换及如何接收还没解决
Mycro 2004-10-11
  • 打赏
  • 举报
回复
up
Eddie005 2004-10-10
  • 打赏
  • 举报
回复
mark
vikey 2004-10-10
  • 打赏
  • 举报
回复
如何把文本转换为tif格式呀,还有如何通过程序接收传真.
wangxt 2004-10-09
  • 打赏
  • 举报
回复
用socket做
速马 2004-10-09
  • 打赏
  • 举报
回复
我写了个完整的class,相当于FAXCOMLib完整功能的封装
速马 2004-10-09
  • 打赏
  • 举报
回复
配置本地FAX服务
引用FAXCOMLib(COM)到工程
使用FaxServer和FaxDoc类发送

需要自己转换文本为tif文件

FaxServer server = new FaxServerClass();
server.Connect(""); // local server
FaxDoc doc = (FaxDoc)server.CreateDocument("faxFileName");
doc.xxx = xxx...
...
doc.Send();
server.Disconnect();
bitsbird 2004-10-09
  • 打赏
  • 举报
回复
mark
孟子E章 2004-10-09
  • 打赏
  • 举报
回复
这里提供一个发传真的程序,可以参考思路

How To Send a Fax from an ASP Page on Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;303647&Product=asp
leezjs 2004-10-09
  • 打赏
  • 举报
回复
ding
没我说话的份了
要继续努力了 :)
vikey 2004-10-09
  • 打赏
  • 举报
回复
up

110,579

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧