C 印表機相關配置

2021-10-11 14:41:07 字數 1781 閱讀 8148

在c#中設定印表機紙張大小,如此簡單

using

system.drawing.printing.printdocument

using

system.drawing.printing.printersettings.*****sizecollection

using

system.drawing.printing.*****size

using system.drawing.printing.pagesettings

/需要以上引用

printdocument pd =

newprintdocument()

;*****size p=

null

;foreach

(*****size ps in pd.printersettings.*****sizes)

pd.defaultpagesettings.*****size = p;

pd.print()

;

列印區域設定:

///寫在列印printpage 事件裡

printdocument pd =

newprintdocument()

; pd.printpage +

=(sender, args)

=>

; pd.

print()

;

橫打,豎打

printdocument.defaultpagesettings.landscape =

true

;//橫打

printdocument.defaultpagesettings.landscape =

false

;//縱打

列印控制類

class

printdirectclass

}private

void

doctoprint_beginprint

(object sender,

system.drawing.printing.printeventargs e)

private

void

doctoprint_endprint

(object sender,

system.drawing.printing.printeventargs e)

private

void

doctoprint_printpage

(object sender,

system.drawing.printing.printpageeventargs e)

else

//drawimage引數根據印表機和大小自行調整

system.drawing.rectangle destrect =

newsystem.drawing.rectangle

(x/2

, y/

2, width-x/

2, height-y/2)

; destrect = new system.drawing.rectangle(0, 0, width, height);

if(image.height <

310)

else

if(printnum < filelist.count -1)

e.hasmorepages =

false;}

}

Linux配置印表機

列印流程的理解 如果印表機已經支援了ipp協議,這個協議就是基於http的。也就是說終端 pc 只要能發起http請求應該就可以列印文件。cups相當終端裝置與印表機之間的乙個橋梁,終端給cups提交文件,cpus通過ipp或者其他協議去列印這個文件。ppd檔案就是描述印表機的配置,比如印表機生產商...

c 餐飲系統印表機 C 呼叫小票印表機

using system using system.collections.generic using system.componentmodel using system.data using system.drawing using system.text using system.drawin...

程式設定印表機配置

程式設定印表機配置 using system using system.ponentmodel using system.runtime.interopservices using system.drawing.printing namespace frontinte ce.printing pub...