CN107423004B - Method for printing bill by POS terminal and POS terminal - Google Patents

Method for printing bill by POS terminal and POS terminal Download PDF

Info

Publication number
CN107423004B
CN107423004B CN201710576143.0A CN201710576143A CN107423004B CN 107423004 B CN107423004 B CN 107423004B CN 201710576143 A CN201710576143 A CN 201710576143A CN 107423004 B CN107423004 B CN 107423004B
Authority
CN
China
Prior art keywords
bill
pos terminal
printing
markup language
dot matrix
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.)
Active
Application number
CN201710576143.0A
Other languages
Chinese (zh)
Other versions
CN107423004A (en
Inventor
金海青
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wizarpos Information Technology Co ltd
Original Assignee
Shanghai Wizarpos Information Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shanghai Wizarpos Information Technology Co ltd filed Critical Shanghai Wizarpos Information Technology Co ltd
Publication of CN107423004A publication Critical patent/CN107423004A/en
Application granted granted Critical
Publication of CN107423004B publication Critical patent/CN107423004B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1206Improving or facilitating administration, e.g. print management resulting in increased flexibility in input data format or job format or job type
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1237Print job management
    • G06F3/1253Configuration of print job parameters, e.g. using UI at the client
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input 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/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1278Dedicated interfaces to print systems specifically adapted to adopt a particular infrastructure
    • G06F3/128Direct printing, e.g. sending document file, using memory stick, printing from a camera
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G1/00Cash registers
    • G07G1/12Cash registers electronically operated

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Cash Registers Or Receiving Machines (AREA)

Abstract

The invention provides a method for printing a bill by a POS terminal and the POS terminal. The method for printing the bill by the POS terminal comprises the following steps: providing at least one template, wherein the template is written by adopting a markup language; embedding the generated bill data into the template by adopting a preset rule to generate a markup language file; analyzing the markup language file and outputting a bill dot matrix webpage; and intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing. The invention provides the template written by the markup language, and realizes the printing of the bill with various languages, various fonts and pictures and texts by the POS terminal by utilizing the characteristic that the markup language supports the mixed arrangement of various languages, various fonts and pictures and texts.

Description

Method for printing bill by POS terminal and POS terminal
Technical Field
The invention relates to the technical field of communication, in particular to a method for printing a bill by a POS terminal and the POS terminal.
Background
With the continuous development of scientific technology and the continuous improvement of living standard of people, various consuming places such as shopping malls, supermarkets, catering storefronts and the like begin to use the cash register system to settle accounts of commodities purchased by consumers, and the automatic commercial management is realized. The cash register system can improve the cash register and settlement efficiency, avoid calculation errors, simplify human hands, save human resources, retain settlement evidences and realize well-documented check, so the cash register system is more and more commonly used in daily life of people. Generally, a cash register system includes a cash register and a printer. Furthermore, with the increasing popularity of bank card usage, customers often use a card-swiping consumption method when paying out accounts in the cashier system. For this reason, the way in which the POS system integrated by the cashier system and the POS terminal is used is also becoming more and more popular.
In order to simplify the overall structure of the POS system, generally, a physical printer is not separately provided in the POS system, but a thermal printing module supporting a standard ESC (Escape character) instruction set is integrated inside the POS terminal, and the POS terminal performs the printing of the ticket. The ESC instruction set was originally a standardized instruction set of stylus printers by EPSON corporation, and has now become an industry standard in embedded printer control language, and is now used for most POS terminal ticket printing. The remarkable characteristics are as follows: a large portion of which is a string of code that begins with an ESC control.
The general processing process of the ESC instruction set in the printing module in the POS terminal to the character printing is as follows: firstly, mixed data of binary coded character strings and ESC instructions are obtained, wherein character codes generally adopt ASCII codes in English, and GBK codes in Chinese and the like; secondly, analyzing each character, and obtaining a bitmap (bitmap) dot matrix of the character from an internal word stock of the printing module; then, typesetting the output image according to the ESC typesetting instruction between the characters and the bitmap dot matrix; and finally, calling a printer interface to output the image.
This approach has two disadvantages in embedded POS systems: on one hand, the capacity of a printing module in the POS terminal is limited, so that only a few coded word libraries can be stored, and only a few centralized font formats are provided; on the other hand, the typesetting elements are not rich enough, and only simple typesetting operations such as table arrangement, magnification and reduction can be performed. While these designs are temporarily adequate for the use scenarios of traditional POS systems, for emerging intelligent POS, both application designers and end-users require more complex print effects such as simultaneous support of more languages, support of various fonts, mixed composition of text, etc., when used in complex scenarios associated with internet applications.
Therefore, how to enrich the printing effect of the POS terminal and improve the user experience is a technical problem to be urgently solved at present.
Disclosure of Invention
The invention provides a method for printing a bill by a POS terminal and the POS terminal, which are used for solving the problems of single printing effect and poor user experience of the conventional POS terminal.
In order to solve the above problems, the present invention provides a method for printing a bill by a POS terminal, comprising the steps of: providing at least one template, wherein the template is written by adopting a markup language; generating bill data; embedding the bill data into the template by adopting a preset rule to generate a markup language file; analyzing the markup language file and outputting a bill dot matrix webpage; and intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing.
Preferably, the markup language is extensible markup language, hypertext markup language, standard general markup language or extensible hypertext markup language.
Preferably, the specific step of intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing includes: acquiring the printing width of the POS terminal; adjusting the size of the bill dot matrix webpage according to the printing width; and intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image for printing.
Preferably, the at least one template comprises a plurality of templates; the specific steps of embedding the bill data into the template by adopting a preset rule comprise: receiving a target template selected by a user; and embedding the bill data into the target template by adopting a preset rule.
Preferably, the ticket data is embedded into the template by using a preset rule, and the specific step of generating the markup language file includes: the template comprises a plurality of variables, and the variables correspond to a plurality of pieces of information in the bill data one by one; and replacing the plurality of information in the bill data and the plurality of variables in the template one by adopting a mapping dictionary to generate a markup language file.
The invention also provides a POS terminal, comprising: the storage module is used for storing at least one template, and the template is compiled by adopting a markup language; the generating module is used for generating bill data; the processing module is connected with the generating module and used for embedding the bill data into the template by adopting a preset rule to generate a markup language file; the analysis module is connected with the processing module and used for analyzing the markup language file and outputting a bill dot matrix image; and the intercepting module is connected with the analyzing module and is used for intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing.
Preferably, the markup language is extensible markup language, hypertext markup language, standard general markup language or extensible hypertext markup language.
Preferably, the intercepting module comprises an acquiring unit, an adjusting unit and a printing unit; the acquiring unit is used for acquiring the printing width of the POS terminal; the adjusting unit is connected with the acquiring unit and used for adjusting the size of the bill dot matrix webpage according to the printing width; and the intercepting unit is connected with the adjusting unit and is used for intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image for printing.
Preferably, the at least one template comprises a plurality of templates; the processing module comprises a selection unit and an embedding unit; the selection unit is connected with the storage module and is used for selecting a target template from the plurality of templates by a user; and the embedding unit is connected with the selecting unit and is used for embedding the bill data into the target template by adopting a preset rule.
Preferably, the template includes a plurality of variables, and the variables correspond to a plurality of pieces of information in the bill data one to one; and the processing module adopts a mapping dictionary to replace a plurality of information in the bill data and a plurality of variables in the template one by one so as to generate a markup language file.
According to the method for printing the bill by the POS terminal and the POS terminal, provided by the invention, the template written by the markup language is provided, the characteristic that the markup language supports mixed arrangement of various languages, various fonts and image characters is utilized, the bill data generated by the POS terminal is embedded into the template, the printing of the bill with mixed arrangement of various languages, various fonts and pictures and texts by the POS terminal is realized through the rendering function of the markup language, and the problems of single printing effect and poor user experience of the conventional POS terminal are solved.
Drawings
FIG. 1 is a flow chart of a method for a POS terminal to print tickets in accordance with an embodiment of the present invention;
FIG. 2 is a schematic diagram of a POS terminal according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a print module in a POS terminal according to an embodiment of the present invention;
FIG. 4 is a block diagram of a processing module in a POS terminal according to an embodiment of the present invention;
FIG. 5A is a markup language document diagram according to embodiment 1 of the present invention;
FIG. 5B is a schematic diagram of a ticket printed by the POS terminal according to embodiment 1 of the present invention;
FIG. 6A is a markup language document diagram according to embodiment 2 of the present invention;
fig. 6B is a schematic diagram of a ticket printed by the POS terminal according to embodiment 2 of the present invention.
Detailed Description
The detailed description of the method for printing the ticket by the POS terminal and the specific implementation of the POS terminal provided by the present invention are provided below with reference to the accompanying drawings.
The present embodiment provides a method for printing a bill by a POS terminal, and fig. 1 is a flowchart of a method for printing a bill by a POS terminal according to the present embodiment. As shown in fig. 1, the method for printing a ticket by a POS terminal according to the present embodiment includes the following steps:
step S11, providing at least one template, wherein the template is written in a markup language. The conventional POS terminals are generally intelligent POS terminals, and the intelligent POS terminal is configured to be equipped with an operating system to extend functions of the POS terminal, where the operating system may be, but is not limited to, an Android operating system. The operating system itself has markup language container rendering functionality, such as a web parsing container in the Android operating system. Moreover, the markup language supports mixed arrangement of various languages, various fonts and pictures, so that the specific implementation mode realizes typesetting of various types of bills by constructing a template written by adopting the markup language and utilizing the container rendering function of the operating system of the POS terminal. The Markup Language is Extensible Markup Language (XML), HyperText Markup Language (HTML), Standard Generalized Markup Language (SGML), or Extensible HyperText Markup Language (XHTML).
In step S12, ticket data is generated. The bill data may be plain text data, plain image data, or text-text mixed data. The receipt data is generated by an application program carried by the POS terminal, and may be a receipt generated by a payment application installed on the POS terminal, a cash register generated by a cash register application developed on the POS terminal, a coupon generated by a card application installed on the POS terminal, or a ticket generated by a purchase-sale-stock application installed on the POS terminal. Those skilled in the art can set the data according to actual needs, and the specific embodiment does not limit the specific manner of the ticket data generated by the POS terminal, as long as the data is generated by the POS terminal itself.
And step S13, embedding the bill data into the template by adopting a preset rule to generate a markup language file. In order to improve the efficiency of bill printing, preferably, the bill data is embedded into the template by using a preset rule, and the specific step of generating the markup language file includes: the template comprises a plurality of variables, and the variables correspond to a plurality of pieces of information in the bill data one by one; and replacing the plurality of information in the bill data and the plurality of variables in the template one by adopting a mapping dictionary to generate a markup language file. The plurality of information in the bill data includes a plurality of types of the bill name, the bill type, the transaction details, the transaction commodity unit price, the transaction commodity quantity, the transaction total amount, the bar code, the two-dimensional code, the coupon preferential content, the purchase, sale and inventory details and the like. The mapping dictionary may be a one-to-one correspondence relationship between variables in the template and a plurality of pieces of information in the ticket data, which is established by a manufacturer of the POS terminal in advance according to the template. And according to the mapping dictionary, replacing variables in the template by the information in the bill data, and dynamically generating a markup language file.
And step S14, analyzing the markup language file and outputting a bill dot matrix webpage. For example, when the operating system loaded on the POS terminal is an Android operating system, the WebView control of the Android operating system transfers the markup language file to a web parsing container, and the web parsing container parses the markup language file and outputs a bill dot matrix web page.
And step S15, intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing. When the bill dot matrix webpage output in the step S14 is displayed on the display screen of the POS terminal, obtaining a bill dot matrix image through a real screen capture operation; when the bill dot matrix web page output in step S14 is not displayed on the display screen of the POS terminal, a virtual screen capture operation is performed in the parsing container to obtain a bill dot matrix image for printing.
In order to enhance the function of the POS terminal and expand the application field of the POS terminal, preferably, after obtaining a ticket dot matrix image for printing, the method further includes the following steps: and printing the bill dot matrix image according to a preset image printing instruction. Namely, the printer carried by the POS terminal is used for printing the bill dot matrix image. Since the ESC (escape) instruction set is a standardized instruction set commonly used in current printers, in order to expand the application range of the method for printing a ticket by a POS terminal provided in this embodiment, preferably, the preset image printing instruction is an image printing instruction of the ESC instruction set.
When a POS terminal is adopted to directly print a bill dot matrix image, in order to obtain a better printing effect, the bill dot matrix webpage is intercepted, and the specific steps of obtaining the bill dot matrix image for printing comprise: acquiring the printing width of the POS terminal; adjusting the size of the bill dot matrix webpage according to the printing width; and intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image for printing. The printing width of the POS terminal refers to the actual width of a bill which can be printed by the POS terminal. And scaling the bill dot matrix webpage output in the step S14 according to the printing width so as to adapt to the printing requirement of the POS terminal, thereby obtaining a better printing effect.
In order to meet the requirement of the user on various typesetting formats of the bill, preferably, the at least one template comprises a plurality of templates; the specific steps of embedding the bill data into the template by adopting a preset rule comprise: receiving a target template selected by a user; and embedding the bill data into the target template by adopting a preset rule. Providing a plurality of templates, wherein the templates are all written by adopting a markup language matched with an operating system of the POS terminal, and the templates have different typesetting formats, such as different text typesetting formats, different picture typesetting formats or different image-text mixed typesetting formats.
The method for printing the bill by the POS terminal according to the embodiment of the present invention provides a template written by using a markup language, and embeds the bill data generated by the POS terminal into the template by using the feature that the markup language supports mixed arrangement of various languages, various fonts, and image and text, and realizes printing of the bill in which the POS terminal mixes multiple languages, multiple fonts, and images and texts by using the rendering function of the markup language, thereby solving the problems of single printing effect and poor user experience of the existing POS terminal.
Moreover, the present embodiment further provides a POS terminal, and fig. 2 is a schematic structural diagram of the POS terminal according to the present embodiment. As shown in fig. 2, the POS terminal provided in the present embodiment includes: the device comprises a storage module 21, a receiving module 22, a processing module 23, an analysis module 24 and an interception module 25.
The storage module 21 is configured to store at least one template, where the template is written in a markup language. The conventional POS terminals are generally intelligent POS terminals, and the intelligent POS terminal is configured to be equipped with an operating system to extend functions of the POS terminal, where the operating system may be, but is not limited to, an Android operating system. The operating system itself has markup language container rendering functionality, such as a web parsing container in the Android operating system. Moreover, the markup language supports mixed arrangement of various languages, various fonts and pictures, so that the specific implementation mode realizes typesetting of various types of bills by constructing a template written by adopting the markup language and utilizing the container rendering function of the operating system of the POS terminal. The Markup Language is Extensible Markup Language (XML), HyperText Markup Language (HTML), Standard Generalized Markup Language (SGML), or Extensible HyperText Markup Language (XHTML).
The generating module 22 is configured to generate a piece of ticket data. The bill data may be plain text data, plain image data, or text-text mixed data. The receipt data is generated by an application program carried by the POS terminal, and may be a receipt generated by a payment application installed on the POS terminal, a cash register generated by a cash register application developed on the POS terminal, a coupon generated by a card application installed on the POS terminal, or a ticket generated by a purchase-sale-stock application installed on the POS terminal. Those skilled in the art can set the data according to actual needs, and the specific embodiment does not limit the specific manner of the ticket data generated by the POS terminal, as long as the data is generated by the POS terminal itself.
The processing module 23 is connected to the generating module 22, and is configured to embed the ticket data into the template by using a preset rule, so as to generate a markup language file. In order to improve the efficiency of bill printing, preferably, the template includes a plurality of variables, and the variables correspond to a plurality of pieces of information in the bill data one to one; the processing module 23 uses a mapping dictionary to replace the plurality of information in the bill data with the plurality of variables in the template one by one, so as to generate a markup language file. The plurality of information in the bill data includes a plurality of types of the bill name, the bill type, the transaction details, the transaction commodity unit price, the transaction commodity quantity, the transaction total amount, the bar code, the two-dimensional code, the coupon preferential content, the purchase, sale and inventory details and the like. The mapping dictionary may be a one-to-one correspondence relationship between variables in the template and a plurality of pieces of information in the ticket data, which is established by a manufacturer of the POS terminal in advance according to the template. And according to the mapping dictionary, replacing variables in the template by the information in the bill data, and dynamically generating a markup language file.
The analysis module 24 is connected to the processing module 23, and is configured to analyze the markup language file and output a bill dot matrix image. For example, when the operating system loaded on the POS terminal is an Android operating system, the parsing module 24 includes a web parsing container. And the WebView control carried by the Android operating system transmits the markup language file to a web parsing container, and the web parsing container parses the markup language file and outputs a bill dot matrix webpage.
The intercepting module 25 is connected with the analyzing module 24 and is used for intercepting the bill dot matrix webpage to obtain a bill dot matrix image for printing. When the bill dot matrix web page output from the parsing module 24 is displayed on the display screen of the POS terminal, the intercepting module 27 obtains a bill dot matrix image through a real screen capturing operation; when the bill dot matrix web page output by the parsing module 24 is not displayed on the display screen of the POS terminal, the capture module 27 performs a virtual screen capture operation in the parsing container to obtain a bill dot matrix image.
Fig. 3 is a schematic structural diagram of an intercept module in a POS terminal according to an embodiment of the present invention. In order to obtain a better printing effect, preferably, as shown in fig. 3, the intercepting module 25 includes an obtaining unit 251, an adjusting unit 252, and an intercepting unit 253; the acquiring unit 251 is configured to acquire a printing width of the POS terminal; the adjusting unit 252 is connected to the obtaining unit 251, and is configured to adjust the size of the bill dot matrix webpage according to the printing width; the intercepting unit 253 is connected with the adjusting unit 252 and is used for intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image. The printing width of the POS terminal refers to the actual width of a bill which can be printed by the POS terminal. And according to the printing width, zooming the bill dot matrix webpage output by the analysis module 24 to adapt to the printing requirement of the POS terminal, thereby obtaining a better printing effect.
In order to enhance the functions of the POS terminal and expand the application field of the POS terminal, preferably, the POS terminal further includes a printing module 26, and the printing module 26 is connected to the intercepting module 25 and configured to print the bill dot matrix image according to a preset image printing instruction. Since the ESC (escape) instruction set is a standardized instruction set commonly used in current printers, in order to expand the application range of the method for printing a ticket by a POS terminal provided in this embodiment, preferably, the preset image printing instruction is an image printing instruction of the ESC instruction set.
Fig. 4 is a schematic diagram of a processing module in a POS terminal according to an embodiment of the present invention. Preferably, as shown in fig. 4, the at least one template comprises a plurality of templates; the processing module 23 comprises a selection unit 231 and an embedding unit 232; the selecting unit 231 is connected to the storage module 21, and is configured to select a target template from the plurality of templates by a user; the embedding unit 232 is connected to the selecting unit 231, and configured to embed the ticket data into the target template by using a preset rule. For example, as shown in fig. 2, the storage module 21 stores a first template 211, a second template 212, and a third template 213. The above is only an example of the plurality of templates stored in the storage module 21, and the storage module 21 is not limited to only three templates, and a person skilled in the art may set the number of templates according to actual needs, which is not limited in this embodiment. The templates are all written by adopting a markup language matched with an operating system of the POS terminal, and have different typesetting formats, such as different text typesetting formats, different picture typesetting formats or different image-text mixed typesetting formats. The user may select the target template directly from the POS terminal, in which case the selection module 231 includes physical keys on the POS terminal or virtual keys displayed on a display screen of the POS terminal.
The POS terminal provided by the specific embodiment is characterized in that a template written by adopting a markup language is provided, the markup language is utilized to support the characteristic that various languages, various fonts and image characters are arranged in a mixed mode, bill data generated by the POS terminal is embedded into the template, through the rendering function of the markup language, the printing of bills in various languages, various fonts and images and texts by the POS terminal is realized, and the problems that the printing effect of the existing POS terminal is single and the user experience is poor are solved.
Example 1
This embodiment provides a POS terminal, where fig. 5A is a schematic diagram of a markup language file according to embodiment 1 of the present invention, and fig. 5B is a schematic diagram of a ticket printed by the POS terminal according to embodiment 1 of the present invention.
The POS terminal in this embodiment is loaded with an Android operating system, and a template written in HTML is stored in the POS terminal, where the template includes a plurality of replaceable variables. When a Japanese bill is to be printed, generating Japanese bill data by a cash register application installed on the POS terminal, and replacing a plurality of variables in the template one by one with a plurality of information in the Japanese bill according to a preset mapping dictionary to obtain an HTML file shown in FIG. 5A; the WebView control carried by the Android operating system transmits the HTML file to a web analysis container for analysis to obtain an HTML bill dot matrix webpage; then, the POS terminal adjusts the size of the Japanese bill dot matrix webpage according to the printing width of the Japanese bill dot matrix webpage; then, carrying out virtual screen capture operation on the adjusted Japanese bill dot matrix webpage to obtain a Japanese bill dot matrix image for printing; and finally, the POS terminal prints the Japanese bill dot matrix image according to an image printing instruction in the ESC instruction set, and the finally printed Japanese bill is shown in FIG. 5B.
Example 2
This embodiment provides a POS terminal, fig. 6A is a schematic diagram of a markup language file according to embodiment 2 of the present invention, and fig. 6B is a schematic diagram of a ticket printed by the POS terminal according to embodiment 2 of the present invention.
The POS terminal in this embodiment is loaded with an Android operating system, and a template written in HTML is stored in the POS terminal, where the template includes a plurality of replaceable variables. When a text-text mixed arrangement bill is to be printed, generating text-text mixed arrangement bill data by a card-bill application installed on the POS terminal, and replacing a plurality of variables in the template one by one with a plurality of information in the text-text mixed arrangement bill according to a preset mapping dictionary to obtain an HTML file shown in FIG. 6A; the WebView control carried by the Android operating system transmits the HTML file to a web analysis container for analysis to obtain a picture-text mixed arrangement bill dot matrix webpage; then, the POS terminal adjusts the size of the dot matrix webpage of the image-text mixed arrangement bill according to the printing width of the POS terminal; then, carrying out virtual screen capture operation on the adjusted image-text mixed arrangement bill dot matrix webpage to obtain an image-text mixed arrangement bill dot matrix image for printing; and finally, the POS terminal prints the dot matrix image of the image-text mixed arrangement bill according to the image printing instruction in the ESC instruction set, and the finally printed image-text mixed arrangement bill is shown in FIG. 6B.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.

Claims (10)

1. A method for printing a bill by a POS terminal is characterized by comprising the following steps:
providing at least one template, wherein the template is compiled by adopting a markup language so as to realize typesetting of various types of bills by utilizing a container rendering function carried by an operating system carried on a POS terminal;
generating bill data, wherein the bill data is generated by an application program carried by the POS terminal;
embedding the bill data into the template by adopting a preset rule to generate a markup language file;
analyzing the markup language file and outputting a bill dot matrix webpage;
when the bill dot matrix webpage is displayed on the display screen of the POS terminal, obtaining a bill dot matrix image for printing through a real screen capturing operation; when the bill dot matrix webpage is not displayed on the display screen of the POS terminal, carrying out a virtual screen capturing operation in an analysis container to obtain a bill dot matrix image for printing;
and printing the bill dot matrix image through a printer in the POS terminal according to a preset image printing instruction, wherein the preset image printing instruction is an image printing instruction of an ESC instruction set.
2. The method of printing tickets at a POS terminal according to claim 1, wherein the markup language is an extensible markup language, a hypertext markup language, a standard generic markup language, or an extensible hypertext markup language.
3. The method for printing the bill by the POS terminal according to claim 1, wherein the step of intercepting the bill dot matrix web page to obtain a bill dot matrix image for printing comprises: acquiring the printing width of the POS terminal;
adjusting the size of the bill dot matrix webpage according to the printing width;
and intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image for printing.
4. The method of printing tickets at a POS terminal according to claim 1, wherein the at least one template comprises a plurality of templates; the specific steps of embedding the bill data into the template by adopting a preset rule comprise:
receiving a target template selected by a user;
and embedding the bill data into the target template by adopting a preset rule.
5. The method for printing the bill by the POS terminal according to claim 1, wherein the bill data is embedded in the template by a preset rule, and the specific step of generating the markup language file comprises: the template comprises a plurality of variables, and the variables correspond to a plurality of pieces of information in the bill data one by one;
and replacing the plurality of information in the bill data and the plurality of variables in the template one by adopting a mapping dictionary to generate a markup language file.
6. A POS terminal, comprising:
the storage module is used for storing at least one template, and the template is compiled by adopting a markup language so as to realize typesetting of various types of bills by utilizing a container rendering function carried by an operating system carried on the POS terminal;
the generating module is used for generating bill data, and the bill data is generated by an application program carried by the POS terminal;
the processing module is connected with the generating module and used for embedding the bill data into the template by adopting a preset rule to generate a markup language file;
the analysis module is connected with the processing module and used for analyzing the markup language file and outputting a bill dot matrix webpage;
the intercepting module is connected with the analyzing module and is used for obtaining a bill dot matrix image for printing through a real screen intercepting operation when the bill dot matrix webpage is displayed on the display screen of the POS terminal; when the bill dot matrix webpage is not displayed on the display screen of the POS terminal, carrying out a virtual screen capturing operation in an analysis container to obtain a bill dot matrix image for printing;
and the printing module is connected with the intercepting module and used for printing the bill dot matrix image through a printer arranged in the POS terminal according to a preset image printing instruction, wherein the preset image printing instruction is an image printing instruction of an ESC instruction set.
7. The POS terminal of claim 6, wherein the markup language is an extensible markup language, a hypertext markup language, a standard generic markup language, or an extensible hypertext markup language.
8. The POS terminal of claim 6, wherein the intercept module comprises an acquisition unit, an adjustment unit, and an intercept unit; the acquiring unit is used for acquiring the printing width of the POS terminal; the adjusting unit is connected with the acquiring unit and used for adjusting the size of the bill dot matrix webpage according to the printing width; and the intercepting unit is connected with the adjusting unit and is used for intercepting the adjusted bill dot matrix webpage to obtain a bill dot matrix image for printing.
9. The POS terminal of claim 6, wherein the at least one template comprises a plurality of templates; the processing module comprises a selection unit and an embedding unit; the selection unit is connected with the storage module and is used for selecting a target template from the plurality of templates by a user; and the embedding unit is connected with the selecting unit and is used for embedding the bill data into the target template by adopting a preset rule.
10. The POS terminal of claim 6, wherein the template comprises a plurality of variables, and the variables correspond to a plurality of information in the bill data in a one-to-one manner; and the processing module adopts a mapping dictionary to replace a plurality of information in the bill data and a plurality of variables in the template one by one so as to generate a markup language file.
CN201710576143.0A 2017-06-20 2017-07-14 Method for printing bill by POS terminal and POS terminal Active CN107423004B (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710468431 2017-06-20
CN2017104684314 2017-06-20

Publications (2)

Publication Number Publication Date
CN107423004A CN107423004A (en) 2017-12-01
CN107423004B true CN107423004B (en) 2021-03-30

Family

ID=60427146

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710576143.0A Active CN107423004B (en) 2017-06-20 2017-07-14 Method for printing bill by POS terminal and POS terminal

Country Status (1)

Country Link
CN (1) CN107423004B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108536398A (en) * 2018-01-18 2018-09-14 艾体威尔电子技术(北京)有限公司 A method of realizing Chinese and English different fonts printing
CN109177510A (en) * 2018-08-12 2019-01-11 深圳国微金融科技有限公司 A kind of thermal printer based on external typesetting
CN111190557A (en) * 2019-12-30 2020-05-22 航天信息股份有限公司 Certificate printing method and system for configurable printing items
CN112000302B (en) * 2020-08-25 2021-08-17 上海合阔信息技术有限公司 Label generation method, template configuration method, device and storage medium
CN112162714B (en) * 2020-12-03 2021-03-12 广州市玄武无线科技股份有限公司 Printing method, device and equipment for dynamic configuration page
CN116611397A (en) * 2023-05-19 2023-08-18 北京神州安付科技股份有限公司 Special font processing method and system for financial payment equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN104924793A (en) * 2015-06-16 2015-09-23 深圳市新国都支付技术有限公司 Information printing method for all kinds of cash collecting equipment receipts compatible with POS terminal
CN106548573A (en) * 2016-10-31 2017-03-29 无锡雅座在线科技发展有限公司 The Method of printing and device of consumption information

Family Cites Families (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6908034B2 (en) * 2001-12-17 2005-06-21 Zih Corp. XML system
US20050247773A1 (en) * 2004-05-06 2005-11-10 Jack Hoang Template-based information extraction system and method
US20100153225A1 (en) * 2006-03-26 2010-06-17 Jay Ferro Printing Dynamic Image Content on Receipts
US20090167553A1 (en) * 2007-12-30 2009-07-02 Jin Hong Open Mobile Online Reservation and Ordering Systems
CN101477733B (en) * 2008-12-31 2010-11-17 深圳市奥拓电子股份有限公司 Bill printing system
US20120173350A1 (en) * 2011-01-04 2012-07-05 Doug Robson Mobile application facilitating restaurant activities and methods thereof
US20120239417A1 (en) * 2011-03-04 2012-09-20 Pourfallah Stacy S Healthcare wallet payment processing apparatuses, methods and systems
CN102360274A (en) * 2011-09-30 2012-02-22 上海慧谋网络科技有限公司 Variable-data printing template realization device and application method for same
WO2013062481A1 (en) * 2011-10-24 2013-05-02 Nachiappan Nachiappa Anonymous collection, presentment and reverse auction of payment receipt items
CN103679515A (en) * 2012-09-26 2014-03-26 梅特勒-托利多(常州)测量技术有限公司 Receipt printing method and receipt printing system
CN103778732A (en) * 2012-10-19 2014-05-07 方欣科技有限公司 Electronic-invoice issuing method and device
CN103914933B (en) * 2012-12-30 2017-06-30 航天信息股份有限公司 A kind of printing invoice method and apparatus based on XML technology
JP6127541B2 (en) * 2013-01-30 2017-05-17 セイコーエプソン株式会社 PRINT CONTROL DEVICE, CONTROL METHOD AND PROGRAM FOR PRINT CONTROL DEVICE
CN103198558B (en) * 2013-02-06 2014-12-10 深圳宝嘉电子设备有限公司 Bank counter intelligent processing terminal
CN104679452B (en) * 2013-12-02 2018-04-20 航天信息股份有限公司 Printing invoice Data Binding Method in a kind of taxation control system
CN105930312B (en) * 2015-09-29 2019-06-07 中国银联股份有限公司 A kind of printing strip edit methods and device based on POS terminal
CN106530528B (en) * 2016-10-11 2020-02-18 上海慧银信息科技有限公司 Method and device for identifying cash register bill information

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104571977A (en) * 2014-12-05 2015-04-29 北京赛德高科铁道电气科技有限责任公司 Report printing method and system based on HTML (Hyper Text Markup Language) template
CN104924793A (en) * 2015-06-16 2015-09-23 深圳市新国都支付技术有限公司 Information printing method for all kinds of cash collecting equipment receipts compatible with POS terminal
CN106548573A (en) * 2016-10-31 2017-03-29 无锡雅座在线科技发展有限公司 The Method of printing and device of consumption information

Also Published As

Publication number Publication date
CN107423004A (en) 2017-12-01

Similar Documents

Publication Publication Date Title
CN107423004B (en) Method for printing bill by POS terminal and POS terminal
US9030706B2 (en) Method of adding value to print data, a value-adding device, and a recording medium
US10282410B2 (en) Assistive technology for the impaired
JPH07110841A (en) Method and apparatus for processing of securities
CN107153636A (en) It is a kind of to realize the method and system that business datum is quickly exported with PDF format
CN112000302B (en) Label generation method, template configuration method, device and storage medium
US9110615B2 (en) Point of sale control device, control method, and storage medium storing a program for a point of sale device
CN101174350A (en) Bill processing equipment and method
US10102457B2 (en) Host device, printing system, and data processing method
KR20090037264A (en) Rogo menufacturing method using the internet
CN115543238B (en) Browser page printing method, device, equipment and storage medium
CN107415489B (en) Method for expanding printing content and printer thereof
US20060069992A1 (en) Method of managing the printing of characters and a printing device employing method
CN107015959A (en) A kind of method that version is closed to pdf document
CN102099806B (en) Information output apparatus, information output method, and recording medium
CN115454360A (en) Label printing method, device and medium capable of flexibly adjusting printing format
US10984298B2 (en) Acquiring item values from printers based on notation form settings
US20160371233A1 (en) Assistive technology for the impaired
JP3520389B2 (en) System and method for barcode printing
US20160379198A1 (en) Commodity sales data processing apparatus
JP2012185635A (en) Sales analytical program using print data, sales information acquisition device and sales information acquisition method
TWI578236B (en) Method for creating a triggerable barcode icon for electronic document and transformation system thereof
CN117632056A (en) Method and system for printing and rendering engine of bill capable of being arranged
JP2001143058A (en) Documentation system for image information
CN111598975A (en) Electronic tag image rendering method and related device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant