Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use C# to print a single express order number

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to use C# to print a single express order number". The content in the article is simple and clear, and it is easy to learn and understand. let's study and learn "how to use C# to print a single express order number"!

Preparation in advance

Install a print plug-in (K-Print)

Http://kdniao.com/documents-instrument

1. Determine whether you install the print plug-in and upgrade the plug-in

Reference printed js

Js content:

Var CreatedOKLodop7766 = null Function getLodop (oOBJECT, oEMBED) {/ * * this function determines which page element is used as the Lodop object according to the browser type: the browsers of IE series and IE kernel series use oOBJECT Other browsers (Firefox series, Chrome series, Opera series, Safari series, etc.) use oEMBED. If the page does not have related object elements, create a new one or use the last one to avoid repeated generation. The 64-bit browser points to the 64-bit installer install_lodop64.exe. * * / var strHtmInstall = "

Print control is not installed! Click here to perform the installation. After installation, please refresh the page or re-enter. "; var strHtmUpdate ="

Print controls need to be upgraded! Click here to perform the upgrade, and please re-enter after the upgrade. "; var strHtm64_Install ="

Print control is not installed! Click here to perform the installation. After installation, please refresh the page or re-enter. "; var strHtm64_Update ="

Print controls need to be upgraded! Click here to perform the upgrade, and please re-enter after the upgrade. "; var strHtmFireFox ="

(note: if you have installed the old Lodop attachment npActiveXPLugin, please uninstall it in [tools]-> [add-ons]-> [extensions]) "; var strHtmChrome ="

(if there was a problem due to browser upgrade or reinstallation, you need to re-install it) "; var LODOP; try {/ / = determine the browser type: = var isIE = (navigator.userAgent.indexOf ('MSIE') > = 0) | | (navigator.userAgent.indexOf (' Trident') > = 0); var is64IE = isIE & & (navigator.userAgent.indexOf ('x64') > = 0) / / = if the page has Lodop, use it directly. If not, create a new one: = if (oOBJECT! = undefined | | oEMBED! = undefined) {if (isIE) LODOP = oOBJECT; else LODOP = oEMBED;} else {if (CreatedOKLodop7766 = = null) {LODOP = document.createElement ("object") LODOP.setAttribute ("width", 0); LODOP.setAttribute ("height", 0); LODOP.setAttribute ("style", "position:absolute;left:0px;top:-100px;width:0px;height:0px;"); if (isIE) LODOP.setAttribute ("classid", "clsid:2105C259-1E0C-4534-8141-A753534CB4CA") Else LODOP.setAttribute ("type", "application/x-print-lodop"); document.documentElement.appendChild (LODOP); CreatedOKLodop7766 = LODOP;} else LODOP = CreatedOKLodop7766;} / / = determine whether the Lodop plug-in has been installed. If it is not installed or the version is too low, prompt to download and install: = if ((LODOP = = null) | | (typeof (LODOP.VERSION) = = "undefined") | | (LODOP.VERSION)

< "6.1.8.0")) { if (is64IE) Version(64); else if (isIE) Version(32); else Version(32); return LODOP; }; //=====如下空白位置适合调用统一功能(如注册码、语言选择等):==== LODOP.SET_LICENSES("", "", "", ""); //============================================================ return LODOP; } catch (err) { if (is64IE) document.documentElement[xss_clean] = "Error:" + strHtm64_Install + document.documentElement[xss_clean]; else document.documentElement[xss_clean] = "Error:" + strHtmInstall + document.documentElement[xss_clean]; return LODOP; };} //num可选32或64,update有true升级或false不升级 提示升级内容function Version(num, update) { $('#myModal').modal('show');}; 写一个打印的方法 var LODOP; //声明为全局变量 function myPrintSetupyunda() {//打印维护 LODOP = getLodop(document.getElementById('LODOP_OB'), document.getElementById('LODOP_EM')); var s = Array(); s = document.getElementById("").value.toString().split('~'); LODOP.PRINT_INITA(0, 0, 1500, 1100, "打印"); LODOP.SET_SHOW_MODE("BKIMG_TOP", -25); LODOP.SET_PRINT_PAGESIZE(1, 2300, 1290, "CreateCustomPage"); // LODOP.SET_PRINTER_INDEX(getSelectedPrintIndex()); LODOP.ADD_PRINT_SETUP_BKIMG("

"); LODOP.SET_SHOW_MODE (" BKIMG_IN_PREVIEW ", true); / / LODOP.SET_PRINT_STYLE (" FontName "," Microsoft Yahei "); LODOP.SET_PRINT_STYLE (" FontSize ", 11); / / LODOP.SET_PRINT_STYLE (" Bold ", 1); LODOP.ADD_PRINT_TEXT (50,59,233,23, s [0]) LODOP.ADD_PRINT_TEXT (74,129,75,23, s [10]); LODOP.ADD_PRINT_TEXT (123,114,263,70, s [7]); LODOP.ADD_PRINT_TEXT (182,609,120,21, s [4]); LODOP.ADD_PRINT_TEXT (123,403,276,68, s [3]) LODOP.SET_PRINT_STYLEA (0, "LineSpacing", 10); / LODOP.ADD_PRINT_TEXT (377,462,195,50, s [5]); / / LODOP.SET_PRINT_STYLEA (0, "FontSize", 9); LODOP.ADD_PRINT_TEXT (206,154,113,23, s [9]) LODOP.ADD_PRINT_TEXT (77,657,120,38, s [2]); LODOP.SET_PRINT_STYLEA (0, "LineSpacing", 1); LODOP.ADD_PRINT_TEXT (77,461,110,35, s [1]); LODOP.ADD_PRINT_TEXT (77,276,100,23, s [8]); var mdate = new Date () LODOP.ADD_PRINT_TEXT (362,180,45,23, mdate.getFullYear ()); LODOP.ADD_PRINT_TEXT (362,230,25,23, mdate.getMonth () + 1); LODOP.ADD_PRINT_TEXT (362,260,25,23, mdate.getDate ()); LODOP.ADD_PRINT_TEXT (362,290,25,23, mdate.getHours ()) / / LODOP.PRINT_SETUP (); / / maintenance mode / / LODOP.PRINT_DESIGN (); / / Design mode LODOP.PREVIEW (); / / Preview mode}

If you execute this method, you can call up the express bird printing plug-in to print.

Thank you for your reading. The above is the content of "how to use C# to print a single express order number". After the study of this article, I believe you have a deeper understanding of how to use C# to print a single express order number. the specific use also needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report