jjzjj

windows - 默认打印机设置被忽略

使用WindowsPrintSpoolerAPI,我们可以打印出XPS文件。问题是打印后台处理程序忽略默认打印机设置。(我们已放弃尝试applyprintersettings。默认打印机设置就足够了。)例如...无论控制面板中的设置如何,打印输出始终是彩色的并且每页一张纸:黑白/彩色、双面/非双面、每张多页/每张单页。MSWord和Adob​​e等其他应用程序遵循默认打印机设置。我们使用的是DelphiXE2和Windows764位。此测试代码是自包含的,因此您可以将其粘贴进去进行测试...使用打印机名称填充组合框:usesPrintersComboBox1.Items.Assign(

c++ - windows C++ opening printer with documentproperties get C6836 "Write Overrun"代码分析警告

在下面的代码中://IfGetPrinterdidn'tfillintheDEVMODE,trytogetitbycalling//DocumentProperties...if(pi2->pDevMode==NULL){dwNeeded=DocumentProperties(NULL,hPrinter,printerName,NULL,NULL,0);if(dwNeededpDevMode=pDevMode;}在线lFlag=DocumentProperties(NULL,hPrinter,printerName,pDevMode,NULL,DM_OUT_BUFFER);当我运行Vi

PHP 直接打印到打印机(本地/网络)(卡在后台打印程序中)

好的,我使用的是PHP5.4,我想直接从Web服务器打印到打印机。我正在使用PHP模块php_printer.dll。功能很好。我在打印机队列中看到,数据在,但卡在“已发送到打印机”状态这是代码$printerList=printer_list(PRINTER_ENUM_LOCAL);var_dump($printerList);$printerName=$printerList[0]['NAME'];echo$printerName;$printer=$printerName;if($ph=printer_open($printer)){$content="hello";//Setp

windows - 通过 Get-WmiObject : Exception calling SetDefaultPrinter : Not Supported 设置默认打印机时出错

概览我正在尝试使用PowerShell在Windows2012R2中设置默认打印机。每当我在本地执行此操作时,它都可以正常工作,但是无论我如何尝试远程运行它(我需要这样做),它总是会失败并出现以下错误。我已经尝试使用域管理员帐户以及我需要为其更改默认打印机的用户凭据,但它仍然失败。错误Exceptioncalling"SetDefaultPrinter":"Notsupported"Atline:1char:1+(Get-WmiObject-ClassWin32_Printer-Filter"(Name='MicrosoftXPSDocumentWrite...+~~~~~~~~~~~

c# - 我如何使用 C# 检查打印机是否已安装并准备就绪?

如何使用.NET3.5和VisualStudio2008在C#中以编程方式检查打印机是否已安装(如果有,我如何检查它是否已打开并准备好使用?)提前致谢 最佳答案 此代码段将检索有关已安装打印机的信息:usingSystem.Drawing.Printing;//...foreach(stringprinterNameinPrinterSettings.InstalledPrinters){//Displaytheprintername.Console.WriteLine("Printer:{0}",printerName);//Re

php - 使用 printer_write() 函数直接从 PHP 打印

我发现了一个直接从PHP打印的代码:$printer="cups-pdf";$ph=printer_open($printer);if($ph){$content="HelloWorld...";printer_set_option($ph,PRINTER_MODE,"RAW");printer_write($ph,$content);printer_close($ph);}else{echo"Couldn'tconnect...";}我正在尝试在Ubuntu14.04LTS上使用XAMPP对其进行测试。但它给了我一个错误:Fatalerror:Calltoundefinedfunct

php - tpcl(TEC Printer Command Language) [ESC]PC 左对齐

我想使用php和LPR将标签发送到我的tec打印机。一切正常,除了某些部分的对齐。我的代码/标签是:{D0478,0600,0400,0640|}{C|}{PC01;0040,0135,05,05,J,00,B=Itemnumber:xxxxxx|}{PC02;0040,0170,05,05,I,00,B=BrandModelExtraInfo|}{PC03;0040,0205,05,05,I,00,B=OptionalSecondLine|}{PC04;0465,0270,05,05,J,00,B=Eurosign??Price|}{PC04;0380,0315,05,05,I,00

php - 在 php 中打印到 Zebra 打印机

正在寻找使用RAW端口9100从php网页打印到zebraIP打印机的正确代码。有人知道这是否可能吗?我需要将ZPL格式输出的字符串直接发送到ZM400标签打印机。我到处搜索,我找到的最接近的是:Printdirectlytonetworkprinterusingphp它似乎非常接近我的需要,但是当我的php页面遇到该代码时,它什么也没做。这是我使用的代码: 最佳答案 我意识到这个问题有点老了,但我最近不得不执行这个确切的任务,这就是我是如何做到的。主服务器是不在本地网络上的基于云的PHP服务器。在本地网络上,我们有另一台机器只是运

php - 使用 php_printer.dll 打印 pdf 文件

我想使用php将pdf文件打印到默认打印机,但它不打印文件并给出空白页作为输出。$handle=printer_open("\\\\192.168.1.30\BrotherMFC-J430WPrinter");printer_start_doc($handle,"PETPASS");printer_start_page($handle);$filename="test.txt";$fhandle=fopen($filename,'r');$contents=fread($fhandle,filesize($filename));fclose($fhandle);printer_set_

php LPR 打印机类

如何使用LPRPrinter类通过USB打印机EPSONLQ-1150打印txt文件?set-host("192.168.1.152");//PutyourprinterIPhere$lpr->setData("C:\\wampp2\\htdocs\\print\\test.txt");//Pathtofile,ORstringtoprint.$lpr->printJob("someQueue");//Ifyourprinterhasabuilt-inprintserver,itmightjustacceptanythingasaqueuename.?>在设置主机中我们要使用共享打印机