关于传真的问题(50分)

  • 主题发起人 主题发起人 zxjfire
  • 开始时间 开始时间
Z

zxjfire

Unregistered / Unconfirmed
GUEST, unregistred user!
请问谁有传真程序的源代码
或者谁能告诉我哪有免费的传真控件
 
没有人会吗??
 
我有一个,自己编的,适用于东进D080F传真卡,你看看!
Procedure Dj_D160A.AskFaxPage ;//传真公积金明细请按4
Var j,TotalPages : Word ;
IsFaxEnd,IsTransOK : Boolean ;
IsWait : Boolean ;
procedure CoverFax(PageNo,TotalPages:Word) ;
//第几页共几页
var St : string ;
i : integer;
begin
//可以加印章
RunMsg('传真转换:确定转换文件') ;
sPicPage := 'J:/公积金查询/GRAPHICS/Fax_Bmp/'
+DjForm[LineNo].sDjnPID+' '+IntToHex(LineNo+1,3)+IntToHex(PageNo,2)
+'.Bmp' ;
sFaxPage := 'J:/公积金查询/GRAPHICS/Fax_Bfx/'
+DjForm[LineNo].sDjnPID+' '+IntToHex(LineNo+1,3)+IntToHex(PageNo,2)
+'.Bfx' ;
DjForm[LineNo].Image1.Picture.Bitmap.LoadFromResourceName(HInstance,'BlankBMP') ;
{
Image1.Picture.Bitmap.PixelFormat := pf1bit ;
Image1.Picture.Bitmap.Transparent := True ;
Image1.Picture.Bitmap.TransparentColor := clWhite ;
Image1.Picture.Bitmap.Height := 1800 ;
Image1.Picture.Bitmap.Width := 1728 ;
Image1.Picture.Bitmap.TransparentMode ;
}
// TextOut(行点,列点)
RunMsg('传真转换:转换抬头') ;
DjForm[LineNo].Image1.Canvas.Lock ;
DjForm[LineNo].Image1.Canvas.Font.Name := 'Arial' ;
DjForm[LineNo].Image1.Canvas.Font.Size := 48 ;
DjForm[LineNo].Image1.Canvas.TextOut(400,100,'住房公积金传真明细清单') ;
RunMsg('传真转换:转换个人资料') ;
DjForm[LineNo].Image1.Canvas.Font.Size := 28 ;
DjForm[LineNo].Image1.Canvas.TextOut(100 ,200,'姓名:'+DjForm[LineNo].ADOQueryNamename.Value) ;
DjForm[LineNo].Image1.Canvas.TextOut(1000,200,'账号:'+DjForm[LineNo].ADOQueryNamecode.Value) ;
DjForm[LineNo].Image1.Canvas.TextOut(100 ,250,'身份证号:'+DjForm[LineNo].ADOQueryNameadd.Value) ;
DjForm[LineNo].Image1.Canvas.TextOut(1000,250,'第'+InttoHex(PageNo,2)+'页共'+InttoHex(TotalPages,2)+'页') ;
RunMsg('传真转换:转换总余额') ;
St := '总余额: ' + FloatToStrF(DjForm[LineNo].SumAll,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(100,300,St) ;
St := '总缴存: ' + FloatToStrF(DjForm[LineNo].SumTotal,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(500,300,St) ;
St := '总支取:' + FloatToStrF(DjForm[LineNo].SumDr,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(900,300,St) ;
RunMsg('传真转换:转换本年度缴存') ;
St := '本年度缴存:'+FloatToStrF(DjForm[LineNo].SumCr,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(100,350,St) ;
St := '本年度补缴:'+FloatToStrF(DjForm[LineNo].SumBz,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(500,350,St) ;
St := '本年度转移:'+FloatToStrF(DjForm[LineNo].SumZy,ffCurrency,15,2) ;
DjForm[LineNo].Image1.Canvas.TextOut(900,350,St) ;
//还欠“年度期初余额”项!!
DjForm[LineNo].Image1.Canvas.TextOut(450 ,400,DjForm[LineNo].sGjjInitText[8]+'年度住房公积金缴交明细') ;
RunMsg('传真转换:转换单位缴交部分') ;
DjForm[LineNo].Image1.Canvas.TextOut(100 ,450,'单位缴交部分:'+DjForm[LineNo].ADOQuery_Gjjtotal.AsString+'元/月') ;
RunMsg('传真转换:画表格线') ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,500) ;
DjForm[LineNo].Image1.Canvas.LineTo(100 ,700) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,500) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,500) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,550) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,550) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,600) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,600) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,650) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,650) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,700) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,700) ;
for i:=1 to 6 do
begin
DjForm[LineNo].Image1.Canvas.MoveTo(100+i*200,500) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+i*200,700) ;
DjForm[LineNo].Image1.Canvas.TextOut(i*200-30,502,inttostr(i+6)+'月') ;
DjForm[LineNo].Image1.Canvas.TextOut(i*200-30,602,inttostr(i)+'月') ;
end ;
RunMsg('传真转换:转换单位缴交部分7~12月') ;
DjForm[LineNo].Image1.Canvas.TextOut(1*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate07.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(2*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate08.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(3*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate09.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(4*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate10.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(5*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate11.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(6*200-90,552,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate12.AsString)) ;
RunMsg('传真转换:转换单位缴交部分1~6月') ;
DjForm[LineNo].Image1.Canvas.TextOut(1*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate01.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(2*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate02.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(3*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate03.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(4*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate04.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(5*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate05.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(6*200-90,652,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjddate06.AsString)) ;
RunMsg('传真转换:转换个人缴交部分') ;
DjForm[LineNo].Image1.Canvas.TextOut(100 ,710,'个人缴交部分:'+DjForm[LineNo].ADOQuery_Gjjtotal.AsString+'元/月') ;
RunMsg('传真转换:画个人缴交部分表格线') ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,750) ;
DjForm[LineNo].Image1.Canvas.LineTo(100 ,950) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,750) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,750) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,800) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,800) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,850) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,850) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,900) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,900) ;
DjForm[LineNo].Image1.Canvas.MoveTo(100 ,950) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+6*200,950) ;
for i:=1 to 6 do
begin
DjForm[LineNo].Image1.Canvas.MoveTo(100+i*200,750) ;
DjForm[LineNo].Image1.Canvas.LineTo(100+i*200,950) ;
DjForm[LineNo].Image1.Canvas.TextOut(i*200-30,752,inttostr(i+6)+'月') ;
DjForm[LineNo].Image1.Canvas.TextOut(i*200-30,852,inttostr(i)+'月') ;
end ;
RunMsg('传真转换:转换个人缴交部分7~12月') ;
DjForm[LineNo].Image1.Canvas.TextOut(1*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate07.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(2*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate08.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(3*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate09.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(4*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate10.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(5*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate11.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(6*200-90,802,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate12.AsString)) ;
RunMsg('传真转换:转换个人缴交部分7~12月') ;
DjForm[LineNo].Image1.Canvas.TextOut(1*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate01.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(2*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate02.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(3*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate03.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(4*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate04.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(5*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate05.AsString)) ;
DjForm[LineNo].Image1.Canvas.TextOut(6*200-90,902,DjForm[LineNo].GjjddateGetText(DjForm[LineNo].ADOQuery_Gjjzdate06.AsString)) ;
RunMsg('传真转换:转换落款') ;
DjForm[LineNo].Image1.Canvas.TextOut(700,1000,DjForm[LineNo].sGjjInitText[$0B]) ;
DjForm[LineNo].Image1.Canvas.TextOut(750,1050,DateTimeToStr(Now)) ;
DjForm[LineNo].Image1.Canvas.Font.Size := 18 ;
DjForm[LineNo].Image1.Canvas.TextOut(550,1100,DjForm[LineNo].sGjjInitText[$0F]) ;
RunMsg('保存保存图像'+sPicPage) ;
DjForm[LineNo].Image1.Picture.Bitmap.SaveToFile(sPicPage) ;
DjForm[LineNo].Image1.Canvas.Unlock ;
RunMsg('传真转换:转换图像') ;
Synchronize(DjDJCvt_Open) ;
If FaxFileOpened=FaxFileCannotOpen then
begin
RunMsg('传真文件打开失败!') ;
IsTransOK := false ;
End
else
begin
Synchronize(DjDJCvt_BmpFile) ;
Synchronize(DjDJCvt_Close) ;
RunMsg('传真转换:转换图像成功') ;
End ;
End ;
Procedure CreateBitMap ;
Var j: Word ;
begin
IsTransOK := True ;
For j:=1 to TotalPages do
begin
DjForm[LineNo].ReOpenDbfs ;
//打开相关的数据库并计算相关的结果
RunMsg('传真:转换第'+InttoHex(j,2)+'页') ;
CoverFax(j,TotalPages) ;
If Not IsTransOK then
Exit ;
DjForm[LineNo].ADOQueryName.Next ;
End ;
End ;
begin
If Not GjjMainForm.IsD080FOk then
begin
//若无传真卡或传真卡未能正常工作
PlayaStr('32001',false,false) ;//x32001 尼个功能尚未开通
RunMsg('传真:尼个功能尚未开通 ') ;
End
else
begin
//传真卡已正常工作
//x00038 提取明细数据大约需要半分钟甚至更长的时间,请稍候!
PlayaStr('00038',false,false) ;
TotalPages := DjForm[LineNo].ADOQueryName.RecordCount ;
CreateBitMap ;
If Not IsTransOK then
Exit ;
Synchronize(DjDJFax_GetOneFreeFaxChnl) ;
//确定传真通道
If FaxChn=AllChnlBusy then
begin
//若无空闲通道,不可发传真
RunMsg('传真:没有可用的传真通道') ;
// PlayAStr('对不起,传真线路忙,请嗣后再拨打我们的电话',true,false)
End
else
begin
RunMsg('传真通道:'+InttoStr(FaxChn)) ;
//x00025 而家请开好传真机
PlayAStr('00025',false,false) ;
RunMsg('x00025 而家请开好传真机') ;
Sleep(1200) ;
Synchronize(DjStopPlayFile);
//语音卡与传真卡连接之前需保证不再播音
Synchronize(DjDJFax_SetLink) ;
If LineLink=LinkFault then
begin
//若语音卡与传真卡连接失败
RunMsg('传真:语音卡与传真卡连接失败') ;
// PlayAStr('对不起,传真固障',true,false)
End
else
begin
RunMsg('传真标识:'+DjForm[LineNo].sGjjInitText[$0B]) ;
Synchronize(DjDJFax_SetLocalID) ;
For j:=1 to TotalPages do
begin
RunMsg('传真:发送第'+InttoHex(j,2)+'页共'+InttoHex(TotalPages,2)+'页') ;
sFaxPage := 'J:/公积金查询/GRAPHICS/Fax_Bfx/'
+DjForm[LineNo].sDjnPID+' '+IntToHex(LineNo+1,3)+IntToHex(J,2)
+'.Bfx' ;
Synchronize(DjDJFax_SendFaxFile) ;
If PagesOfThis <= 0 then
begin
//无需发送
RunMsg('传真:无发送页') ;
End
else
begin
//需发送TotalPage页
//循环维持传真发送
RunMsg('传真:持续发送第'+InttoHex(j,2)+'页') ;
Repeat
//Application.ProcessMessages ;
//防死占CPU
RunMsg('传真:持续发送第'+InttoHex(j,2)+'页') ;
Synchronize(DjDJFax_CheckTransmit) ;
IsFaxEnd := False ;
//继续发送
Case FaxTransed Of
1 : begin
//发完传真
IsFaxEnd := True ;
//停止发送
RunMsg('传真:发完传真') ;
End ;
2 : begin
//发完一页
IsFaxEnd := False ;
//继续发送
RunMsg('传真:发完一张') ;
End ;
-1,-2 : begin
//发送传真失败
IsFaxEnd := True ;
//停止发送
RunMsg('传真:发送传真失败') ;
End ;
End ;
Until IsFaxEnd ;
End ;
End ;
RunMsg('传真:发送完毕') ;
Synchronize(DjDJFax_StopFax);
//停止传真发送
RunMsg('传真:拆除语音卡与传真卡连接') ;
Synchronize(DjDJFax_ClearLink) ;
//x00026 传真完毕!
PlayaStr('00026',false,false) ;
End ;
End ;
End ;
RunMsg('查完:传真公积金明细') ;
End ;
 
可以用modem实现
请到我的主页上看http://wenjinshan.yeah.net或wenjinshan.mycool.net
 
来自http://wenjinshan.yeah.net或wenjinshan.mycool.net的
《Delphi串口及语音传真编程》已出版
 
后退
顶部