php 打印功能扩展
2015-11-21 13:39
501 查看
1,首先要下载对应php版本的php_printer.dll
下载地址:http://yunpan.cn/cLG5aeMVDIm6x 密码:0f94
2,php.ini文件中 添加 extension=php_printer.dll
3,使用方法:
$handle = printer_open("ZDesigner 105SL 203DPI");
$handle = printer_open();
printer_set_option($handle, PRINTER_MODE,"TEXT");
printer_write($handle , $this->convertStr($resultStr));
printer_close($handle);
注意:打印中文需要转码,\n为换行符
//转换编码
public function convertStr($str){
return iconv("UTF-8" , "GB2312//IGNORE" , $str);
}
printer函数说明文档:http://php.chinaunix.net/manual/zh/ref.printer.php
下载地址:http://yunpan.cn/cLG5aeMVDIm6x 密码:0f94
2,php.ini文件中 添加 extension=php_printer.dll
3,使用方法:
$handle = printer_open("ZDesigner 105SL 203DPI");
$handle = printer_open();
printer_set_option($handle, PRINTER_MODE,"TEXT");
printer_write($handle , $this->convertStr($resultStr));
printer_close($handle);
注意:打印中文需要转码,\n为换行符
//转换编码
public function convertStr($str){
return iconv("UTF-8" , "GB2312//IGNORE" , $str);
}
printer函数说明文档:http://php.chinaunix.net/manual/zh/ref.printer.php
相关文章推荐
- php无限极分类组装成分类树的巧妙代码
- 使用ThinkPHP框架快速搭建网站
- ld: i386 architecture of input file `eatsyscall.o' is incompatible with i386:x86-64 output
- 配置phpmyadmin连接远程 MySQL数据库
- PHP中的类,函数,静态属性,静态函数,变量赋值
- [转]phpcms 判断用户登录代码
- php中curl的详细解说
- php中curl的详细解说
- thinkphp自动跳到首页 --开启域名部署/子域名部署/泛域名部署/IP访问部署
- wamp打开phpmyadmin空白
- php发邮件
- php eval使用
- PHP中的逻辑判断函数empty() isset() is_null() ==NULL ===NULL
- thinkphp3.2 home为默认模块,怎么隐藏掉home,在url里面。
- php导出execl
- php中的递归
- Ubuntu 14.04 FTP服务器--vsftpd的安装和配置
- Thinkphp中去除URL里的index.php
- ContentProvider 基础
- php后台“爬虫”模拟登录第三方系统(三)---模拟登录学校正方系统