是这样的我遍得是支票打印程序坐标是我用尺量号存于数据库中的打印是直接调用坐标我在VB中调用很好代码如下:
Sub fconn() '支票打印
'connstring = "provider=microsoft.jet.oledb.4.0;data source=" & App.Path & "/jmdata.mdb"
Set conn_location = CreateObject("adodb.connection"
conn_location.Open connstring
Set rs_location = conn_location.Execute("select * from BANKLOCATION "
'支票各项目定位
Set rs_x_y = conn_location.Execute("select * from FBANK_X_Y"
'左右边距
Set rs_font_load = conn_location.Execute("select * from fzpfont"
Printer.Orientation = 2 '设置进纸方式
Printer.PaperSize = vbPRPSA4 '设置纸张大小为A4
Printer.ScaleMode = vbCentimeters '以厘米为单位设置打印位置
'设置支票年月日打印字体及打印大小
Printer.Font = rs_font_load.Fields!ffont
Printer.FontSize = rs_font_load.Fields!fzpymdfont
'年
Printer.CurrentX = Val(rs_location.Fields!FYEAR_X) + Val(rs_x_y.Fields!fbank_x)
Printer.CurrentY = Val(rs_location.Fields!FYEAR_Y) + Val(rs_x_y.Fields!fbank_y)
Printer.Print Label2.Caption;
'月
Printer.CurrentX = Val(rs_location.Fields!FMONTH_X) + Val(rs_x_y.Fields!fbank_x)
Printer.CurrentY = Val(rs_location.Fields!FMONTH_Y) + Val(rs_x_y.Fields!fbank_y)
Printer.Print Label3.Caption;
'日
Printer.CurrentX = Val(rs_location.Fields!FDAY_X) + Val(rs_x_y.Fields!fbank_x)
Printer.CurrentY = Val(rs_location.Fields!FDAY_Y) + Val(rs_x_y.Fields!fbank_y)
Printer.Print Label4.Caption;
但在DELPHI中不能直接调用坐标反到要取打印机和屏幕的比例: