跳至正文
-
Subscribe to our newsletter & never miss our best posts. Subscribe Now!
BG6RSH's 随记.

我们总是在感叹昨天,忽视今天,幻想着明天中渡过,且过且珍惜.....

BG6RSH's 随记.

我们总是在感叹昨天,忽视今天,幻想着明天中渡过,且过且珍惜.....

  • 首页
  • 论坛
  • 随记
  • 编程
  • 软件
  • 留言
  • 首页
  • 论坛
  • 随记
  • 编程
  • 软件
  • 留言
关

搜索

  • https://www.facebook.com/
  • https://twitter.com/
  • https://t.me/
  • https://www.instagram.com/
  • https://youtube.com/
Subscribe
编程

在WIN2000/XP下添加自定义纸张

作者 admin
2009年11月3日 1 分钟阅读
0

在Windows2000/XP/2003等系统中的自定义纸张的编号已经不是WIN98中256了,而是采用了一种新的标注方式,这里提供一个在Windows2000/XP/2003等系统中创建自定义纸张的函数,可以在套打编程中用到.

Delphi/Pascal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//增加规格自定义纸张    
//PaperName: 自定义纸张名称    
//PaperWidth: 纸张的宽度,以0.1mm为单位    
//PaperLength: 纸张的高度,以0.1mm为单位    
procedure TDM.AddCustomPaper(const PaperName: string; PaperWidth, PaperLength:integer);    
var    
  PrintDevice, PrintDriver, PrintPort : array[0..255] of Char;    
  hDMode : THandle;    
  hPrinter : THandle;    
  FormInfo : TFormInfo1;    
begin    
  Printer.GetPrinter(PrintDevice, PrintDriver, PrintPort, hDMode);    
  OpenPrinter(PrintDevice, hPrinter, nil);    
  if hPrinter = 0 then    
    raise Exception.Create('联接打印机失败!');    
 
  with FormInfo do    
  begin    
    Flags := FORM_USER;    
    pName := PChar(PaperName);    
    Size.cx := PaperWidth*100;    
    Size.cy := PaperLength*100;    
    ImageableArea.Left := 0;    
    ImageableArea.Top := 0;    
    ImageableArea.Right := PaperWidth*100;    
    ImageableArea.Bottom := PaperLength*100;    
  end;    
 
//修改纸型,如果没有就新增    
  if not SetForm(hPrinter, PChar(PaperName), 1, @FormInfo) then    
    AddForm(hPrinter, 1, @FormInfo);    
 
  ClosePrinter(hPrinter);    
end;    
 
//删除自定义规格纸张    
//PaperName: 自定义纸张名称    
procedure TDM.DeleteCustomPaper(const PaperName: string);    
var    
  PrintDevice, PrintDriver, PrintPort : array[0..255] of Char;    
  hDMode : THandle;    
  hPrinter : THandle;    
begin    
  Printer.GetPrinter(PrintDevice, PrintDriver, PrintPort, hDMode);    
  OpenPrinter(PrintDevice, hPrinter, nil);    
  if hPrinter = 0 then    
    raise Exception.Create('联接打印机失败!');    
  DeleteForm(hPrinter, PChar(PaperName));    
  ClosePrinter(hPrinter);    
end;

作者

admin

关注我
其他文章
下一个

Delphi2010小写金额转大写金额的源代码

暂无评论!成为第一个。

发表回复 取消回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理。

4条垃圾评论已被Akismet阻挡 (在新标签页中打开)

近期文章

  • www.tansoo.cn网站空间迁移至armbian主机
  • 在QT6中安装qtmqtt、qtopcua控件的方法
  • 你的 Python 环境或安装版没有 spyder‑kernels 模块或没有安装正确的版本 (>=
  • 用PYTHON爬网络小说源代码
  • QT5.15.2搭建ANDROID编译环境

近期评论

  • gg 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • admin 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • /api/positions/里addres 为什么是null啊? 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • gg 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》
  • 9394 发表在《Traccar服务软件高德地图适配版docker镜像安装教程》

归档

  • 2025 年 6 月
  • 2023 年 6 月
  • 2022 年 10 月
  • 2021 年 5 月
  • 2021 年 4 月
  • 2020 年 11 月
  • 2020 年 10 月
  • 2020 年 6 月
  • 2019 年 11 月
  • 2019 年 8 月
  • 2019 年 6 月
  • 2019 年 1 月
  • 2018 年 12 月
  • 2018 年 11 月
  • 2017 年 9 月
  • 2016 年 7 月
  • 2016 年 5 月
  • 2015 年 12 月
  • 2015 年 4 月
  • 2015 年 1 月
  • 2014 年 12 月
  • 2014 年 11 月
  • 2014 年 10 月
  • 2014 年 9 月
  • 2014 年 8 月
  • 2014 年 7 月
  • 2014 年 6 月
  • 2014 年 5 月
  • 2013 年 10 月
  • 2013 年 9 月
  • 2013 年 8 月
  • 2013 年 7 月
  • 2013 年 6 月
  • 2013 年 5 月
  • 2013 年 4 月
  • 2013 年 3 月
  • 2013 年 2 月
  • 2013 年 1 月
  • 2012 年 12 月
  • 2012 年 11 月
  • 2012 年 10 月
  • 2012 年 6 月
  • 2012 年 3 月
  • 2011 年 8 月
  • 2011 年 5 月
  • 2011 年 4 月
  • 2011 年 3 月
  • 2011 年 1 月
  • 2010 年 8 月
  • 2010 年 6 月
  • 2010 年 4 月
  • 2010 年 3 月
  • 2010 年 2 月
  • 2010 年 1 月
  • 2009 年 12 月
  • 2009 年 11 月

分类

  • 编程
  • 软件
  • 随记

其他操作

  • 注册
  • 登录
  • 条目 feed
  • 评论 feed
  • WordPress.org

标签

aliyun Android CRC DBGridEh ddns Delphi EhLib ESP8266 GP328D gp338plus GP3688 Modbus phpbb python QT raspberry S7-SCL sapi speech SpVoice Synology traccar UART Unicode virtualbox vmware WGS84 wordpress ZeroTier 写频 动态IP 图片尺寸 地图 外挂编程 天气预报 导航 打印 扩频 拼音首字母 支票快打 树莓派 爬虫 百度地图 西门子PLC 车联网API

友情链接

  • 私有云论坛
  • 百度开放云
  • 主机管理
  • My Cloud
  • 智能家居技术论坛
  • 精灵云
  • 雅苑私站
Copyright 2026 — BG6RSH's 随记.. All rights reserved. Blogsy WordPress Theme