DELPHI盒子
!实时搜索: 盒子论坛 | 注册用户 | 修改信息 | 退出
检举帖 | 全文检索 | 关闭广告 | 捐赠
技术论坛
 用户名
 密  码
自动登陆(30天有效)
忘了密码
≡技术区≡
DELPHI技术
lazarus/fpc/Free Pascal
移动应用开发
Web应用开发
数据库专区
报表专区
网络通讯
开源项目
论坛精华贴
≡发布区≡
发布代码
发布控件
文档资料
经典工具
≡事务区≡
网站意见
盒子之家
招聘应聘
信息交换
论坛信息
最新加入: wjy13061029975
今日帖子: 2
在线用户: 0
导航: 论坛 -> DELPHI技术 斑竹:liumazi,sephil  
作者:
女 lgh (素面朝天) ★☆☆☆☆ -
盒子活跃会员
2003/7/3 9:46:31
标题:
我用下面代码设定纸长为 1000 ,在 98 中运行正常 ,在 2000 中不起作用 ,为什么? 浏览:2356
加入我的收藏
楼主: var
  I,J:integer;
  ADevice,ADriver,APort:array[0..255]of char;
  DeviceHandle:THandle;
  DevMode:PDeviceMode;
  CmWidth.Cmheight:double;
begin
  CmWidth:=GetDeviceCaps(Printer.Handle,LOGPIXELSX)/2.54;
  CmHeight:=GetDeviceCaps(Printer.Handle,LOGPIXELSY)/2.54;
  Printer.PrinterIndex:=0;
  Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
  if DeviceHandle=0 then
  begin
    ////Printer.PrinterIndex:=Printer.PrinterIndex;
    Printer.GetPrinter(ADevice,ADriver,APort,DeviceHandle);
  end;
  if DeviceHandle=0 then
    exit;
  else
    DevMode:=GlobalLock(DeviceHandle);
  With DevMode^ do
  begin
    dmFields:=dmFields or DM_PAPERLENGTH;
    DmpaperLength:=1000;
  end;
  if not DeviceHandle=0 then
    GlobalUnlock(DeviceHandle);
  printer.beginDoc;
  // 打印部分
  printer.EndDoc;
end;

要想 98 和 2000 中都能设置纸张 ,应该怎样做?
----------------------------------------------
-
作者:
男 30896186 (缘来一家人) ★☆☆☆☆ -
盒子活跃会员
2003/7/3 16:07:29
1楼: 原因啊,有可能是,2000自带的打印机驱动没有自定义,最好用硬件自带的驱动
----------------------------------------------
-
信息
登陆以后才能回复
Copyright © 2CCC.Com 盒子论坛 v3.0.1 版权所有 页面执行85.9375毫秒 RSS