pbootcms网站模板|日韩1区2区|织梦模板||网站源码|日韩1区2区|jquery建站特效-html5模板网

  • <i id='hkTh9'><tr id='hkTh9'><dt id='hkTh9'><q id='hkTh9'><span id='hkTh9'><b id='hkTh9'><form id='hkTh9'><ins id='hkTh9'></ins><ul id='hkTh9'></ul><sub id='hkTh9'></sub></form><legend id='hkTh9'></legend><bdo id='hkTh9'><pre id='hkTh9'><center id='hkTh9'></center></pre></bdo></b><th id='hkTh9'></th></span></q></dt></tr></i><div class="emgsyoa" id='hkTh9'><tfoot id='hkTh9'></tfoot><dl id='hkTh9'><fieldset id='hkTh9'></fieldset></dl></div>
  • <small id='hkTh9'></small><noframes id='hkTh9'>

        • <bdo id='hkTh9'></bdo><ul id='hkTh9'></ul>

        <tfoot id='hkTh9'></tfoot><legend id='hkTh9'><style id='hkTh9'><dir id='hkTh9'><q id='hkTh9'></q></dir></style></legend>

        用 PHP 打印到打印機(jī)

        Printing to printers in PHP(用 PHP 打印到打印機(jī))

      1. <tfoot id='bwi8L'></tfoot>
            <i id='bwi8L'><tr id='bwi8L'><dt id='bwi8L'><q id='bwi8L'><span id='bwi8L'><b id='bwi8L'><form id='bwi8L'><ins id='bwi8L'></ins><ul id='bwi8L'></ul><sub id='bwi8L'></sub></form><legend id='bwi8L'></legend><bdo id='bwi8L'><pre id='bwi8L'><center id='bwi8L'></center></pre></bdo></b><th id='bwi8L'></th></span></q></dt></tr></i><div class="6seocmm" id='bwi8L'><tfoot id='bwi8L'></tfoot><dl id='bwi8L'><fieldset id='bwi8L'></fieldset></dl></div>
                <bdo id='bwi8L'></bdo><ul id='bwi8L'></ul>

                  <tbody id='bwi8L'></tbody>
              • <small id='bwi8L'></small><noframes id='bwi8L'>

                1. <legend id='bwi8L'><style id='bwi8L'><dir id='bwi8L'><q id='bwi8L'></q></dir></style></legend>
                  本文介紹了用 PHP 打印到打印機(jī)的處理方法,對(duì)大家解決問(wèn)題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)吧!

                  問(wèn)題描述

                  我正在嘗試設(shè)置 CLI PHP 應(yīng)用程序以將一組網(wǎng)頁(yè)打印到默認(rèn)或指定的打印機(jī).我在 Windows 7 機(jī)器上,PHP 5.2.11 在 CLI 中運(yùn)行.為了測(cè)試打印功能,我加載了 PHP_printer.dll 并打印到 Onenote,這是一個(gè)打印到文件選項(xiàng),使用 PRINTER_ENUM_LOCAL 中給出的確切打印機(jī)名稱.
                  更新:這是最新的代碼:

                  I'm trying to set up a CLI PHP application to print a set of web pages to a default or specified printer. I'm on a Windows 7 machine with PHP 5.2.11 running in a CLI. To test the print functionality I've loaded PHP_printer.dll and I'm printing to Onenote, a print to file option, using the exact printer name given in PRINTER_ENUM_LOCAL.
                  Update: Here's the latest code:

                  $handle = printer_open("Send To OneNote 2010");
                  printer_start_doc($handle, "My Document");
                  printer_start_page($handle);
                  
                  $filename='index.html';
                  $fhandle=fopen($filename, 'r');
                  $contents = fread($fhandle, filesize($filename));
                  fclose($fhandle);
                  
                  printer_set_option($handle, PRINTER_MODE, "RAW");
                  printer_write($handle,$contents);
                  
                  printer_end_page($handle);
                  printer_end_doc($handle);
                  printer_close($handle);
                  

                  我已獲得此代碼以將空白頁(yè)打印到正確的打印機(jī),但我無(wú)法打印傳遞給printer_write 的字符串.我確認(rèn) $contents 正確填充了我的測(cè)試 html 文件的內(nèi)容.無(wú)論我提供什么作為第二個(gè) arg(要打印的字符串),我都會(huì)得到一個(gè)空白頁(yè).有什么我遺漏的東西至少可以讓我在頁(yè)面上打印一些文本嗎?

                  I've gotten this code to print a blank page to the correct printer, but I'm unable to print the strings I pass to printer_write. I confirmed that $contents is properly filled with the contents of my test html file. No matter what I provide as the second arg (string to be printed) I get a blank page. Is there something I'm missing to at least allow me to print some text onto a page?

                  或者有沒(méi)有更好的方法來(lái)做到這一點(diǎn)(使用 PHP/javascript 文件)?我想要做的是通過(guò) CLI 應(yīng)用程序打印出現(xiàn)的網(wǎng)頁(yè)(包括 CSS),該網(wǎng)站是用 PHP 編寫的,我試圖將復(fù)雜性降至最低.如果有更好的方法來(lái)打印這些(顯然轉(zhuǎn)換為 PDF 和打印是一個(gè)選項(xiàng))我是開(kāi)放的,但聽(tīng)起來(lái)這是 PHP 中最簡(jiǎn)單/事實(shí)上的方法.

                  Alternately is there a better way to do this (using PHP/javascript files)? What I am trying to do is print web pages as they appear (CSS included) via a CLI app, the web siteis written in PHP and I'm trying to minimize complexity. If there is a better way to print these (converting to PDF and printing is an option apparently) I'm open but it sounded like this was the simplest/de facto method in PHP.

                  推薦答案

                  我對(duì)printer.dll 搞了很長(zhǎng)時(shí)間并且厭煩了.

                  i messed around with printer.dll for ages and got sick of it.

                  不確定它是否有多大用處,但我購(gòu)買了此應(yīng)用程序http://www.coolutils.com/TotalPDFPrinter

                  not sure if its much use, but i purchased this application http://www.coolutils.com/TotalPDFPrinter

                  它讓我從 php 的 cmd 行打印 pdf 文件,這對(duì)我來(lái)說(shuō)效果很好,但它確實(shí)有一個(gè)彈出屏幕,只有在您購(gòu)買服務(wù)器版本時(shí)才能擺脫(如果您需要apache 作為服務(wù)運(yùn)行).顯然非彈出版本要貴得多.

                  and it lets me print pdf files from the cmd line from php, which worked well for me, but it does have a popup screen which you can only get rid of if you purchase the server version (which you will need if your apache is running as a service). obviously the non-popup version is way more expensive.

                  我掙扎的一件事是獲取可用的打印機(jī)列表,所以我用 C# 編寫了這個(gè)小應(yīng)用程序,它以純文本形式輸出打印機(jī)列表,然后使用 php 調(diào)用它并將它們放入下拉列表在我的網(wǎng)絡(luò)表單上.

                  one thing i struggled with, was getting a list of printers available, so i wrote this little app in C# that spits out a list of printers as plain text, and then use php to call that and put them into a drop list on my web forms.

                  using System;
                  using System.Collections.Generic;
                  using System.Text;
                  using System.Drawing.Printing;
                  
                  namespace printerlist
                  {
                      class Program
                      {
                          static void Main(string[] args)
                          {
                              foreach (String printer in PrinterSettings.InstalledPrinters)
                              {
                                  Console.WriteLine(printer.ToString());
                              }
                          }
                      }
                  }
                  

                  這篇關(guān)于用 PHP 打印到打印機(jī)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來(lái)源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問(wèn)題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                  PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動(dòng)游標(biāo)不起作用)
                  PHP PDO ODBC connection(PHP PDO ODBC 連接)
                  Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術(shù)方法)
                  php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個(gè)值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動(dòng)程序)
                  1. <small id='1JiZ0'></small><noframes id='1JiZ0'>

                    • <tfoot id='1JiZ0'></tfoot>
                        <tbody id='1JiZ0'></tbody>
                      <i id='1JiZ0'><tr id='1JiZ0'><dt id='1JiZ0'><q id='1JiZ0'><span id='1JiZ0'><b id='1JiZ0'><form id='1JiZ0'><ins id='1JiZ0'></ins><ul id='1JiZ0'></ul><sub id='1JiZ0'></sub></form><legend id='1JiZ0'></legend><bdo id='1JiZ0'><pre id='1JiZ0'><center id='1JiZ0'></center></pre></bdo></b><th id='1JiZ0'></th></span></q></dt></tr></i><div class="4iyeo8i" id='1JiZ0'><tfoot id='1JiZ0'></tfoot><dl id='1JiZ0'><fieldset id='1JiZ0'></fieldset></dl></div>
                      <legend id='1JiZ0'><style id='1JiZ0'><dir id='1JiZ0'><q id='1JiZ0'></q></dir></style></legend>
                        <bdo id='1JiZ0'></bdo><ul id='1JiZ0'></ul>

                            主站蜘蛛池模板: AGV叉车|无人叉车|AGV智能叉车|AGV搬运车-江西丹巴赫机器人股份有限公司 | 集菌仪厂家_全封闭_封闭式_智能智能集菌仪厂家-上海郓曹 | 电力测功机,电涡流测功机,磁粉制动器,南通远辰曳引机测试台 | 昆明挖掘机修理厂_挖掘机翻新再制造-昆明聚力工程机械维修有限公司 | 永嘉县奥阳陶瓷阀门有限公司 | uv固化机-丝印uv机-工业烤箱-五金蚀刻机-分拣输送机 - 保定市丰辉机械设备制造有限公司 | 储气罐,真空罐,缓冲罐,隔膜气压罐厂家批发价格,空压机储气罐规格型号-上海申容压力容器集团有限公司 | 滚筒烘干机_转筒烘干机_滚筒干燥机_转筒干燥机_回转烘干机_回转干燥机-设备生产厂家 | 采暖炉_取暖炉_生物质颗粒锅炉_颗粒壁炉_厂家加盟批发_烟台蓝澳采暖设备有限公司 | 水性绝缘漆_凡立水_绝缘漆树脂_环保绝缘漆-深圳维特利环保材料有限公司 | 东莞工厂厂房装修_无尘车间施工_钢结构工程安装-广东集景建筑装饰设计工程有限公司 | 3D全息投影_地面互动投影_360度立体投影_水幕灯光秀 | 广东银虎 蜂窝块状沸石分子筛-吸附脱硫分子筛-萍乡市捷龙环保科技有限公司 | 液晶拼接屏厂家_拼接屏品牌_拼接屏价格_监控大屏—北京维康 | 塑胶地板-商用PVC地板-pvc地板革-安耐宝pvc塑胶地板厂家 | 合肥钣金加工-安徽激光切割加工-机箱机柜加工厂家-合肥通快 | 联系我们老街华纳娱乐公司官网19989979996(客服) | 考勤系统_人事考勤管理系统_本地部署BS考勤系统_考勤软件_天时考勤管理专家 | 精密钢管,冷拔精密无缝钢管,精密钢管厂,精密钢管制造厂家,精密钢管生产厂家,山东精密钢管厂家 | 智成电子深圳tdk一级代理-提供TDK电容电感贴片蜂鸣器磁芯lambda电源代理经销,TDK代理商有哪些TDK一级代理商排名查询。-深圳tdk一级代理 | 升降机-高空作业车租赁-蜘蛛车-曲臂式伸缩臂剪叉式液压升降平台-脚手架-【普雷斯特公司厂家】 | 齿轮减速机_齿轮减速电机-VEMT蜗轮蜗杆减速机马达生产厂家瓦玛特传动瑞环机电 | 国际高中-国际学校-一站式择校服务-远播国际教育 | 北京模型公司-工业模型-地产模型-施工模型-北京渝峰时代沙盘模型制作公司 | 半自动预灌装机,卡式瓶灌装机,注射器灌装机,给药器灌装机,大输液灌装机,西林瓶灌装机-长沙一星制药机械有限公司 | 北京办公室装修,办公室设计,写字楼装修-北京金视觉装饰工程公司 北京成考网-北京成人高考网 | 讲师宝经纪-专业培训机构师资供应商_培训机构找讲师、培训师、讲师经纪就上讲师宝经纪 | 物和码官网,物和码,免费一物一码数字化营销SaaS平台 | 新疆系统集成_新疆系统集成公司_系统集成项目-新疆利成科技 | 篮球架_乒乓球台_足球门_校园_竞技体育器材_厂家_价格-沧州浩然体育器材有限公司 | 大米加工设备|大米加工机械|碾米成套设备|大米加工成套设备-河南成立粮油机械有限公司 | 苏州西装定制-西服定制厂家-职业装定制厂家-尺品服饰西装定做公司 | 手持式浮游菌采样器-全排二级生物安全柜-浙江孚夏医疗科技有限公司 | 智能电表|预付费ic卡水电表|nb智能无线远传载波电表-福建百悦信息科技有限公司 | 高铝轻质保温砖_刚玉莫来石砖厂家_轻质耐火砖价格 | 爆破器材运输车|烟花爆竹运输车|1-9类危险品厢式运输车|湖北江南专用特种汽车有限公司 | 网架支座@球铰支座@钢结构支座@成品支座厂家@万向滑动支座_桥兴工程橡胶有限公司 | 吸污车_吸粪车_抽粪车_电动三轮吸粪车_真空吸污车_高压清洗吸污车-远大汽车制造有限公司 | 锻造液压机,粉末冶金,拉伸,坩埚成型液压机定制生产厂家-山东威力重工官方网站 | 石家庄网站建设|石家庄网站制作|石家庄小程序开发|石家庄微信开发|网站建设公司|网站制作公司|微信小程序开发|手机APP开发|软件开发 | 电液推杆生产厂家|电动推杆|液压推杆-扬州唯升机械有限公司 | 彩超机-黑白B超机-便携兽用B超机-多普勒彩超机价格「大为彩超」厂家 |