久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <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="qwawimqqmiuu" 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="qwawimqqmiuu" 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ī)的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在嘗試設(shè)置 CLI PHP 應(yīng)用程序以將一組網(wǎng)頁打印到默認(rèn)或指定的打印機(jī).我在 Windows 7 機(jī)器上,PHP 5.2.11 在 CLI 中運(yùn)行.為了測試打印功能,我加載了 PHP_printer.dll 并打印到 Onenote,這是一個打印到文件選項,使用 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);
                  

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

                  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?

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

                  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.

                  推薦答案

                  我對printer.dll 搞了很長時間并且厭煩了.

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

                  不確定它是否有多大用處,但我購買了此應(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 文件,這對我來說效果很好,但它確實有一個彈出屏幕,只有在您購買服務(wù)器版本時才能擺脫(如果您需要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# 編寫了這個小應(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ī)的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(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 可滾動游標(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 獲取一個值;等于變量的值)
                  MSSQL PDO could not find driver(MSSQL PDO 找不到驅(qū)動程序)
                  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="qwawimqqmiuu" 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>

                            主站蜘蛛池模板: 国产精品一区久久久久 | 国产一区二区欧美 | 九九色综合| 亚洲精品视频在线看 | 草久网| 日日夜夜狠狠操 | 亚洲视频在线观看免费 | 欧美高清一区 | www.中文字幕.com | 国产乱精品一区二区三区 | 日韩精品国产精品 | 国产精品久久久久久久久污网站 | 精品www | 成人影院av| 极品电影院 | 亚洲一区二区三区四区五区中文 | 精品一区二区三区在线观看 | 有码一区 | 精品无码久久久久国产 | 亚洲一一在线 | 中文字幕免费在线 | 久久久久久精 | 亚洲免费视频一区 | 欧美中文字幕在线观看 | 国产精品一级 | 伊人网综合在线观看 | 亚洲一区日韩 | 久久久免费 | 欧美一区二区三区在线看 | 中文字幕av在线 | 欧美男人天堂 | 97国产精品 | 亚洲高清在线 | 狠狠干美女 | 精品综合网 | 亚洲成人一区二区 | 午夜视频免费在线观看 | 99爱在线观看 | 国产精品久久久久无码av | 成人一区在线观看 | 欧美狠狠操 |