【例項簡介】
【例項截圖】
【核心**】
using system;
using system.collections.generic;
using system.componentmodel;
using system.data;
using system.drawing;
using system.text;
using system.windows.forms;
using system.runtime.interopservices;
namespace csharp_postek_print
public partial class form1 : form
public form1()
initializecomponent();
private void button1_click(object sender, eventargs e)
printlab.openport("postek g-2108");//開啟印表機埠
printlab.ptk_clearbuffer(); //清空緩衝區
printlab.ptk_setprintspeed(4); //設定列印速度
printlab.ptk_setdarkness(10); //設定列印黑度
printlab.ptk_setlabelheight(600, 16); //設定標籤的高度和定位間隙\黑線\穿孔的高度
printlab.ptk_setlabelwidth(800); //設定標籤的寬度
for (int i = 1; i <= 1; i )
300, 40, 40, "宋體", 1, 400, false, true, true, "1", "12456789");//列印一行 truetype font文字
20, 0, "1", 3, 3, 80, 'n', "12345");//列印乙個條碼
1);//命令印表機執行列印工作
// 畫矩形
printlab.ptk_drawrectangle(58, 15, 3, 558, 312);
// 列印pcx 方式一
printlab.ptk_pcxgraphicsdel("pcx");
printlab.ptk_pcxgraphicsdownload("pcx", "logo.pcx");
printlab.ptk_drawpcxgraphics(80, 20, "pcx");
// 列印pcx 方式二
// ptk_printpcx(80,30,pchar('logo.pcx'));
// 列印乙個條碼;
printlab.ptk_drawbarcode(300, 23, 0, "1", 2, 2, 50, 'b', "123456789");
// 畫**分割線
printlab.ptk_drawlineor(58, 100, 500, 3);
// 列印一行truetypefont文字;
printlab.ptk_drawtexttruetypew(80, 120, 40, 0, "arial", 1, 400, false, false, false, "a1", "truetypefont");
// 列印一行文字文字(內建字型或軟字型);
printlab.ptk_drawtext(80, 168, 0, 3, 1, 1, 'n', "internal soft font");
// 列印pdf417碼
printlab.ptk_drawbar2d_pdf417(80, 210, 400, 300, 0, 0, 3, 7, 10, 2, 0, 0, "123456789");//pdf417碼
// 列印qr碼
printlab.ptk_drawbar2d_qr(420, 120, 180, 180, 0, 3, 2, 0, 0, "postek electronics co., ltd.");
// 列印一行truetypefont文字旋轉;
printlab.ptk_drawtexttruetypew(520, 102, 22, 0, "arial", 2, 400, false, false, false, "a2", "www.postek.com.cn");
printlab.ptk_drawtexttruetypew(80, 260, 19, 0, "arial", 1, 700, false, false, false, "a3", "use different id_name for different truetype font objects");
// 命令印表機執行列印工作
printlab.ptk_printlabel(1, 1);
printlab.closeport();//關閉印表機埠
public class printlab
[dllimport("winpsk.dll")]
public static extern int openport(string printname);
[dllimport("winpsk.dll")]
public static extern int ptk_setprintspeed(uint px);
[dllimport("winpsk.dll")]
public static extern int ptk_setdarkness(uint id);
[dllimport("winpsk.dll")]
public static extern int closeport();
[dllimport("winpsk.dll")]
public static extern int ptk_printlabel(uint number, uint cpnumber);
[dllimport("winpsk.dll")]
public static extern int ptk_drawtexttruetypew
(int x, int y, int fheight,
int fwidth, string ftype,
int fspin, int fweight,
bool fitalic, bool funline,
bool fstrikeout,
string id_name,
string data);
[dllimport("winpsk.dll")]
public static extern int ptk_drawbarcode(uint px,
uint py,
uint pdirec,
string pcode,
uint phorizontal,
uint pvertical,
uint pbright,
char ptext,
string pstr);
[dllimport("winpsk.dll")]
public static extern int ptk_setlabelheight(uint lheight, uint gaph);
[dllimport("winpsk.dll")]
public static extern int ptk_setlabelwidth(uint lwidth);
[dllimport("winpsk.dll")]
public static extern int ptk_clearbuffer();
[dllimport("winpsk.dll")]
public static extern int ptk_drawrectangle(uint px, uint py, uint thickness, uint pex, uint pey);
[dllimport("winpsk.dll")]
public static extern int ptk_drawlineor(uint px, uint py, uint plength, uint ph);
[dllimport("winpsk.dll")]
public static extern int ptk_drawbar2d_qr( uint x,uint y, uint w, uint v,uint o, uint r,uint m, uint g,uint s,string pstr);
[dllimport("winpsk.dll")]
public static extern int ptk_drawbar2d_pdf417(uint x, uint y,uint w, uint v,uint s, uint c,uint px, uint py,uint r, uint l,uint t, uint o,string pstr);
[dllimport("winpsk.dll")]
public static extern int ptk_pcxgraphicsdel(string pid);
[dllimport("winpsk.dll")]
public static extern int ptk_pcxgraphicsdownload(string pcxname, string pcxpath);
[dllimport("winpsk.dll")]
public static extern int ptk_drawpcxgraphics(uint px, uint py, string gname);
[dllimport("winpsk.dll")]
public static extern int ptk_drawtext(uint px,uint py,uint pdirec,uint pfont,uint phorizontal, uint pvertical,char ptext, string pstr);
postek二次開發 博思得RFID標籤印表機解析
it168廠商動態 近年來,物聯網作為我國戰略發展新興行業,物聯網概念持續公升溫,作為推進物聯網發展的關鍵技術之一rfid無線射頻技術,也隨之形成高速發展和廣泛應用的局面。postek博思得作為國內領先條碼 rfid印表機品牌,其公司擁有眾多印表機方面的國家專利技術,近期研發上市的rfid標籤印表機...
mcms二次開發 YzmCMS二次開發手冊
摘要 yzmcms是採用mvc設計模式開發,基於模組和操作的方式進行訪問,採用單一入口模式進行專案部署和訪問,無論訪問任何乙個模組或者功能,只有一.yzmcms是採用mvc設計模式開發,基於模組和操作的方式進行訪問,採用單一入口模式進行專案部署和訪問,無論訪問任何乙個模組或者功能,只有乙個統一的入口...
mcms二次開發 YzmCMS二次開發手冊
yzmcms是採用mvc設計模式開發,基於模組和操作的方式進行訪問,採用單一入口模式進行專案部署和訪問,無論訪問任何乙個模組或者功能,只有乙個統一的入口。一 基本目錄結構.根目錄 cache 快取目錄 必須可寫入 common 全站公共目錄 必須可寫入 uploads 預設上傳目錄 必須可寫入 yz...