程式設定印表機配置
using system;
using system.***ponentmodel;
using system.runtime.interopservices;
using system.drawing.printing ;
namespace frontinte***ce.printing
*/public enum pageorientation
public enum *****size
public enum pageduplex
public enum *****source
public enum dmfields
#region "資料結構定義"
public struct printerdata
[structlayout(layoutkind.sequential)]
public struct printer_defaults
/*[structlayout(layoutkind.sequential, charset=charset.auto)]
public struct printer_defaults
*/[structlayout(layoutkind.sequential)]
struct printer_info_2
[structlayout(layoutkind.sequential)]
public struct devmode
#endregion
public class printersettings
else
else
marshal.structuretoptr( dm,ydevmodedata,true);
pinfo.pdevmode = ydevmodedata;
pinfo.psecuritydescriptor = intptr.zero;
/*update driver dependent part of the devmode
1 = documentproperties(intptr.zero, hprinter, sprintername, ydevmodedata
, ref pinfo.pdevmode, (dm_in_buffer | dm_out_buffer));*/
marshal.structuretoptr(pinfo,ptrprinterinfo,true);
lasterror = marshal.getlastwin32error();
nret = convert.toint16(setprinter(hprinter, 2, ptrprinterinfo, 0));
if (nret == 0)
if (hprinter != intptr.zero)
closeprinter(hprinter);
return convert.toboolean(nret);}}
private devmode getprintersettings(string printername)
getprinter(hprinter, 2, intptr.zero, 0, out nbytesneeded);
if (nbytesneeded <= 0)
else
;ptrprinterinfo = marshal.allochglobal(nbytesneeded);
// the second getprinter fills in all the current settings, so all you // need to do is modify what you're interested in...
nret = convert.toint32(getprinter(hprinter, 2, ptrprinterinfo, nbytesneeded, out njunk));
if (nret == 0)
pinfo = (printer_info_2)marshal.ptrtostructure(ptrprinterinfo, typeof(printer_info_2));
intptr temp = new intptr();
if (pinfo.pdevmode == intptr.zero)
pinfo.pdevmode = ptrdm;
}interror = documentproperties(intptr.zero, hprinter, printername, intptr.zero , ref temp , 0);
//intptr ydevmodedata = marshal.alloccotaskmem(i1);
ydevmodedata= marshal.allochglobal(interror);
interror = documentproperties(intptr.zero, hprinter, printername, ydevmodedata , ref temp , 2);
dm = (devmode)marshal.ptrtostructure(ydevmodedata, typeof(devmode));
//nret = documentproperties(intptr.zero, hprinter, sprintername, ydevmodedata
// , ref ydevmodedata, (dm_in_buffer | dm_out_buffer));
if ((nret == 0) || (hprinter == intptr.zero))
return dm;
}#endregion}}
} }
php程式 印表機,php程式如何呼叫印表機
php程式如何呼叫印表機 閱讀 80 php程式怎麼呼叫印表機 php控制印表機可以使用php printer擴充套件實現。一 配置 php執行環境正確安裝 apache nginx php 擴充套件檔案新增到ext目錄 編輯php.ini 新增extension php printer.dll 二...
Linux配置印表機
列印流程的理解 如果印表機已經支援了ipp協議,這個協議就是基於http的。也就是說終端 pc 只要能發起http請求應該就可以列印文件。cups相當終端裝置與印表機之間的一個橋樑,終端給cups提交文件,cpus通過ipp或者其他協議去列印這個文件。ppd檔案就是描述印表機的配置,比如印表機生產商...
HOW TO 設定預設印表機
author 水如煙 需要引用system.management空間再imports system.management 使用 private subbutton2 click byval sender assystem.object,byval e as system.eventargs hand...
UBuntu 印表機設定
非常簡單,如果印表機已經連線在計算機上,然後再裝ubuntu8.04,安裝過程中會自動安裝驅動程式,你要做的就是在列印設定裡面,將印表機列為預設印表機。關鍵是samba的設定,看著 etc samba smb.conf 的註釋進行,其中有對cups印表機的共享支援,對相關語句取消註釋就可以。prin...
UBuntu 印表機設定
非常簡單,如果印表機已經連線在計算機上,然後再裝ubuntu8.04,安裝過程中會自動安裝驅動程式,你要做的就是在列印設定裡面,將印表機列為預設印表機。關鍵是samba的設定,看著 etc samba smb.conf 的註釋進行,其中有對cups印表機的共享支援,對相關語句取消註釋就可以。prin...