当前位置: 代码迷 >> PB >> 怎么获取打印机的纸型
  详细解决方案

怎么获取打印机的纸型

热度:151   发布时间:2016-04-29 09:14:24.0
如何获取打印机的纸型
我在设置打印机的时候多次碰到打印纸型设置的问题,例如打印送货单,一般用的是A5大小(21*14.8)。但PB自带的A5纸型是横向的(14.8*21)。

多次摸索后我在考虑有没有办法直接获取打印机(不管是本机还是网络打印机)定义的纸型。在【打印机】的【服务器属性】这里可以任意定义新格式。如果可以获取这里的格式定义那就可以支持任意格式。

我搜索过资料,看到有些类似的想法,不过大部分没有阐述清楚。不知各位大侠能否给予一点建议和帮助?

------解决方案--------------------
搜索下PrintCtrl.DLL,这个可以
------解决方案--------------------
pb10以上的版本支持自定义纸张

dw_1.modify("datawindow.print.size = 256")
dw_1.modify("datawindow.print.custompage.length = 290")
dw_1.modify("datawindow.print.custompage.width = 210")

CustomPage.Length A double indicating the desired length of a custom paper size for printing. Use this property in conjunction with Print.CustomPage.Width and with Paper.Size set to 256.
CustomPage.Width A double indicating the desired width of a custom paper size for printing. Use this property in conjunction with Print.CustomPage.Length and with Paper.Size set to 256.
------解决方案--------------------
PB9.0.3也支持自定义纸张,只不过要看打印机驱动是否支持
  相关解决方案