CN110633058A - Printing method based on remote electronic surface single template - Google Patents
Printing method based on remote electronic surface single template Download PDFInfo
- Publication number
- CN110633058A CN110633058A CN201810571404.4A CN201810571404A CN110633058A CN 110633058 A CN110633058 A CN 110633058A CN 201810571404 A CN201810571404 A CN 201810571404A CN 110633058 A CN110633058 A CN 110633058A
- Authority
- CN
- China
- Prior art keywords
- printer
- printing
- data
- client
- remote electronic
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1202—Dedicated interfaces to print systems specifically adapted to achieve a particular effect
- G06F3/1203—Improving or facilitating administration, e.g. print management
- G06F3/1204—Improving or facilitating administration, e.g. print management resulting in reduced user or operator actions, e.g. presetting, automatic actions, using hardware token storing data
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1224—Client or server resources management
- G06F3/1228—Printing driverless or using generic drivers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1253—Configuration of print job parameters, e.g. using UI at the client
- G06F3/1257—Configuration of print job parameters, e.g. using UI at the client by using pre-stored settings, e.g. job templates, presets, print styles
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1278—Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
- G06F3/1285—Remote printer device, e.g. being remote from client or server
- G06F3/1286—Remote printer device, e.g. being remote from client or server via local network
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Human Computer Interaction (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
Abstract
The invention relates to the technical field of Web application and development, in particular to a printing method based on a remote electronic bill template. The method comprises the following steps: 1. creating a socket object and connecting a client printer; 2. acquiring a client printer list; 3. acquiring a client printer configuration; 4. setting printing parameters of a printer of a client; 5. and acquiring and printing the remote electronic bill. The invention solves the problems that no plug-in is required to be installed, a standard template is unified and the printing setting is customized in the WEB printing, and can be widely applied to WEB development and application.
Description
Technical Field
The invention relates to the technical field of Web application and development, in particular to a printing method based on a remote electronic bill template.
Background
With the rapid development of electronic commerce platforms and logistics service informatization, a bill number (or called as an invoice number) becomes a hub for a logistics service provider to serially connect various information such as an express bill, an order, a merchant and a commodity. In contrast, the disadvantages of high price, low information input efficiency, potential information safety hazards and the like of the traditional paper bill are more and more prominent. The electronic bill service is a logistics service for outputting a paper logistics bill by printing thermal paper, which is provided by an express company to a seller.
In order to be compatible with various printing plug-ins, the templates are printed uniformly, meanwhile, the printing setting can be defined by users, and the user experience is improved. The invention solves the problems that no plug-in is required to be installed, a standard template is unified and the printing setting is customized in the WEB printing, and can be widely applied to WEB development and application.
Disclosure of Invention
The invention solves the technical problem of providing a printing method based on a remote electronic surface form template; the problems that plug-ins do not need to be installed, standard templates are unified and printing setting is customized in WEB printing are solved.
The technical scheme for solving the technical problems is as follows:
the method comprises the following steps:
step one, creating a socket object and connecting a client printer;
step two, acquiring a printer list of the client;
step three, obtaining the configuration of the printer at the client;
step four, setting printing parameters of a printer at the client;
and step five, acquiring and printing the remote electronic bill.
In the printing method based on the remote electronic form template, in the first step, a socket object is created by a new Websocket () method through a printer address, the socket object is opened by a socket.
In the second step, after the socket object is opened and connected in the step, the printer list of the client is obtained through getPrinters, the printer list data is converted into JSON format data, and the data is sent to the connected socket object.
And in the third step, acquiring the printer configuration of the client through the printconfig, converting the printer configuration data into JSON format data, and sending the printer configuration data to the connected socket object.
And in the fourth step, setting printing parameters of a printer at the client, a default printer in a printing task, a printing task state protocol and a printing document state, and sending the parameter data to a connected socket object.
And step five, acquiring remote electronic surface single-mode board data through the URL, packaging the printing data into a JSON format, sending the data to a connected socket object, calling and executing printing, closing socket monitoring operation through socket.
The invention solves the problems that no plug-in is required to be installed, a standard template is unified and the printing setting is customized in the WEB printing.
Drawings
The invention is further described below with reference to the accompanying drawings:
FIG. 1 is a block flow diagram of the method of the present invention.
Detailed Description
As shown in fig. 1, the present invention specifically comprises the following steps:
step one, creating a socket object and connecting a client printer;
step two, acquiring a printer list of the client;
step three, obtaining the configuration of the printer at the client;
step four, setting printing parameters of a printer at the client;
and step five, acquiring and printing the remote electronic bill.
In the first step, a socket object is created by a new Websocket () method through a printer address, the socket object is opened by a socket. The code is as follows:
function doConnect()
{
var printer_address = $("#printer_address").val();
var socket = new WebSocket('ws://' + printer_address);
// open Socket
socket.onopen = function(event)
{
alert ("Websocket ready, connection to client successful");
};
// listen to messages
socket.onmessage = function(event)
{
console.log('Client received a message',event);
var data = JSON.parse(event.data);
if ("getPrinters" == data.cmd) {
alert ('printer list:' + json. stringiness (data.)));
var defaultPrinter = data.defaultPrinter;
printData.task.printer = defaultPrinter;
alert ('default printer:' + defaultPrinter);
} else {
alert ("return data:" + json. string if (data));
}
};
// listening for Socket shutdown
socket.onclose = function(event)
{
console.log('Client notified socket has closed',event);
};
socket.onerror = function(event) {
alert ('unable to connect to:' + printer _ address);
};
}
in the second step, after the socket object is opened and connected in the step, the printer list of the client is obtained through getPrinters, the printer list data is converted into JSON format data, and the data is sent to the connected socket object. The code is as follows:
function doGetPrinters() {
var request = {
requestID : "12345678901234567890",
version : "1.0",
cmd : "getPrinters"
};
socket.send(JSON.stringify(request));
}
and in the third step, acquiring the printer configuration of the client through the printconfig, converting the printer configuration data into JSON format data, and sending the printer configuration data to the connected socket object. The code is as follows:
function doPrinterConfig() {
var request = {
requestID : '12345678901234567890',
version : '1.0',
cmd : 'printerConfig'
};
socket.send(JSON.stringify(request));
}
and in the fourth step, setting printing parameters of a printer at the client, a default printer in a printing task, a printing task state protocol and a printing document state, and sending the parameter data to a connected socket object. The code is as follows:
function doSetPrinterConfig() {
var request = {
requetid : '12345678901234567890',
version : '1.0',
cmd : 'setPrinterConfig',
printer : {
name : defaultPrinter,
needUpLogo : true,
needDownLogo: false
}
};
socket.send(JSON.stringify(request));
}
// request print job status protocol
function doGetTaskStatus() {
var request= {
requestID : "12345678901234567890",
version : "1.0",
cmd : "getTaskStatus",
taskID : [
''+printTaskId
]
};
socket.send(JSON.stringify(request));
}
// request print job status protocol
function doGetDocumentStatus() {
var waybillNO = $("#waybillNO").val();
var request = {
requestID : "12345678901234567890",
version : "1.0",
cmd : "getDocumentStatus",
documentIDs : [
waybillNO
]
};
socket.send(JSON.stringify(request));
}
And step five, acquiring remote electronic surface single-mode board data through the URL, packaging the printing data into a JSON format, sending the data to a connected socket object, calling and executing printing, closing socket monitoring operation through socket. The code is as follows:
function doPrint()
{
//printTaskId = $("#printTaskId").val();
waybillTemplateURL = $("#waybillTemplateURL").val();
customAreaURL = $("#customAreaURL").val();
waybillNO = $("#waybillNO").val();
printTaskId = parseInt(1000*Math.random());
request = {
cmd : "print",
requestID : "12345678901234567890",
version : "1.0",
task : {
taskID : ''+printTaskId,
preview : false,
printer : defaultPrinter,
documents : [
{
"documentID":waybillNO,
contents : [
electronic surface single part
{
Electronic surface single data
}
]
}
]
}
};
alert(JSON.stringify(request));
socket.send(JSON.stringify(request));
}。
Claims (6)
1. A printing method based on a remote electronic surface single template is characterized in that: the method comprises the following steps:
step one, creating a socket object and connecting a client printer;
step two, acquiring a printer list of the client;
step three, obtaining the configuration of the printer at the client;
step four, setting printing parameters of a printer at the client;
and step five, acquiring and printing the remote electronic bill.
2. The printing method based on the remote electronic surface single template as claimed in claim 1, wherein: in the first step, a socket object is created by a new Websocket () method through a printer address, the socket object is opened by a socket.
3. The printing method based on the remote electronic surface single template as claimed in claim 1, wherein: in the second step, after the socket object is opened and connected in the step, the printer list of the client is obtained through getPrinters, the printer list data is converted into JSON format data, and the data is sent to the connected socket object.
4. The printing method based on the remote electronic surface single template as claimed in claim 1, wherein: and in the third step, acquiring the printer configuration of the client through the printconfig, converting the printer configuration data into JSON format data, and sending the printer configuration data to the connected socket object.
5. The printing method based on the remote electronic surface single template as claimed in claim 1, wherein: and in the fourth step, setting printing parameters of a printer at the client, a default printer in a printing task, a printing task state protocol and a printing document state, and sending the parameter data to a connected socket object.
6. The printing method based on the remote electronic surface single template as claimed in claim 1, wherein: and step five, acquiring remote electronic surface single-mode board data through the URL, packaging the printing data into a JSON format, sending the data to a connected socket object, calling and executing printing, closing socket monitoring operation through socket.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810571404.4A CN110633058A (en) | 2018-06-06 | 2018-06-06 | Printing method based on remote electronic surface single template |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810571404.4A CN110633058A (en) | 2018-06-06 | 2018-06-06 | Printing method based on remote electronic surface single template |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110633058A true CN110633058A (en) | 2019-12-31 |
Family
ID=68966196
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810571404.4A Withdrawn CN110633058A (en) | 2018-06-06 | 2018-06-06 | Printing method based on remote electronic surface single template |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110633058A (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949229A (en) * | 2020-07-29 | 2020-11-17 | 唯品会(珠海)电子商务有限公司 | Method and device for printing bill, computer equipment and storage medium |
CN115168252A (en) * | 2022-07-05 | 2022-10-11 | 珠海趣印科技有限公司 | General debugging method and system for printing terminal |
-
2018
- 2018-06-06 CN CN201810571404.4A patent/CN110633058A/en not_active Withdrawn
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949229A (en) * | 2020-07-29 | 2020-11-17 | 唯品会(珠海)电子商务有限公司 | Method and device for printing bill, computer equipment and storage medium |
CN115168252A (en) * | 2022-07-05 | 2022-10-11 | 珠海趣印科技有限公司 | General debugging method and system for printing terminal |
CN115168252B (en) * | 2022-07-05 | 2024-02-09 | 珠海趣印科技有限公司 | Universal debugging method and system for printing terminal |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102591597B (en) | Information processing apparatus and method for controlling the same | |
US20120293826A1 (en) | Systems and methods for providing multiple images | |
US20080294976A1 (en) | System and method for generating and communicating digital documents | |
CN106658445B (en) | Report display method, apparatus and system | |
US20160196095A1 (en) | Data conversion system, data conversion device, and data conversion method | |
CN110633058A (en) | Printing method based on remote electronic surface single template | |
US8077337B2 (en) | Method and system for processing return fax document deliveries | |
CN104915816A (en) | Method and system for printing express delivery order based on unified coding | |
WO2023071133A1 (en) | Tagged network information service generation and application method and apparatus, device and medium | |
WO2017107698A1 (en) | Printing control system and method | |
JP5363613B2 (en) | Method and system for printing from a web application and corresponding computer program and corresponding computer-readable storage medium | |
CN103944956B (en) | Web service broker method | |
US8804155B2 (en) | Print job information managing device, print job information managing method, and recording medium | |
US8213036B2 (en) | Distribution system for scan image data and validating the scan image data | |
JP2009099070A (en) | Data conversion device and data conversion method | |
CA2422381C (en) | Electronic document presentment services in the event of a disaster | |
CN101266595A (en) | Electronic bid applied system | |
CN107885470A (en) | One kind positioning printer sharing system and its implementation | |
US20040019633A1 (en) | MIME encoding of values for web procedure calls | |
KR20150083211A (en) | Method of securing printing for printers with different types | |
US20130318181A1 (en) | Email processing system and email processing method | |
CN116126258A (en) | Multi-terminal printing method and system based on custom template | |
JP7278018B1 (en) | Information processing device, information processing method, information processing system and information terminal | |
JP5932713B2 (en) | Image forming apparatus and web page language adding method | |
US9917975B2 (en) | Facsimile requirements monitoring |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20191231 |
|
WW01 | Invention patent application withdrawn after publication |