paper size选择和打印问题 -- 在线等

coolmoon2004 2008-11-19 11:22:01
我需要打印241*115格式的票据.
在paper size中找不到对应的 size
我通过自定义设置纸张,可以打印出票据,格式也OK.但是打印机打完一张票据后,纸走了A4的长度.

如果我选择一个paper size来打印,打印机走纸是可以的,但是纸张的格式又不符合.

请高手赐教.
急.
...全文
1085 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
JACKDAMAO 2008-11-27
  • 打赏
  • 举报
回复
其實很簡單的,給你一段參考..
Select the DataWindow by deselecting all controls; then set values in the Properties view, Print Specifications tab.
To specify a user-defined paper size, set the Paper.Size property to 255 or 256, then set the Print.CustomPage.Length and Print.Custom.Page.Width properties to the desired size. With Paper.Size set to 255, Length and Width are in the units specified for the DataWindow on the General page in the Properties view. For example:

// DataWindow Units set to 1/1000 inch
dw1.Modify("DataWindow.Print.Paper.Size=255")
//9.875 inches long
dw1.Modify("DataWindow.Print.CustomPage.Length=9875")
//7.375 inches wide
dw1.Modify("DataWindow.Print.CustomPage.Width=7375")

With Paper.Size set to 256, Length and Width are in millimeters:
dw1.Modify("DataWindow.Print.Paper.Size=256")
//25.4 centimeters long
dw1.Modify("DataWindow.Print.CustomPage.Length=254")
//19.5 centimeters wide
dw1.Modify("DataWindow.Print.CustomPage.Width=195")
hxbkkk 2008-11-20
  • 打赏
  • 举报
回复
你打印机设置自定义纸张的时候,没有完全设置好,你看看首标签有几个纸张标准?
coolmoon2004 2008-11-20
  • 打赏
  • 举报
回复
重新做了一张 lebel 可以了
coolmoon2004 2008-11-20
  • 打赏
  • 举报
回复
总共有4个,
我全部设置了label.还是不行,走A4的长度.
可不可以 设置在代码中的办法?
请高手赐教.
超急!!
coolmoon2004 2008-11-19
  • 打赏
  • 举报
回复
我在另外的系统上,用了如下代码,打印机走纸是好的。同样的情况,今天就不行了
郁闷中......

Open(w_cm_print_setup) //打开打印设置窗口
ls_parm = Message.StringParm

If ls_parm = '-1' Then //如果是取消返回
return
else
li_first_pos = Pos(ls_parm,"&",1)
li_second_pos = Pos(ls_parm,"&",li_first_pos + 1)
li_third_pos = Pos(ls_parm,"&",li_second_pos + 1)

//设置打印机
printsetprinter(Mid(ls_parm,li_third_pos + 1))
//设置打印模式
ii_print_mode = Integer(Mid(ls_parm,1,li_first_pos - 1))
//设置打印范围
is_print_range = Mid(ls_parm,li_first_pos + 1,li_second_pos - li_first_pos - 1)
//设置打印拷贝份数
ii_print_copies = Integer(Mid(ls_parm,li_second_pos+1,li_third_pos - li_second_pos -1))
dw_print.object.DataWindow.Print.Copies = ii_print_copies
End If

if ii_print_mode = 1 then
is_print_range = '0'
end if

If ii_print_mode = 2 Then //部分打印,则选择页码
//如果页码范围为空,则打印全部
If is_print_range = "" Or IsNull(is_print_range) Then
ii_print_mode = 1
is_print_range = '0'
End If
dw_print.object.datawindow.print.page.range=is_print_range
End If

if ii_print_mode = 3 then //当前页
long row
string tmp
row = dw_print.getrow()
tmp = dw_print.describe("evaluate('page()',"+string(row)+")")
if len(tmp) > 0 then
dw_print.modify(" datawindow.print.page.range = '"+tmp+"'")
end if
end if

dw_print.settransobject(sqlca)
dw_print.retrieve(str_enter_no)
dw_print.print()
coolmoon2004 2008-11-19
  • 打赏
  • 举报
回复
我只用了以下代码:
dw_print.settransobject(sqlca)
dw_print.retrieve(str_enter_no)
dw_print.print()

但是我现在确实,在走纸张,诶
请高手帮忙,是不是存在什么问题.
liubocy 2008-11-19
  • 打赏
  • 举报
回复

680

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder API 调用
社区管理员
  • API 调用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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