CN113805822A - Ticket printing generation method, device, equipment and medium on embedded terminal - Google Patents

Ticket printing generation method, device, equipment and medium on embedded terminal Download PDF

Info

Publication number
CN113805822A
CN113805822A CN202110989230.5A CN202110989230A CN113805822A CN 113805822 A CN113805822 A CN 113805822A CN 202110989230 A CN202110989230 A CN 202110989230A CN 113805822 A CN113805822 A CN 113805822A
Authority
CN
China
Prior art keywords
printed
character information
character
characters
information
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.)
Pending
Application number
CN202110989230.5A
Other languages
Chinese (zh)
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.)
Fujian Morefun Electronic Technology Co ltd
Original Assignee
Fujian Morefun Electronic 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 Fujian Morefun Electronic Technology Co ltd filed Critical Fujian Morefun Electronic Technology Co ltd
Priority to CN202110989230.5A priority Critical patent/CN113805822A/en
Publication of CN113805822A publication Critical patent/CN113805822A/en
Pending legal-status Critical Current

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
    • 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/1211Improving printing performance
    • 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/1242Image or content composition onto a page
    • G06F3/1243Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
    • 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/125Page layout or assigning input pages onto output media, e.g. imposition
    • 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/1292Mobile client, e.g. wireless printing
    • GPHYSICS
    • G07CHECKING-DEVICES
    • G07GREGISTERING THE RECEIPT OF CASH, VALUABLES, OR TOKENS
    • G07G1/00Cash registers
    • G07G1/0018Constructional details, e.g. of drawer, printing means, input means

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Record Information Processing For Printing (AREA)

Abstract

The invention discloses a method for printing and generating a receipt on an embedded terminal, which comprises the following steps: acquiring data to be printed, wherein the data to be printed comprises text information to be printed and/or pictures to be printed; when acquiring character information to be printed, extracting character information of specified characters from a font library file by using FreeType2, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment; when a picture to be printed is obtained, carrying out binarization on the picture to be printed; and outputting the typeset characters and/or the binarized pictures for embedded terminal printing. The invention provides a method, a device, equipment and a medium for printing and generating a receipt on an embedded terminal, which are used for generating the receipt by using the technology at the bottom layer, have low consumption on performance, and can realize typesetting and printing of characters and pictures on embedded equipment with poor performance and without a complete operating system.

Description

Ticket printing generation method, device, equipment and medium on embedded terminal
Technical Field
The invention relates to the technical field of embedded terminals, in particular to a method, a device, equipment and a medium for printing and generating a receipt on an embedded terminal.
Background
At the POS, the receipt is printed after the transaction is completed, typically using a self-contained thermal printer. The generation of the receipt needs to be typeset by characters and pictures, and most POS machine equipment uses some character typesetting libraries or typesetting engines to realize functions at present. Some devices also use HTML pages to perform typesetting functions.
The existing text and picture typesetting software occupies too much space and has high requirements on hardware. However, most small POS devices are embedded devices with low processor performance and small memory space. Excessive performance and space overhead of software can be difficult for embedded devices to operate. The HTML webpage needs intelligent equipment to process, and the embedded equipment is difficult to support the processing mode of the HTML webpage.
Disclosure of Invention
The invention aims to solve the technical problem of providing a method, a device, equipment and a medium for generating the printing of the receipt on the embedded terminal, which realize the typesetting and printing of characters and pictures on the embedded equipment with poor performance and no complete operating system.
In a first aspect, the present invention provides a method for printing and generating a receipt on an embedded terminal, including:
acquiring data to be printed, wherein the data to be printed comprises text information to be printed and/or pictures to be printed;
when acquiring character information to be printed, extracting character information of specified characters from a font library file by using FreeType2, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
when a picture to be printed is obtained, carrying out binarization on the picture to be printed;
and outputting the typeset characters and/or the binarized pictures for embedded terminal printing.
Further, the text information to be printed comprises characters, fonts, word sizes and formats, wherein the formats comprise bold, italic and underline;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
Further, binarizing the to-be-printed picture, specifically comprising:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
In a second aspect, the present invention provides a ticket printing and generating device on an embedded terminal, including: the device comprises a data acquisition module, a word processing module, a picture processing module and an output module;
the data acquisition module is used for acquiring data to be printed, and the data to be printed comprises character information to be printed and/or pictures to be printed;
the character processing module is used for extracting character information of specified characters from a font library file by using FreeType2 when the character information to be printed is acquired, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
the picture processing module is used for carrying out binarization on the picture to be printed when the picture to be printed is obtained;
and the output module is used for outputting the typesetted characters and/or the binarized pictures for embedded terminal printing.
Further, in the word processing module, performing word typesetting according to the character information and the setting of the printing device specifically includes:
the character information to be printed comprises characters, fonts, word sizes and formats, wherein the formats comprise bold, italic and underline;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
Further, in the image processing module, binarizing the image to be printed, specifically including:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
In a third aspect, the present invention provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect when executing the program.
In a fourth aspect, the invention provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the method of the first aspect.
The technical scheme provided by the embodiment of the invention has the following technical effects or advantages:
the method comprises the steps of obtaining character information of specified characters through FreeType2, then performing character typesetting according to the character information and the setting of printing equipment, performing binaryzation on a picture to be printed, generating a receipt by using the typesetted characters and the binarized picture, using the technology of the bottommost layer, and having extremely low consumption on performance, thereby realizing typesetting and printing of the characters and the picture on embedded equipment with poor performance and no complete operating system.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
The invention will be further described with reference to the following examples with reference to the accompanying drawings.
FIG. 1 is a flow chart of a method according to one embodiment of the present invention;
FIG. 2 is a diagram illustrating character information according to an embodiment of the present invention;
FIG. 3 is a rendering effect diagram according to a first embodiment of the present invention;
FIG. 4 is a schematic diagram illustrating an error diffusion of the Floyd-Steinberg dithering algorithm according to an embodiment of the present invention;
FIG. 5 is a comparison diagram of the binarization effects of the images in the first embodiment of the invention;
FIG. 6 is a schematic structural diagram of an apparatus according to a second embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to a third embodiment of the invention;
fig. 8 is a schematic structural diagram of a medium according to a fourth embodiment of the present invention.
Detailed Description
The embodiment of the invention provides a method, a device, equipment and a medium for printing and generating a receipt on an embedded terminal, which can realize typesetting and printing of characters and pictures on embedded equipment with poor performance and no complete operating system.
The technical scheme in the embodiment of the invention has the following general idea:
and (4) typesetting the characters and the pictures by using the most basic bottom layer tool to quickly generate the receipt pictures. The embodiment of the invention adopts FreeType2 to obtain character and graphic data, and presets a plurality of basic character typesetting formats. A noise dithering algorithm is used to process a color picture so that a thermal printer that is only monochrome can render the picture in grayscale. When the receipt is generated, the text content is added by setting the format of the characters and the characters, and the picture content is added by setting the scaling format of the picture and the picture, so that a binary picture of the receipt is obtained for printing by the embedded printer terminal.
Example one
The embodiment provides a method for printing and generating a receipt on an embedded terminal, as shown in fig. 1, including:
and acquiring data to be printed, wherein the data to be printed comprises text information to be printed and/or pictures to be printed.
When acquiring character information to be printed, extracting character information of specified characters from a font library file by using FreeType2, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
FreeType2 is an open source, portable font engine with low performance and space overhead due to its implementation using underlying technology.
And when the picture to be printed is acquired, carrying out binarization on the picture to be printed.
Because the embedded printer device only supports outputting black and white colors and does not support outputting gray scale, the image to be printed needs to be converted into a binary image to realize printing.
And outputting the typeset characters and/or the binarized pictures for embedded terminal printing.
The method comprises the steps of obtaining character information of specified characters through FreeType2, then performing character typesetting according to the character information and the setting of printing equipment, performing binaryzation on a picture to be printed, generating a receipt by using the typesetted characters and the binarized picture, using the technology of the bottommost layer, and having extremely low consumption on performance, thereby realizing typesetting and printing of the characters and the picture on embedded equipment with poor performance and no complete operating system.
Preferably, the text information to be printed comprises characters, fonts, word sizes and formats, and several basic text typesetting formats are preset, including bold, italic, underline and the like;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
Preferably, binarizing the to-be-printed picture, specifically including:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
The Floyd-Steinberg dithering algorithm diffuses the error of the current pixel to a plurality of adjacent pixels according to a set proportion, if the current pixel is rounded downwards, the probability that the next pixel is rounded upwards is higher, the average quantization error can be minimized, and the gray information of the image can still be embodied after the image is binarized.
In a specific embodiment, the following is implemented:
the present embodiment handles two types of content, text content using FreeType2 and picture content using Floyd-Steinberg dithering algorithm.
1. FreeType2 processing text
The present embodiment, using FreeType2, can extract position information (including left and upper strides), size information (including width and height), and step information for a specified letter from a font file, as shown in fig. 2.
According to the information, the position relation between the current character and the current base line and the original point can be obtained, the distance between the leftmost side and the original point of the character is the left span, and the distance between the uppermost side and the original point is the upper span. The rendering origin of the next character is positioned at the right side of the current origin, and the distance from the current origin is the stepping value of the current character. In this way, the characters can be quickly typeset, and the typesetting functions of bold, italic and underline can be added. The size of the canvas can be obtained by calculating the text typesetting mode, and then the text image can be rendered at the prearranged position according to the specified format. The rendered image is shown in fig. 3.
2. Dithering algorithm processing pictures
The Floyd-Steinberg dithering algorithm based on error diffusion realizes dithering by using error diffusion, and the error is diffused to adjacent pixels. First, each pixel of the picture is scanned from left to right and from top to bottom, and the gray scale of the coordinates is calculated. If the current gray scale value is 255 or more, the gray scale of the pixel is set to 255, and if the gray scale value is 255 or less, the gray scale of the pixel is set to 0. The difference between the gray level of the pixel and 255 is calculated, and 7/16, 3/16, 5/16 and 1/16 of the error are assigned to the right pixel, the lower left pixel, the lower right pixel and the lower right pixel, respectively, as shown in fig. 4. This process minimizes the average quantization error if the current pixel is rounded down, and the next pixel is more likely to be rounded up.
The error of the current pixel is diffused to several adjacent pixels according to the following proportion, and the scanned pixel is not influenced. As can be seen from fig. 5, the gray scale information of the image can still be represented after the image binarization.
Based on the same inventive concept, the application also provides a device corresponding to the method in the first embodiment, which is detailed in the second embodiment.
Example two
In this embodiment, there is provided an apparatus for printing and generating tickets on an embedded terminal, as shown in fig. 6, including: the device comprises a data acquisition module, a word processing module, a picture processing module and an output module;
the data acquisition module is used for acquiring data to be printed, and the data to be printed comprises character information to be printed and/or pictures to be printed;
the character processing module is used for extracting character information of specified characters from a font library file by using FreeType2 when the character information to be printed is acquired, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
the picture processing module is used for carrying out binarization on the picture to be printed when the picture to be printed is obtained;
and the output module is used for outputting the typesetted characters and/or the binarized pictures for embedded terminal printing.
Preferably, in the word processing module, the performing word typesetting according to the character information and the setting of the printing device specifically includes:
the character information to be printed comprises characters, fonts, word sizes and formats, wherein the formats comprise bold, italic and underline;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
Preferably, in the image processing module, binarizing the image to be printed, specifically including:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
Since the apparatus described in the second embodiment of the present invention is an apparatus used for implementing the method of the first embodiment of the present invention, based on the method described in the first embodiment of the present invention, a person skilled in the art can understand the specific structure and the deformation of the apparatus, and thus the details are not described herein. All the devices adopted in the method of the first embodiment of the present invention belong to the protection scope of the present invention.
Based on the same inventive concept, the application provides an electronic device embodiment corresponding to the first embodiment, which is detailed in the third embodiment.
EXAMPLE III
The embodiment provides an electronic device, as shown in fig. 7, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, any one of the first embodiment modes may be implemented.
Since the electronic device described in this embodiment is a device used for implementing the method in the first embodiment of the present application, based on the method described in the first embodiment of the present application, a specific implementation of the electronic device in this embodiment and various variations thereof can be understood by those skilled in the art, and therefore, how to implement the method in the first embodiment of the present application by the electronic device is not described in detail herein. The equipment used by those skilled in the art to implement the methods in the embodiments of the present application is within the scope of the present application.
Based on the same inventive concept, the application provides a storage medium corresponding to the fourth embodiment, which is described in detail in the fourth embodiment.
Example four
The present embodiment provides a computer-readable storage medium, as shown in fig. 8, on which a computer program is stored, and when the computer program is executed by a processor, any one of the first embodiment can be implemented.
Since the computer-readable storage medium described in this embodiment is a computer-readable storage medium used for implementing the method in the first embodiment of the present application, a person skilled in the art can understand a specific implementation manner of the computer-readable storage medium and various modifications thereof based on the method described in the first embodiment of the present application, and therefore, how to implement the method in the embodiment of the present application by using the computer-readable storage medium is not described in detail herein. Computer-readable storage media that can be used by those skilled in the art to implement the methods of the embodiments of the present application are all within the scope of the present application.
The method and the device for printing the characters acquire the character information of the appointed characters through the FreeType2, then perform character typesetting according to the character information and the setting of printing equipment, binarize the pictures to be printed, generate tickets by using the typesetted characters and the binarized pictures, use the technology of the bottommost layer, and have extremely low consumption on performance, so that typesetting and printing of the characters and the pictures are realized on embedded equipment without a complete operating system due to poor performance.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Although specific embodiments of the invention have been described above, it will be understood by those skilled in the art that the specific embodiments described are illustrative only and are not limiting upon the scope of the invention, and that equivalent modifications and variations can be made by those skilled in the art without departing from the spirit of the invention, which is to be limited only by the appended claims.

Claims (8)

1. A method for printing and generating a receipt on an embedded terminal is characterized by comprising the following steps:
acquiring data to be printed, wherein the data to be printed comprises text information to be printed and/or pictures to be printed;
when acquiring character information to be printed, extracting character information of specified characters from a font library file by using FreeType2, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
when a picture to be printed is obtained, carrying out binarization on the picture to be printed;
and outputting the typeset characters and/or the binarized pictures for embedded terminal printing.
2. The method of claim 1, wherein: performing text typesetting according to the character information and the setting of the printing equipment, and specifically comprising the following steps:
the character information to be printed comprises characters, fonts, word sizes and formats, wherein the formats comprise bold, italic and underline;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
3. The method of claim 1, wherein: and carrying out binarization on the picture to be printed, and specifically comprising the following steps:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
4. The utility model provides a receipt printing generation device on embedded terminal which characterized in that includes: the device comprises a data acquisition module, a word processing module, a picture processing module and an output module;
the data acquisition module is used for acquiring data to be printed, and the data to be printed comprises character information to be printed and/or pictures to be printed;
the character processing module is used for extracting character information of specified characters from a font library file by using FreeType2 when the character information to be printed is acquired, wherein the character information comprises character position information, character size information and stepping information, and then performing character typesetting according to the character information and the setting of printing equipment;
the picture processing module is used for carrying out binarization on the picture to be printed when the picture to be printed is obtained;
and the output module is used for outputting the typesetted characters and/or the binarized pictures for embedded terminal printing.
5. The apparatus according to claim 4, wherein the text composition performed by the text processing module according to the character information and the setting of the printing device specifically comprises:
the character information to be printed comprises characters, fonts, word sizes and formats, wherein the formats comprise bold, italic and underline;
extracting character information of specified characters from a font library file by using FreeType2 according to character information to be printed, wherein the character information comprises a left span, an upper span, a width, a height and a stepping distance;
setting an initial baseline and an initial origin according to printing equipment, then sequentially typesetting characters according to character information of each character from the initial baseline and the initial origin, and rendering the characters at a prearranged position according to a format.
6. The apparatus of claim 4, wherein: in the picture processing module, binarization is performed on the picture to be printed, and the method specifically comprises the following steps:
and scanning each pixel of the picture to be printed from left to right and from top to bottom by using a Floyd-Steinberg dithering algorithm, binarizing the pixels one by one, and superposing errors after the binarization of the pixels on adjacent pixels.
7. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 3 when executing the program.
8. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1 to 3.
CN202110989230.5A 2021-08-26 2021-08-26 Ticket printing generation method, device, equipment and medium on embedded terminal Pending CN113805822A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110989230.5A CN113805822A (en) 2021-08-26 2021-08-26 Ticket printing generation method, device, equipment and medium on embedded terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110989230.5A CN113805822A (en) 2021-08-26 2021-08-26 Ticket printing generation method, device, equipment and medium on embedded terminal

Publications (1)

Publication Number Publication Date
CN113805822A true CN113805822A (en) 2021-12-17

Family

ID=78941819

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110989230.5A Pending CN113805822A (en) 2021-08-26 2021-08-26 Ticket printing generation method, device, equipment and medium on embedded terminal

Country Status (1)

Country Link
CN (1) CN113805822A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103488441A (en) * 2013-09-06 2014-01-01 深圳市新国都技术股份有限公司 Implementation method for printing Arabic on POS (point-of-sale) terminals
US20150130646A1 (en) * 2013-09-03 2015-05-14 Compart AG Method and system for lzw based decompression
CN106569755A (en) * 2016-10-26 2017-04-19 深圳盒子支付信息技术有限公司 Printing method and printing deice for mobile payment terminal
CN110807823A (en) * 2019-11-13 2020-02-18 四川大学 Image simulation generation method for dot matrix character printing effect
CN111722815A (en) * 2020-06-24 2020-09-29 广东印萌科技有限公司 Printing control method and device for automatic typesetting and electronic equipment
CN112784825A (en) * 2019-11-01 2021-05-11 株式会社理光 Method for identifying characters in picture, method, device and equipment for searching keywords
CN112927320A (en) * 2021-03-05 2021-06-08 上海中通吉网络技术有限公司 Method, device and equipment for printing watermark characters and printer

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150130646A1 (en) * 2013-09-03 2015-05-14 Compart AG Method and system for lzw based decompression
CN103488441A (en) * 2013-09-06 2014-01-01 深圳市新国都技术股份有限公司 Implementation method for printing Arabic on POS (point-of-sale) terminals
CN106569755A (en) * 2016-10-26 2017-04-19 深圳盒子支付信息技术有限公司 Printing method and printing deice for mobile payment terminal
CN112784825A (en) * 2019-11-01 2021-05-11 株式会社理光 Method for identifying characters in picture, method, device and equipment for searching keywords
CN110807823A (en) * 2019-11-13 2020-02-18 四川大学 Image simulation generation method for dot matrix character printing effect
CN111722815A (en) * 2020-06-24 2020-09-29 广东印萌科技有限公司 Printing control method and device for automatic typesetting and electronic equipment
CN112927320A (en) * 2021-03-05 2021-06-08 上海中通吉网络技术有限公司 Method, device and equipment for printing watermark characters and printer

Similar Documents

Publication Publication Date Title
WO2018223994A1 (en) Method and device for synthesizing chinese printed character image
JP2019505872A (en) Method and apparatus for generating a two-dimensional code image having a dynamic effect
US11574489B2 (en) Image processing system, image processing method, and storage medium
US8086040B2 (en) Text representation method and apparatus
JP2012199901A (en) Document modification detecting method by character comparison using character shape feature
JP2560133B2 (en) Image integrated processing device
US20190005325A1 (en) Identification of emphasized text in electronic documents
CN113592735A (en) Text page image restoration method and system, electronic equipment and computer readable medium
EP1093078B1 (en) Reducing apprearance differences between coded and noncoded units of text
CN113805822A (en) Ticket printing generation method, device, equipment and medium on embedded terminal
CN102096903B (en) Page rasterized character smooth processing method and system
CN112101356A (en) Method and device for positioning specific text in picture and storage medium
JP3211417B2 (en) Page description language processor
CN112200158A (en) Training data generation method and system
JP6614857B2 (en) Image processing apparatus, image processing method, and program
JPH0384681A (en) Input processing method for business card information
CN115796119B (en) Font calibration method based on rendering effect
CN115830612A (en) OCR training data generation method, device, equipment and storage medium
JP4651407B2 (en) Image processing apparatus, computer program, and storage medium
CN118037541A (en) Word size modification rearrangement method of text image and thermal printer
CN115686391A (en) Printing control method and device for image-text mixed layout
CN116740747A (en) Text line identification method and device, storage medium and electronic equipment
CN116881399A (en) Data information processing method, device, electronic equipment and storage medium
CN117873616A (en) Text self-adaptive display method and device, electronic equipment and storage medium
CN114419303A (en) Character recognition method and scanning system based on scanning software

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