CN111381786A - Text printing method and device, computer equipment and storage medium - Google Patents
Text printing method and device, computer equipment and storage medium Download PDFInfo
- Publication number
- CN111381786A CN111381786A CN202010160580.6A CN202010160580A CN111381786A CN 111381786 A CN111381786 A CN 111381786A CN 202010160580 A CN202010160580 A CN 202010160580A CN 111381786 A CN111381786 A CN 111381786A
- Authority
- CN
- China
- Prior art keywords
- text
- printing
- transfer protocol
- local
- service
- 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.)
- Granted
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/1209—Improving or facilitating administration, e.g. print management resulting in adapted or bridged legacy communication protocols, e.g. emulation, protocol extension
-
- 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/1211—Improving printing performance
-
- 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/1287—Remote printer device, e.g. being remote from client or server via internet
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
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)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Accessory Devices And Overall Control Thereof (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The application relates to a text printing method, a text printing device, a computer device and a storage medium, wherein the method comprises the following steps: creating a local text transfer protocol service; receiving a text printing request according to a text transfer protocol service, wherein the text printing request contains identification information of printing data; acquiring printing data according to the identification information in the text printing request and a local text transfer protocol service; and generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text. The method can break the current text printing limitation to improve the text printing efficiency.
Description
Technical Field
The present application relates to the field of text processing technologies, and in particular, to a text printing method and apparatus, a computer device, and a storage medium.
Background
The network printed text is widely applied to many life scenes, such as a case printing system of a hospital, a drug order printing system and the like. Also, modern logistics systems also employ network print profiles. During the operation of the logistics system, various kinds of veneers are often required to be printed. In order to realize the printing of the receipt, a client program, such as a browser program, needs to be installed locally on the computer, and the receipt needing to be printed is sent to the printing device through the client program.
However, when printing text using a network, a computer device needs to install a specific client program to send the printed text to a printing device, so as to realize printing of the text. For example, when printing a text of a browser, there are two printing methods at present. One is based on the C # component specific version browser (Firefox55) for text printing, and the other is based on the C # browser for Windows service and WebSocket protocol. Therefore, current web text printing has great limitations, which directly affect the printing efficiency of the text.
Disclosure of Invention
In view of the above, there is a need to provide a text printing method, apparatus, computer device and storage medium that can break the current text printing limitation to improve the text printing efficiency.
A method of printing text, the method comprising: creating a local text transfer protocol service; receiving a text printing request according to a text transfer protocol service, wherein the text printing request contains identification information of printing data; acquiring printing data according to the identification information in the text printing request and a local text transfer protocol service; and generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text.
In one embodiment, creating a native text transfer protocol service includes: the native text transfer protocol service is created in the c # programming language.
In one embodiment, receiving a text print request according to a text transfer protocol service includes: receiving a text printing request sent by a local browser according to a text transfer protocol service, wherein the text printing request contains identification information of printing data in the local browser; acquiring printing data according to the identification information in the text printing request and the local text transfer protocol service, comprising: and acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service.
In one embodiment, the identification information in the text printing request includes download address information of the print data in the local browser; acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service, wherein the acquiring comprises the following steps: and reading the printing data from the local browser according to the download address information and the local text transfer protocol service.
In one embodiment, the local text transfer protocol service comprises a first service file, wherein the first service file is used for providing an interface command for calling the interface to the local browser, so that the local browser calls the calling interface according to the interface command to send the text printing request; receiving a text printing request sent by a local browser according to a text transfer protocol service, wherein the text printing request comprises: and determining that a text printing request sent by a local browser is received through a calling interface according to the interface command of the first service file.
In one embodiment, the local text transfer protocol service includes a second service file, and the second service file is used for providing a conversion environment when the print data is generated into a print file; acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service, wherein the acquiring comprises the following steps: acquiring printing data in the local browser according to the identification information in the printing request and the second service file; generating a print text from the print data, comprising: and generating a printing text according to the second service file and the printing data.
In one embodiment, the text printing method further includes: carrying out security setting on the local text transfer protocol service according to a network security protocol; receiving a text print request according to a text transfer protocol service, comprising: and receiving a text printing request according to the text transfer protocol service after the security setting.
A text printing apparatus, the apparatus comprising: the creating module is used for creating a local text transfer protocol service; the receiving module is used for receiving a text printing request according to the text transmission protocol service, wherein the text printing request contains identification information of printing data; the acquisition module is used for acquiring the printing data according to the identification information in the text printing request and the local text transfer protocol service; and the transmission module is used for generating a printing text according to the printing data and transmitting the printing text to the printing equipment so that the printing equipment can print the printing text.
A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method of any of the above embodiments when executing the computer program.
A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method of any of the above embodiments.
According to the text printing method, the text printing device, the computer equipment and the storage medium, the user terminal establishes the local text transmission protocol service and receives the text printing request according to the text transmission protocol service, wherein the text printing request contains the identification information of the printing data. Further, obtaining printing data according to the identification information in the text printing request and the local text transfer protocol service obtaining printing data, generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text. Therefore, the user terminal can directly receive the text printing request and obtain the printing data through the creation text transmission protocol service, and simultaneously generate the printing data into the printing text meeting the requirements of the printing equipment, so that the printing text can be sent to the printing equipment for text printing. When the network is used for printing the text, the user terminal can print the text without installing a specific client program, any client program can send a text printing request to the user terminal, and the user terminal reads the printing data corresponding to any client program through the text printing method and then prints the text, so that the limitation of the current text printing is broken, and the text printing efficiency is improved.
Drawings
FIG. 1 is a diagram illustrating an exemplary embodiment of a method for printing text;
FIG. 2 is a schematic flow chart diagram illustrating a method for printing text in one embodiment;
FIG. 3 is a schematic flow chart diagram illustrating a method of printing text in accordance with another embodiment;
FIG. 4 is a schematic diagram of an implementation flow of a text printing method in an implementation scenario;
FIG. 5 is a diagram that illustrates the internal components of the print integration service in one embodiment;
FIG. 6 is a block diagram showing a configuration of a text printing apparatus according to an embodiment;
FIG. 7 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The text printing method is applied to the application environment shown in fig. 1. As shown in fig. 1, the user terminal 100 executes a text printing method according to the present application. The user terminal 100 creates a local text transfer protocol service, receives a text printing request according to the text transfer protocol service, the text printing request including identification information of printing data, acquires the printing data according to the identification information in the text printing request and the local text transfer protocol service, generates a printing text according to the printing data, and transmits the printing text to the printing apparatus 200, so that the printing apparatus 200 prints the printing text. The user terminal 100 may install a print integration service program, and implement the text printing method through the print integration service program. The text print request may also be a text print request sent by another application (e.g., a browser of various types) on the user terminal 100 to the print integration service. The user terminal 100 may be a notebook computer, a desktop computer, or a mobile handheld device, etc.
In one embodiment, as shown in fig. 2, a text printing method is provided, which is exemplified by the application of the method to the user terminal in fig. 1, and includes the following steps:
s102, creating a local text transfer protocol service.
In the present embodiment, the user terminal installs the print integration service program. A local text transfer protocol service is created in a print integration service program. The native text transfer protocol service is used to provide services for network data interaction. The local Text Transfer Protocol service may be an HTTP Protocol (HyperText Transfer Protocol) service or an HTTPs Protocol (HyperText Transfer Protocol over secure Layer) service. The printing integrated service program in the user terminal can receive a text printing request sent by a network transmission protocol through a local text transmission protocol service, and can read printing data through the local text transmission protocol service.
S104, receiving a text printing request according to the text transmission protocol service, wherein the text printing request contains identification information of printing data.
In this embodiment, the print integration service program receives a text print request sent by an external device or a text print request sent by another application program in the user terminal according to the text transfer protocol service. The text print request contains identification information of the print data, the identification information being used to identify the print data. If the text printing request is a request sent by other application programs in the user terminal, the printing data is data corresponding to other application programs in the user terminal, and the identification information can be link address information or download website information in other application programs in the user terminal. If the text printing request is a request sent by the external device, the identification information may also be link address information or download website information provided by the external device.
And S106, acquiring printing data according to the identification information in the text printing request and the local text transfer protocol service.
In the present embodiment, the print integrated service program acquires print data according to a local text transfer protocol service. That is, the print integration service program acquires print data through a data transmission service provided by the local text transfer protocol service. Meanwhile, in order to acquire print data, the print integration service program further needs to perform data recognition according to the identification information in the text print request to acquire accurate print data. The print data may be data corresponding to another application in the user terminal, or may be data read from an external device. In one implementation, the print data is data corresponding to other applications in the user terminal. At this time, the identification information may be network download address information corresponding to the print data. The printing integrated service program downloads address information through a network and downloads printing data from a corresponding network address according to a local text transfer protocol service.
And S108, generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text.
In the present embodiment, after the print integration service program obtains the print data, a print text is generated from the print data. The printing data can be unrelated scattered data, and the printing integration service program generates printing text with a certain format from the printing data. Or the format of the printing data does not meet the requirement of the printing equipment, and the printing integration service program converts the format of the printing data to generate a printing text meeting the requirement of the printing equipment. The print integration service transmits the print text to the printing device. When the printing device receives the printed text, the printing device executes a printing operation on the printed text. The print text may be a picture text, a word text, or a PDF (Portable Document Format) text. And the printing integrated service program analyzes the printing data and generates a corresponding picture text, a word text or a PDF text according to an analysis result.
According to the text printing method, the user terminal is provided with the printing integration service program, the printing integration service program establishes the local text transfer protocol service, and receives the text printing request according to the text transfer protocol service, wherein the text printing request comprises the identification information of the printing data. Further, obtaining printing data according to the identification information in the text printing request and the local text transfer protocol service obtaining printing data, generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text. Therefore, the user terminal can directly receive the text printing request and obtain the printing data through the creation text transmission protocol service, and simultaneously generate the printing data into the printing text meeting the requirements of the printing equipment, so that the printing text can be sent to the printing equipment for text printing. When the network is used for printing the text, the user terminal can print the text without installing a specific client program, any client program can send a text printing request to the user terminal, and the user terminal reads the printing data corresponding to any client program through the text printing method and then prints the text, so that the limitation of the current text printing is broken, and the text printing efficiency is improved.
In one embodiment, S102 includes: the native text transfer protocol service is created in the c # programming language.
In this embodiment, the local text transfer protocol service in the print integration service program is programmed in the c # programming language, so that the print integration service program can directly call the printer driver module of the operating system of the user terminal to perform the corresponding file printing operation when using the service provided by the local text transfer protocol service.
In one embodiment, as shown in fig. 3, S104 includes the steps of:
s1042, receiving a text printing request sent by the local browser according to the text transfer protocol service, wherein the text printing request includes identification information of printing data in the local browser.
At this time, S106 includes the steps of:
s1062, obtaining the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service.
In this embodiment, the user terminal is installed with a local browser. The local browser may be any type of browser. For example, the local browser may be a Firefox browser, an IE browser, a Google browser, and so on. The local browser sends a text print request to the user terminal via a text transfer protocol, such as the http protocol or the https protocol. Specifically, the local browser requests the local HTTPS service through ajax to push a print file to the print integration service program. The printing integrated service program receives a text printing request sent by a local browser according to a text transfer protocol service. At this time, the print integration service may receive the text print request using a service corresponding to the same type of text transfer protocol as the local browser. Meanwhile, the text printing request can also encapsulate the identification information of the printing data in the local browser, and the printing integration service program can read the printing data in the local browser according to the identification information and the local text transfer protocol service. For example, when the identification information is download website information corresponding to the print data, the print integration service program may download the print data from the network according to the download website information and the local text transfer protocol service. Therefore, the print integration service can be made to obtain print data quickly and accurately.
In one embodiment, the identification information in the text print request includes download address information of the print data in the local browser. S1062 includes: and reading the printing data from the local browser according to the download address information and the local text transfer protocol service.
In this embodiment, the local browser transfers the download address information of the print data on the network to the print integration service program, instead of directly transferring the print data to the print integration service program. The print integration service program downloads print data from the network by downloading address information and according to a local text transfer protocol service. The print data may be print data corresponding to a picture text or a PDF text. Therefore, the printing integrated service program can directly read the printing data to be printed according to the downloading address information without directly transmitting the printing data by the local browser, so that the current text printing limitation is broken, and the text printing efficiency is improved.
In one embodiment, the local text transfer protocol service includes a first service file, where the first service file is used to provide an interface command for invoking the interface to the local browser, so that the local browser invokes the invoking interface to send the text printing request according to the interface command. At this time, S1042 includes: and determining that a text printing request sent by a local browser is received through a calling interface according to the interface command of the first service file.
In this embodiment, the native text transfer protocol service of the print integration service includes a first service file, and the first service file is used to provide an interface command for calling an interface to the native browser. The calling interface is an interface for the external data interaction of the printing integration service program. The local browser can call the calling interface of the printing integration service program through the interface command of the calling interface so as to perform data interaction with the printing integration service program. Specifically, the first service file may be provided with interface commands of a plurality of interfaces provided by the print integration service program, where the interface commands include an interface command for calling an interface used by the local browser. The local browser may call an interface provided by the print integration service by using an interface command to call the interface. The first service file may be a JavaScript file. The JavaScript file comprises a standard program for calling the printing integration service program by the local browser, and provides some standard interfaces for the program which needs to call the printing of the webpage. The development webpage does not need to know how the printing integration service program establishes a channel, and only needs to call some interfaces provided by the JavaScript file to complete printing. Finally, the printing integrated service program can also determine that a text printing request sent by the local browser is received by calling the interface according to the interface command of the first service file. Therefore, local printing can be realized by any type of local browser, the limitation of current text printing is broken, and the text printing efficiency is improved.
In one embodiment, the local text transfer protocol service includes a second service file, and the second service file is used for providing a conversion environment when the print data is generated into the print file. Acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service, wherein the acquiring comprises the following steps: and acquiring the printing data in the local browser according to the identification information in the printing request and the second service file. At this time, a print text is generated from the print data, including: and generating a printing text according to the second service file and the printing data.
In this embodiment, the local text transfer protocol service of the print integration service program includes a second service file, where the second service file is used to provide a conversion environment when generating the print data into the print file, and the print integration service program may generate the print data into the print file by using the conversion environment provided by the second service file. The second service file may be a Windows service file written in the c # programming language. Wherein the second service file is associated with the first service file. And the printing integrated service program acquires the printing data in the local browser through a calling interface provided in the first service file according to the second service file. In the acquiring of the print data, the print data is identified and acquired by the identification information in the print request. And after receiving the printing data, the printing integrated service program generates a printing text from the printing data according to the conversion environment provided by the second service file when the printing data is generated into the printing file. The print text is a text that the printing apparatus can print. Finally, the printing integration service program sends the printing text to the printing device according to the printing service provided by the second service file, so as to print the text by the printing device. Therefore, when the network text printing is carried out, the network text printing can be realized without the limitation of the browser type, the current text printing limitation is broken, and the text printing efficiency is improved.
In an embodiment, after S102, the method further includes: and carrying out security setting on the local text transfer protocol service according to the network security protocol. At this time, S1042 includes: and receiving a text printing request according to the text transfer protocol service after the security setting.
In this embodiment, the user terminal performs security setting on the local text transfer protocol service in the print integration service program. In particular, various types of network security protocols can be used for security setup. For example, when the text transfer protocol service is an HTTPS protocol service, the user terminal configures an SSL (Secure Sockets Layer) certificate of a local HTTPS protocol, thereby solving an access security problem between HTTPS protocols. Specifically, the printing integration service program is written by using a c # programming language, a local HTTPS protocol service can be established, and a secure communication channel can be established only after an SSL certificate of HTTPS is put in the local HTTPS protocol service, so that the secure operation of the program is ensured.
A specific implementation scenario is provided below to illustrate the text printing method according to the above embodiment:
referring to fig. 4, in performing text printing of a network, a user terminal performs based on the print integration service overall framework of the present system. Under the general framework of the printing integration service, a browser (which can be a local browser installed in a user terminal) performs data interaction with the printing integration service program, and further, the printing integration service program is utilized to send a printing text to a printing device. The text printing method mainly adopts the printing integration service program to realize the text printing. Specifically, as shown in fig. 4, the printing integration service program acquires data transmitted by a browser, analyzes the acquired data, generates a picture text or a PDF text, and sends the generated file to the printing device for printing. Wherein the internal components of the print integration service can be referred to as shown in fig. 5. The printing integrated service program comprises two contents: JavaScript file and c # based Windows service.
The JavaScript file mainly functions as a medium for data transmission by interacting with a browser and a c # based Windows service. The c # based Windows service mainly functions to receive print data, then parse the print data into a print file that the printing device can print, and transmit the print file to the printing device. Therefore, the webpage end of the cross-browser can directly control all expandable devices of the local computer equipment to print jobs, the limitation of text printing at present is broken, and the text printing efficiency is improved.
When the text printing method is adopted to realize network text printing, a user only needs to install a printing integrated service program on user computer equipment, the printing integrated service program can establish local HTTPS service, receive a local browser request, and execute local file printing after receiving a printed file. After the user installs the printing integration service program, the browser calls a command in a JavaScript file provided by the printing integration service program to call the local printing integration service and execute a printing action. Therefore, by using the technology, the webpage-side cross-browser printing function can be conveniently realized.
It should be understood that, although the steps in the flowchart are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in the figures may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.
The present application also provides a text printing apparatus, as shown in fig. 6, which includes a creating module 10, a receiving module 20, an obtaining module 30, and a transmitting module 40. A creating module 10 for creating a local text transfer protocol service; a receiving module 20, configured to receive a text printing request according to a text transfer protocol service, where the text printing request includes identification information of print data; an obtaining module 30, configured to obtain print data according to the identification information in the text print request and a local text transfer protocol service; and a transmission module 40, configured to generate a print text according to the print data, and transmit the print text to the printing device, so that the printing device prints the print text.
In one embodiment, the creation module 10 is specifically configured to create native text transfer protocol services using the c # programming language.
In one embodiment, the receiving module 20 is specifically configured to receive a text printing request sent by a local browser according to a text transfer protocol service, where the text printing request includes identification information of print data in the local browser; the obtaining module 30 is specifically configured to obtain the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service.
In one embodiment, the identification information in the text printing request includes download address information of the print data in the local browser; the obtaining module 30 is specifically configured to read the print data from the local browser according to the download address information and the local text transfer protocol service.
In one embodiment, the local text transfer protocol service includes a first service file, where the first service file is used to provide an interface command for invoking an interface to the local browser, so that the local browser invokes the invocation interface to send a text printing request according to the interface command; the receiving module 20 is specifically configured to determine, according to the interface command of the first service file, that a text printing request sent by the local browser is received through the call interface.
In one embodiment, the local text transfer protocol service includes a second service file, and the second service file is used for providing a conversion environment when the print data is generated into a print file; the obtaining module 30 is specifically configured to obtain print data in the local browser according to the identification information in the print request and the second service file; the transmission module 40 is specifically configured to generate a print text according to the second service file and the print data.
In one embodiment, the text printing apparatus further comprises a security setting module (not shown in FIG. 6). The security setting module is used for carrying out security setting on the local text transfer protocol service according to the network security protocol; the receiving module 20 is specifically configured to receive a text printing request according to the text transfer protocol service after the security setting.
For the specific definition of the text printing apparatus, reference may be made to the above definition of the text printing method, which is not described herein again. The respective modules in the above-described text printing apparatus may be implemented in whole or in part by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 7. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of printing text. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program: creating a local text transfer protocol service; receiving a text printing request according to a text transfer protocol service, wherein the text printing request contains identification information of printing data; acquiring printing data according to the identification information in the text printing request and a local text transfer protocol service; and generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text.
In one embodiment, when the processor executes the computer program to implement the above step of creating the local text transfer protocol service, the following steps are specifically implemented: the native text transfer protocol service is created in the c # programming language.
In one embodiment, when the processor executes the computer program to implement the step of receiving a text print request according to the text transfer protocol service, the following steps are specifically implemented: receiving a text printing request sent by a local browser according to a text transfer protocol service, wherein the text printing request contains identification information of printing data in the local browser; when the processor executes the computer program to realize the step of acquiring the printing data according to the identification information in the text printing request and the local text transfer protocol service, the following steps are specifically realized: and acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service.
In one embodiment, the identification information in the text printing request includes download address information of the print data in the local browser; when the processor executes the computer program to realize the step of acquiring the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service, the following steps are specifically realized: and reading the printing data from the local browser according to the download address information and the local text transfer protocol service.
In one embodiment, the local text transfer protocol service includes a first service file, where the first service file is used to provide an interface command for invoking an interface to the local browser, so that the local browser invokes the invocation interface to send a text printing request according to the interface command; when the processor executes the computer program to realize the step of receiving the text printing request sent by the local browser according to the text transfer protocol service, the following steps are specifically realized: and determining that a text printing request sent by a local browser is received through a calling interface according to the interface command of the first service file.
In one embodiment, the local text transfer protocol service includes a second service file, and the second service file is used for providing a conversion environment when the print data is generated into a print file; when the processor executes the computer program to realize the step of acquiring the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service, the following steps are specifically realized: acquiring printing data in the local browser according to the identification information in the printing request and the second service file; when the processor executes the computer program to realize the step of generating the printing text according to the printing data, the following steps are specifically realized: and generating a printing text according to the second service file and the printing data.
In one embodiment, the processor, when executing the computer program, further performs the steps of: carrying out security setting on the local text transfer protocol service according to a network security protocol; when the processor executes the computer program to realize the step of receiving the text printing request according to the text transfer protocol service, the following steps are specifically realized: and receiving a text printing request according to the text transfer protocol service after the security setting.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of: creating a local text transfer protocol service; receiving a text printing request according to a text transfer protocol service, wherein the text printing request contains identification information of printing data; acquiring printing data according to the identification information in the text printing request and a local text transfer protocol service; and generating a printing text according to the printing data, and transmitting the printing text to the printing device so that the printing device prints the printing text.
In one embodiment, when the computer program is executed by the processor to implement the above step of creating the local text transfer protocol service, the following steps are specifically implemented: the native text transfer protocol service is created in the c # programming language.
In one embodiment, when the computer program is executed by the processor to implement the above-mentioned step of receiving a text print request according to a text transfer protocol service, the following steps are specifically implemented: receiving a text printing request sent by a local browser according to a text transfer protocol service, wherein the text printing request contains identification information of printing data in the local browser; when the computer program is executed by the processor to realize the step of acquiring the print data according to the identification information in the text print request and the local text transfer protocol service, the following steps are specifically realized: and acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service.
In one embodiment, the identification information in the text printing request includes download address information of the print data in the local browser; when the computer program is executed by the processor to implement the above-mentioned step of obtaining the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service, the following steps are specifically implemented: and reading the printing data from the local browser according to the download address information and the local text transfer protocol service.
In one embodiment, the local text transfer protocol service includes a first service file, where the first service file is used to provide an interface command for invoking an interface to the local browser, so that the local browser invokes the invocation interface to send a text printing request according to the interface command; when the computer program is executed by the processor to realize the step of receiving the text printing request sent by the local browser according to the text transfer protocol service, the following steps are specifically realized: and determining that a text printing request sent by a local browser is received through a calling interface according to the interface command of the first service file.
In one embodiment, the local text transfer protocol service includes a second service file, and the second service file is used for providing a conversion environment when the print data is generated into a print file; when the computer program is executed by the processor to implement the above-mentioned step of obtaining the print data in the local browser according to the identification information in the text print request and the local text transfer protocol service, the following steps are specifically implemented: acquiring printing data in the local browser according to the identification information in the printing request and the second service file; when the computer program is executed by the processor to realize the step of generating the printing text according to the printing data, the following steps are specifically realized: and generating a printing text according to the second service file and the printing data.
In one embodiment, the computer program when executed by the processor further performs the steps of: carrying out security setting on the local text transfer protocol service according to a network security protocol; when the computer program is executed by the processor to implement the above-mentioned step of receiving a text print request according to the text transfer protocol service, the following steps are specifically implemented: and receiving a text printing request according to the text transfer protocol service after the security setting.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.
Claims (10)
1. A method of printing text, the method comprising:
creating a local text transfer protocol service;
receiving a text printing request according to the text transfer protocol service, wherein the text printing request contains identification information of printing data;
acquiring the printing data according to the identification information in the text printing request and the local text transfer protocol service;
generating a printing text according to the printing data, and transmitting the printing text to a printing device so that the printing device prints the printing text.
2. The method of claim 1, wherein creating the native text transfer protocol service comprises: the native text transfer protocol service is created in the c # programming language.
3. The method of claim 1, wherein receiving a text print request according to the text transfer protocol service comprises: receiving a text printing request sent by a local browser according to the text transfer protocol service, wherein the text printing request contains identification information of printing data in the local browser;
the acquiring the print data according to the identification information in the text print request and the local text transfer protocol service includes:
and acquiring the printing data in the local browser according to the identification information in the text printing request and the local text transfer protocol service.
4. The method according to claim 3, wherein the identification information in the text print request includes download address information of print data in the local browser;
the acquiring the print data in the local browser according to the identification information in the text printing request and the local text transfer protocol service includes: and reading the printing data from the local browser according to the download address information and the local text transfer protocol service.
5. The method of claim 3, wherein the native text transfer protocol service comprises a first service file, the first service file being used to provide an interface command for invoking an interface to the native browser, so that the native browser invokes the invoking interface to send the text printing request according to the interface command;
the receiving a text printing request sent by a local browser according to the text transfer protocol service comprises the following steps: and determining that a text printing request sent by the local browser is received through the calling interface according to the interface command of the first service file.
6. The method according to claim 5, wherein the local text transfer protocol service includes a second service file for providing a conversion environment for generating the print data into the print file;
the acquiring the print data in the local browser according to the identification information in the text printing request and the local text transfer protocol service includes: acquiring the printing data in the local browser according to the identification information in the printing request and the second service file;
the generating of the print text according to the print data includes: and generating the printing text according to the second service file and the printing data.
7. The method of claim 1, further comprising: carrying out security setting on the local text transfer protocol service according to a network security protocol;
the receiving a text print request according to the text transfer protocol service includes:
and receiving a text printing request according to the text transfer protocol service after the security setting.
8. A text printing apparatus, characterized in that the apparatus comprises:
the creating module is used for creating a local text transfer protocol service;
a receiving module, configured to receive a text printing request according to the text transfer protocol service, where the text printing request includes identification information of print data;
the acquisition module is used for acquiring the printing data according to the identification information in the text printing request and the local text transfer protocol service;
and the transmission module is used for generating a printing text according to the printing data and transmitting the printing text to printing equipment so that the printing equipment can print the printing text.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented when the computer program is executed by the processor.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010160580.6A CN111381786B (en) | 2020-03-10 | 2020-03-10 | Text printing method and device, computer equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010160580.6A CN111381786B (en) | 2020-03-10 | 2020-03-10 | Text printing method and device, computer equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111381786A true CN111381786A (en) | 2020-07-07 |
CN111381786B CN111381786B (en) | 2022-08-19 |
Family
ID=71219933
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010160580.6A Active CN111381786B (en) | 2020-03-10 | 2020-03-10 | Text printing method and device, computer equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111381786B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116719487A (en) * | 2022-10-10 | 2023-09-08 | 荣耀终端有限公司 | Method and device for sending print job |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107665102A (en) * | 2017-09-08 | 2018-02-06 | 金蝶软件(中国)有限公司 | Method, apparatus, storage medium and the system of mobile print data |
CN109542366A (en) * | 2018-10-26 | 2019-03-29 | 金蝶软件(中国)有限公司 | Method of printing, device, equipment and storage medium based on browser |
-
2020
- 2020-03-10 CN CN202010160580.6A patent/CN111381786B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107665102A (en) * | 2017-09-08 | 2018-02-06 | 金蝶软件(中国)有限公司 | Method, apparatus, storage medium and the system of mobile print data |
CN109542366A (en) * | 2018-10-26 | 2019-03-29 | 金蝶软件(中国)有限公司 | Method of printing, device, equipment and storage medium based on browser |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN116719487A (en) * | 2022-10-10 | 2023-09-08 | 荣耀终端有限公司 | Method and device for sending print job |
Also Published As
Publication number | Publication date |
---|---|
CN111381786B (en) | 2022-08-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109814854B (en) | Project framework generation method, device, computer equipment and storage medium | |
CN111159614B (en) | Webpage resource acquisition method and device | |
WO2020151333A1 (en) | Page loading method, apparatus, computer device and storage medium | |
CN105718313A (en) | Application operation method and device | |
CN109542366B (en) | Printing method, device, equipment and storage medium based on browser | |
CN108418797B (en) | Webpage access method and device, computer equipment and storage medium | |
CN112114913B (en) | Application program interface updating method and device, computer equipment and storage medium | |
CN106815055B (en) | Method and system for dynamic layout of mobile application | |
CN109787974B (en) | Message data stream generation method and device, computer equipment and storage medium | |
CA3153431C (en) | Http redirect status code capture method and apparatus, and computer device | |
CN111190609B (en) | Service processing method, device, equipment and storage medium | |
CN106850563B (en) | Method and device for accessing payment terminal | |
US9571557B2 (en) | Script caching method and information processing device utilizing the same | |
CN111381786B (en) | Text printing method and device, computer equipment and storage medium | |
CN109976683B (en) | Data printing method, device, equipment and storage medium | |
CN111431767A (en) | Multi-browser resource synchronization method and device, computer equipment and storage medium | |
US10365873B2 (en) | Information processing system, image forming apparatus, and information processing method | |
CN112818270B (en) | Data cross-domain transfer method and device and computer equipment | |
CN112672187B (en) | Page generation method and device, computer equipment and readable storage medium | |
CN111901383A (en) | Data request processing method and device, computer equipment and storage medium | |
CN115563424A (en) | Method, device, system and medium for generating dynamic PDF document | |
CN114915565B (en) | Network debugging method and system | |
CN108595274B (en) | Program synchronization control method, device, system, computer device and storage medium | |
CN110865943A (en) | Interface testing method and device, computer equipment and storage medium | |
CN109657178B (en) | Page form processing method and device, computer equipment and storage medium |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |