CN112486428B - Printing method, device and storage medium - Google Patents
Printing method, device and storage medium Download PDFInfo
- Publication number
- CN112486428B CN112486428B CN202011295281.XA CN202011295281A CN112486428B CN 112486428 B CN112486428 B CN 112486428B CN 202011295281 A CN202011295281 A CN 202011295281A CN 112486428 B CN112486428 B CN 112486428B
- Authority
- CN
- China
- Prior art keywords
- printed
- printing
- printer
- character
- word
- 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
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1242—Image or content composition onto a page
- G06F3/1243—Variable data printing, e.g. document forms, templates, labels, coupons, advertisements, logos, watermarks, transactional printing, fixed content versioning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1237—Print job management
- G06F3/1253—Configuration of print job parameters, e.g. using UI at the client
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F3/00—Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
- G06F3/12—Digital output to print unit, e.g. line printer, chain printer
- G06F3/1201—Dedicated interfaces to print systems
- G06F3/1223—Dedicated interfaces to print systems specifically adapted to use a particular technique
- G06F3/1275—Print workflow management, e.g. defining or changing a workflow, cross publishing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F40/00—Handling natural language data
- G06F40/10—Text processing
- G06F40/12—Use of codes for handling textual entities
- G06F40/126—Character encoding
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (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)
- Record Information Processing For Printing (AREA)
Abstract
The application discloses a printing method, a printing device and a storage medium. The method comprises the following steps: obtaining information to be printed, wherein the information to be printed comprises characters to be printed, judging whether the characters to be printed are uncommon words, and if the characters to be printed are uncommon words, searching the uncommon word lattice data corresponding to the characters to be printed in a preset lattice soft word library. And after the rarely used word lattice data are assembled according to a bitmap printing mode instruction format of a printer with preset configuration parameters, the rarely used word lattice data are sent to a first driving interface of the printer for printing. The embodiment provided by the application solves the problem that the printing can not be directly performed through the text instruction printing mode under the condition that the rarely used word exists in the related technology.
Description
Technical Field
The present application relates to the field of printing technologies, and in particular, to a printing method, apparatus, and storage medium.
Background
The pin printer is a special printer such as bankbook printer, high speed line printer, etc. and there is a great difference between the ink jet and laser printers, and the difference is that other types of printers cannot be replaced, just because the pin printer has a unique market share and serves some special industry users.
For a pin printer, there are some rarely used words. The uncommon words mentioned in the application refer to Chinese characters that are not contained in the hard word stock of the printer. For example, if some printers only support GBK character sets, the hard word library of the characters other than GBK21003 characters does not include the character, and cannot be directly printed in the text instruction printing mode. Some printers support Chinese characters recorded in GB18030-2000, and Chinese characters recorded in GB18030-2005 or later Unicode and other international/domestic standards cannot be printed. In the background technology, if the rarely used word is to be printed, the hard word library is updated by a printer manufacturer, or only a new printer supporting the rarely used word is purchased, which requires the cost of hardware update or purchase. Upgrading the hard word stock is also limited by the number of IC slots of the printer word stock, the size of the supported capacity, etc.
Disclosure of Invention
The application provides a printing method, a printing device and a non-volatile storage medium, which are used for solving the problem that in the related art, if a rare word exists, the printing cannot be directly performed through a text instruction printing mode.
According to an aspect of the present application, there is provided a printing method comprising:
Acquiring information to be printed, wherein the information to be printed comprises characters to be printed;
judging whether the character to be printed is a rarely used character or not;
if the character to be printed is the uncommon character, searching the uncommon character lattice data corresponding to the character to be printed in a preset lattice soft character library;
And after the rarely used word lattice data are assembled according to a bitmap printing mode instruction format of a printer with preset configuration parameters, the rarely used word lattice data are sent to a first driving interface of the printer for printing.
In some embodiments, determining whether the character to be printed is an uncommon word comprises:
Determining a byte sequence corresponding to a character to be printed;
judging whether the byte sequence is in a coding range supported by the printer configuration parameters;
if not, judging that the character to be printed is an uncommon word.
In some embodiments, the method further comprises:
and if the character to be printed is not the uncommon word, sending the byte sequence of the character to be printed to a driving interface of the printer for printing.
In some embodiments, the print information further includes a stream of control instruction bytes; the method further comprises the steps of:
if the character to be printed is the uncommon word, preprocessing the uncommon word lattice data based on a control instruction corresponding to the control instruction byte stream to obtain target lattice data;
the step of transmitting the rarely used word lattice data to a first driving interface of the printer for printing after assembling the rarely used word lattice data according to a bitmap printing mode instruction format of the printer with preset configuration parameters comprises the following steps:
and after the target dot matrix data are assembled according to a bitmap printing mode instruction format of the printer with preset configuration parameters, the target dot matrix data are sent to a first driving interface of the printer for printing.
In some embodiments, the method further comprises:
If the character to be printed is a non-uncommon character, the control instruction is replaced by a printer control instruction and sent to the printer.
According to another aspect of an embodiment of the present invention, there is also provided a printing apparatus including:
the device comprises an acquisition unit, a printing unit and a printing unit, wherein the acquisition unit is configured to acquire information to be printed, and the information to be printed comprises characters to be printed;
the judging unit is configured to judge whether the character to be printed is an uncommon word or not;
The searching unit is configured to search the rare word lattice data corresponding to the character to be printed in a preset lattice soft word library if the character to be printed is the rare word;
The first printing unit is configured to assemble the rarely used word lattice data according to a bitmap printing mode instruction format of the printer with preset configuration parameters, and then send the rarely used word lattice data to a first driving interface of the printer for printing.
In some embodiments, the judging unit includes:
a determining subunit configured to determine a byte sequence corresponding to a character to be printed;
A judging subunit configured to judge whether the byte sequence is in a coding range supported by the printer configuration parameters;
And the judging subunit is configured to judge that the character to be printed is an uncommon word if the character to be printed is not the uncommon word.
In some embodiments, the apparatus further comprises:
and the second printing unit is configured to send the byte sequence of the character to be printed to a driving interface of the printer for printing if the character to be printed is not a uncommon word.
In some embodiments, the print information further includes a stream of control instruction bytes; the apparatus further comprises:
The preprocessing unit is configured to preprocess the rarely used character lattice data based on a control instruction corresponding to the control instruction byte stream if the character to be printed is the rarely used character, so as to obtain target lattice data;
the first printing unit is specifically configured to:
and after the target dot matrix data are assembled according to a bitmap printing mode instruction format of the printer with preset configuration parameters, the target dot matrix data are sent to a first driving interface of the printer for printing.
In some embodiments, the apparatus further comprises:
And the replacing unit is configured to replace the control instruction with a printer control instruction and send the printer control instruction to the printer if the character to be printed is a non-uncommon word.
According to another aspect of the embodiments of the present invention, there is also provided a nonvolatile storage medium including a stored program, wherein the program when executed controls a device in which the nonvolatile storage medium is located to execute a printing method.
According to another aspect of the embodiment of the present invention, there is also provided a printing apparatus, including a processor and a memory, wherein the memory stores computer readable instructions, and the processor is configured to execute the computer readable instructions, and the computer readable instructions execute a printing method when executed.
According to data statistics, more than 6000 ten thousand people with rarely used words are in the billions of people in China at present. The printing scenario of these citizens when transacting related business in each industry is also a text instruction printing mode using a pin printer. The hard word stock of the pin-in-memory printers can support few rare words beyond GBK, so that the unsupported rare words cannot be printed. And the hard word stock of the upgrade printer is often not feasible under the influence of support of printer manufacturers, upgrade cost and the like. The printing driving method disclosed by the application can better solve the problem, and the application program is changed slightly, so that the overall cost is lower.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate embodiments of the application and together with the description serve to explain the application. In the drawings:
FIG. 1 is a schematic diagram of a 24×24 lattice for printing Chinese characters "o";
FIG. 2 is a 3-byte map of the print pin versus input data for a 24 pin drawing of the pin printer;
FIG. 3 is a flow chart of a method of profile reading provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a soft word stock file format according to an embodiment of the present application;
FIG. 5 is a flow chart of a printing method provided in accordance with an embodiment of the present disclosure;
FIG. 6 is a block diagram of a printing device according to an embodiment of the present disclosure; and
Fig. 7 is a block diagram of a printing apparatus judging unit provided according to an embodiment of the present application.
Detailed Description
It should be noted that, without conflict, the embodiments of the present application and features of the embodiments may be combined with each other. The application will be described in detail below with reference to the drawings in connection with embodiments.
In order that those skilled in the art will better understand the present application, a technical solution in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present application without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and the claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate in order to describe the embodiments of the application herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus. The embodiment provided by the application is applied to the needle printer. The common needle printer has 24 needles, 9 needles and other types, and when printing 24×24 dot matrix Chinese characters or graphics, the 24 needle printer can print at one time, and the 9 needle printer needs to print 3 times from top to bottom. Chinese character printing generally requires 16×16 or higher dot patterns, and finer dot patterns are used if 24×24 or 48×48 dot patterns are used; the characters such as English letters and numbers are clear even if 8×8 dot matrix is used for printing, if the Chinese characters adopt 16×16 dot matrix, half-angle characters such as English letters and numbers generally adopt 8×16 dot matrix (8 dots wide and 16 dots high), and if the Chinese characters adopt 24×24 dot matrix, half-angle characters such as English letters and numbers generally adopt 12×24 dot matrix, namely the printing width of half-angle characters is equal to half of full-angle characters such as Chinese characters. Some pin printers support copy paper printing, and users can select multiple paper according to requirements, and common multiple paper comprises 2-link, 3-link and 4-link paper, wherein 6-link printer paper is also used. The one-time printing of the multi-paper can be finished only by a needle printer, and the multi-paper printing can not be realized by an inkjet printer and a laser printer.
The common print mode for pin printers is the text instruction print mode, which is currently used by most application developers. The precondition for printing using this mode is that printers capable of receiving text instruction print modes need to have hard word stock support. After receiving the text instruction, the printer queries the hard word stock through the internal codes of the characters (such as ASCII codes of the characters, GBK or GB18030 codes of the Chinese characters, BIG5 codes and the like) to obtain the dot matrix sequence of the characters or the Chinese characters, and finally sends the dot matrix sequence to the printing head to finish printing. Fig. 1 is a schematic diagram of a 24×24 dot matrix for printing chinese characters, "o", which is not a rare word, and only an example of a printing process is illustrated.
In this embodiment, each dot of the dot matrix is used as a bit of a byte when stored, and a value of 1 or 0 represents a filling dot or a blank in the dot matrix, respectively. Since a 24-pin needle printer head has 24 pins arranged from top to bottom, the 24 x 24 dot matrix word stock is stored in a column scan. That is, 72 bytes are in a sorted order from top to bottom and then left to right:
For the o word, the 72 byte dot matrix word library data for printing is:
0x00,0x00,0x00,
0x00,0x00,0x00,
0x3F,0xFF,0xE0,
0x10,0x02,0x00,
0x10,0x02,0x00,
0x3F,0xFF,0x80,
0x10,0x00,0x00,
0x00,0x00,0x00,
0x7F,0xFF,0xFF,
0x3F,0xFF,0xFE,
0x20,0xC0,0x80,
0x3F,0x31,0xC0,
0x78,0x1F,0x80,
0x20,0x00,0x00,
0x11,0xFF,0x80,
0x10,0x82,0x00,
0x10,0x82,0x08,
0x11,0xFF,0x08,
0x10,0x80,0x0C,
0x10,0x00,0x0E,
0x1F,0xFF,0xFC,
0x3F,0xFF,0xF8,
0x30,0x00,0x00,
0x00,0x00,0x00,
If a rarely used word is to be printed, the rarely used word can be printed on a pin printer supporting a bitmap printing mode by providing the rarely used word with similar 24×24 dot matrix data.
Fig. 2 is a 3-byte correspondence map of a print pin and input data when the 24 pins of the pin printer are plotted. The printer draws with all 24 pins, which are divided into 3 groups, controlled by 3 8-bit bytes of data, to form a line of up to 24 vertical dots. And the position of each printing needle has a corresponding value. Based on this correspondence, it can be determined which of the several pins the printer fires. For printers supporting EPSONESC/P instructions (some passbook printer instructions are similar), the ESC is required to send the corresponding value to control the corresponding pin strike. If several pins are used at the same time, the corresponding values of the arrays are added and the sum is sent to the printer. The following is a detailed description of specific examples.
If a test is to be printed on a GBK enabled pin printer", Where word 3 is a rarely used word (Unicode code 2cc56, gb18030 code 9933C 336), is shown here in a picture, since most people's PCs may not have a library of display words for that word, which cannot be displayed (high version android and apple phones can display). The GB18030 code sequences of the 3 Chinese characters are 'B2, E2, CA, D4,99,33, C3, 36' (16 system, 0x of C/Java language is omitted, comma is a separator convenient to read, and the following is the same).
For the present print drive interface, if it is a C function: pinPrint (unsignedchar str)
The first 2 bytes scanned into the reference are 'B2 and E2', which belong to 'test' words of GBK, are supported by a general printer, and the 2 bytes are directly sent to the printer;
Continuing to scan the 2 bytes behind the entry as CA and D4, and supporting the test word belonging to GBK by a general printer, and directly transmitting the 2 bytes to the printer;
The 4 bytes after the input parameters are scanned again to be '99, 33, C3 and 36', and the 4 bytes Chinese characters (CJK unified Chinese character expansion E) belonging to GB18030 are not supported by a common printer, so that the lattice data needs to be read from a soft word stock. And then assembling data according to the bitmap printing mode instruction format of the printer:
The instructions for the printer supporting EPSONESC/P instructions (some passbook printer instructions are similar) image print mode are: ESC m n n 2d 1 d2
Wherein ESC is Escape character (0 x 1B), ASCII code of "+" is 0x2A, m represents image density, 24-pin mode is CRT triple density when vertical dot density is 180 dot/inch, horizontal dot density is 180 dot/inch, and m value is 39 (0 x 27)
The total number of columns n=n1+n2 of the graph is 256, which in turn calculates N1 and N2 (MOD below is the remainder, and int is the rounding):
n1=N MOD 256
n2=int(N/256)
The "d 1d 2..di" after the instruction indicates the input image data, n1, n2 determine how many image data to be sent out, and for a 24×24 dot matrix, 3 bytes of data need to be sent out for each column, so 3 times the number of columns is the number of required image data bytes: 24×3=72, n=24, so n1=24 (0×18), n2=0.
The print instruction data of the final assembly is (16 system, 0x of C/Java language is omitted, comma is a convenient-to-read separator):
1b,2a,27, 18, 00, (72 byte dot matrix library data for printing)
The printing effect of the printer is as follows:
Testing
The printing method provided by the present disclosure may include two parts, namely, profile reading and printing.
Fig. 3 is a flowchart of a method for reading a configuration file according to an embodiment of the present disclosure, where the method for reading a configuration file shown in fig. 3 includes:
Step S01: opening a specified configuration file when the printing drive is initialized;
The configuration file includes at least the following printing parameters:
Printer model, connection port (COM 1, LPT1, etc.), bitmap print mode instruction, supported character set, supported encoding range (allowing multiple segments), multiple width/multiple height/multiple width and multiple height control instruction defined by the driver and corresponding printer control instruction, lattice soft word stock file name, missing word substitution symbol, etc.
By way of example, model A printers support the GBK character set, and the bitmap print instructions for model A printers are: "ESC x other parameters". The B model printer supports GB18030-2000 character set, and the bitmap printing instruction of the B model printer is as follows: "ESC P other parameters". The bitmap printing instruction of the model C printer is as follows: "ESCQ other parameters". Wherein ESC is Escape character (0 x 1B).
Corresponding parameters of the printer can be configured for different types of printers in the configuration file, and the embodiment provided by the disclosure can be suitable for printers of various types. Configuration files illustrate examples (chinese is used below to aid understanding, actual applications will typically use keywords consisting of english words or word abbreviations):
[ A-type Printer ]
Bitmap print instruction=esc other parameters
Character set = GBK
Parameter name 1 = parameter value 1
Parameter name 2 = parameter value 2
Parameter name 3 = parameter value 3
[ Type B Printer ]
Bitmap print instruction=esc P other parameters
Character set=gb 18030
Parameter name 1 = parameter value 12
Parameter name 2 = parameter value 22
Parameter name 3 = parameter value 32
[ Type C Printer ]
Bitmap print instruction=esc Q other parameters
Character set=gb 18030
Parameter name 1 = parameter value 13
Parameter name 2 = parameter value 23
Parameter name 3 = parameter value 33
Step S02: reading printing parameters from the configuration file;
alternatively, because a row in the configuration file is configured with one parameter, by cycling through the reads, reading one row at a time, processing one row, and then returning to the beginning of the cycle, reading the next row until the end of the file.
If the printing parameters in the embodiment are legal, the corresponding parameter values are stored in the memory, and errors are reported when the error parameter values are encountered.
Optionally, the one or more parameters are configured as legal parameter ranges.
For example, if a certain line of the profile is "gender=man", the corresponding parameter name is "gender", and the corresponding legal parameter value is "man". The legal parameter range corresponding to the parameter name of sex is male or female, so that some wrong options can be automatically screened.
For example, sex, two values are generally set, namely "male" and "female". If individual values are written, such as "male", they are considered illegal.
Step S03: and opening the dot matrix soft word stock file so that the interface can read at any time.
The definition of the soft word library is similar to the file in the computer, and can be updated at any time. The definition of the hard word library is generally an IC chip integrated in the printer, and things in the printer cannot be modified, added and deleted after leaving the factory.
The present disclosure also refers to soft word stock in addition to hard word stock mentioned in the background. Wherein, the hard word stock records some Chinese characters meeting the national mandatory standard, but not necessarily contains all the words. For example, the Chinese character part recorded in GB18030-2000 belongs to the mandatory part of the national standard, so that a plurality of needle printers support GB18030-2000 at most, and the newly added rarely used words of GB18030-2005 are not in a hard word stock, so that printing cannot be performed.
The soft word stock referred to in this disclosure includes various rarely used words, for example, the soft word stock is a soft word stock provided by a word stock manufacturer of a human mouth information system, such as "FZSong-rkxx.ttf" is a square Song Ti-population information word stock. The character library records more than 3 ten thousand Chinese characters and covers all place name, surname and person name characters which are arranged in each place.
For another example, google issued a free large word stock of the Song body of the source in 2017, and each of 7 kinds of thickness types has 65535 fonts, which have seven kinds of thickness weights in total, and has been designed with 458745 Chinese characters in total. That is, each word weight includes 65535 glyphs. The soft word stock mentioned in the invention can also be a Song style big word stock.
As another example, the soft word stock may be custom implemented, where the soft word stock only contains rarely used words that are not contained in the hard word stock. The text in the soft word stock may be increased.
Many soft word library files are in a custom format, and of course are also disclosed, such as the ttf file under the fonts directory under Windows.
Fig. 4 is a schematic diagram of a file format of a soft word stock, where the file header is an index table, and it can be found which words the soft word stock contains, and the file body is lattice information of each word, according to an embodiment of the present application, as in the file format shown in fig. 4.
Fig. 5 is a flowchart of a printing method provided according to an embodiment of the present disclosure, the printing method shown in fig. 5 including:
step S10: acquiring information to be printed, wherein the information to be printed comprises characters to be printed;
in some embodiments, the character to be printed may be sent through an interface by a scanning application of the printer.
Optionally, the information to be printed further comprises a control instruction byte stream.
Step S11: judging whether the character to be printed is a rarely used character or not;
in some embodiments, step S11 may further include:
Step S111, determining a byte sequence corresponding to a character to be printed;
Alternatively, a byte sequence refers to a complete byte sequence.
Step S112, judging whether the byte sequence is in a coding range supported by the printer configuration parameters;
That is, it is determined whether the character is contained in the hard word stock of the printer.
And step 113, if not, judging that the character to be printed is an uncommon word.
And if the character to be printed is a non-uncommon word in the coding range supported by the printer configuration parameters.
Step S12: if the character to be printed is the uncommon character, searching the uncommon character lattice data corresponding to the character to be printed in a preset lattice soft character library;
if the corresponding rarely used word lattice data cannot be found, the missing word substitution symbol of the configuration parameters is used for substitution.
Step S13: and assembling the rarely used word lattice data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, and then sending the rarely used word lattice data to a driving interface of the printer for printing.
And if the character to be printed is a non-uncommon word, replacing the control instruction with a printer control instruction and sending the printer control instruction to the printer. That is, if the control instruction defined by the driver is encountered in the byte stream, for the characters supported by the hard word stock, replacing the characters with the corresponding printer control instruction, and sending the printer control instruction to the printer; for the rare word, the dot matrix data acquired in the step S12 is subjected to related processing, and if the dot matrix data is doubled in the lateral direction by the double-width instruction.
For the uncommon word, the uncommon word lattice data obtained in step S12 or the uncommon word lattice data processed in step S13 is assembled according to a printer bitmap printing mode instruction format of configuration parameters and then sent to a connection port (COM 1, LPT1, etc.) of the printer.
In this embodiment, the print driver interface provides implementation in a common language, such as C, java, provides a call function library in C language (i.e., LIB/. DLL/. A/. So, etc.), java class methods (i.e., providing a. Jar package), and the application calls by interface name.
If the print portion of the application is a Java jar package and lacks source code (e.g., provided by a third party), decompiling the print jar package and modifying the jar package to regenerate a new jar package is risky, the method can be implemented by using Java agent technology to modify the byte code only in the memory when loading the byte code.
Fig. 6 is a block diagram of a printing apparatus according to an embodiment of the present disclosure, the printing apparatus including:
an acquisition unit 61 configured to acquire information to be printed including characters to be printed;
a judging unit 62 configured to judge whether or not the character to be printed is an uncommon word;
A searching unit 63 configured to search, if the character to be printed is a rare word, the rare word lattice data corresponding to the character to be printed in a preset lattice soft word library;
The first printing unit 64 is configured to assemble the rare word lattice data according to a bitmap printing mode instruction format of the printer with preset configuration parameters, and send the assembled rare word lattice data to a first driving interface of the printer for printing.
Fig. 7 is a block diagram of a printing apparatus judging unit provided in an embodiment of the present disclosure, and as shown in fig. 7, the judging unit 62 includes:
A determining subunit 621 configured to determine a byte sequence corresponding to a character to be printed;
A judging subunit 622 configured to judge whether the byte sequence is within the encoding range supported by the printer configuration parameters;
a determining subunit 623 configured to determine if the character to be printed is an uncommon word if not.
In some embodiments, the apparatus further comprises:
and the second printing unit is configured to send the byte sequence of the character to be printed to a driving interface of the printer for printing if the character to be printed is not a uncommon word.
In some embodiments, the print information further includes a stream of control instruction bytes; the apparatus further comprises:
The preprocessing unit is configured to preprocess the rarely used character lattice data based on a control instruction corresponding to the control instruction byte stream if the character to be printed is the rarely used character, so as to obtain target lattice data;
the first printing unit 64 is specifically configured to:
and after the target dot matrix data are assembled according to a bitmap printing mode instruction format of the printer with preset configuration parameters, the target dot matrix data are sent to a first driving interface of the printer for printing.
In some embodiments, the apparatus further comprises:
And the replacing unit is configured to replace the control instruction with a printer control instruction and send the printer control instruction to the printer if the character to be printed is a non-uncommon word.
The present disclosure also provides a printing apparatus including a processor and a memory, the above-described acquisition unit 61, determination unit 62, search unit 63, first printing unit 64, and the like being stored as program units in the memory, the above-described program units stored in the memory being executed by the processor to realize the corresponding functions.
The memory may include volatile memory, random Access Memory (RAM), and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), among other forms in computer readable media, the memory including at least one memory chip.
The embodiment of the application also provides a nonvolatile storage medium, which comprises a stored program, wherein the program controls equipment where the nonvolatile storage medium is located to execute a printing method when running.
The embodiment of the application also provides an electronic device, which comprises a processor and a memory; the memory has stored therein computer readable instructions for execution by the processor, wherein the computer readable instructions when executed perform a printing method. The electronic device herein may be a server, a PC, a PAD, a mobile phone, etc.
The embodiment of the disclosure aims to solve the problem that when printing of rarely used words is involved, a hard word library of a current needle printer does not contain the rarely used words, and an application program uses a text instruction printing mode, so that printing cannot be performed. If the needle printer supports the bitmap printing mode (the common passbook printers of banks are basically supported), the driver can use an external word library to send the dot matrix sequence of the uncommon words to the printer for printing. The invention realizes that the character stream data is directly sent to the printer through the application program instead of the drive interface of the invention, has smaller change and does not need to be called in a Windows GDI mode. In addition, the configuration file is adapted, so that the method is not limited to be used under Windows, can be used under Linux or other operating systems, and does not need the cost of hardware upgrade or new purchase.
For characters supported by a hard word stock of a printer only transmit codes of the characters, the characters (uncommon words) not contained in the hard word stock only transmit soft word stock dot matrix data of the characters to print according to the graph, and for a scene with a small number of uncommon words, the hybrid printing mode of the hard word stock and the soft word stock is faster than the pure graph mode printing speed driven by Windows. The configuration file may be used to eliminate instruction and support character set differences for printers of different vendors.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application 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 foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and variations of the present application will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, etc. which come within the spirit and principles of the application are to be included in the scope of the claims of the present application.
Claims (7)
1. A method of printing, the method comprising:
obtaining information to be printed, wherein the information to be printed comprises characters to be printed, and the printing information also comprises a control instruction byte stream;
judging whether the character to be printed is an uncommon word or not;
The judging whether the character to be printed is the rarely used character comprises the following steps: determining a byte sequence corresponding to the character to be printed;
Judging whether the byte sequence is in a coding range supported by printer configuration parameters;
If not, judging that the character to be printed is an uncommon word;
If the character to be printed is a rare word, searching rare word lattice data corresponding to the character to be printed in a preset lattice soft word library, and preprocessing the rare word lattice data based on a control instruction corresponding to the control instruction byte stream to obtain target lattice data;
The method comprises the steps of assembling the rarely used word lattice data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, sending the rarely used word lattice data to a first driving interface of the printer for printing, and further comprising the step of assembling the target lattice data according to the bitmap printing mode instruction format of the printer with preset configuration parameters, and sending the target lattice data to the first driving interface of the printer for printing.
2. The printing method of claim 1 wherein the method further comprises:
And if the character to be printed is not the uncommon word, sending the byte sequence of the character to be printed to a driving interface of the printer for printing.
3. The method according to claim 1, wherein the method further comprises:
And if the character to be printed is a non-uncommon word, replacing the control instruction with a printer control instruction and sending the printer control instruction to the printer.
4. A printing apparatus, the apparatus comprising:
an acquisition unit configured to acquire information to be printed, the information to be printed including characters to be printed, the print information further including a control instruction byte stream;
The judging unit is configured to judge whether the character to be printed is an uncommon word or not; the judging unit also comprises a determining subunit, a judging subunit and a judging subunit,
Wherein the determining subunit is configured to determine a byte sequence corresponding to the character to be printed;
The judging subunit is configured to judge whether the byte sequence is in a coding range supported by the printer configuration parameters;
the judging subunit is configured to judge that the character to be printed is an uncommon word if not;
The searching unit is configured to search for the uncommon word lattice data corresponding to the character to be printed in a preset lattice soft word library if the character to be printed is the uncommon word, and pre-process the uncommon word lattice data based on the control instruction corresponding to the control instruction byte stream to obtain target lattice data;
The first printing unit is configured to assemble the rarely used word lattice data according to a bitmap printing mode instruction format of a printer with preset configuration parameters and then send the rarely used word lattice data to a first driving interface of the printer for printing, and further comprises assembling the target lattice data according to the bitmap printing mode instruction format of the printer with preset configuration parameters and then send the target lattice data to the first driving interface of the printer for printing.
5. The printing apparatus of claim 4, wherein said apparatus further comprises:
And the second printing unit is configured to send the byte sequence of the character to be printed to a driving interface of the printer for printing if the character to be printed is not a uncommon word.
6. A non-volatile storage medium, characterized in that the non-volatile storage medium comprises a stored program, wherein the program, when run, controls a device in which the non-volatile storage medium is located to perform the printing method of any one of claims 1 to 3.
7. A printing apparatus comprising a processor and a memory, the memory having stored therein computer readable instructions for executing the computer readable instructions, wherein the computer readable instructions when executed perform the printing method of any of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011295281.XA CN112486428B (en) | 2020-11-18 | 2020-11-18 | Printing method, device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011295281.XA CN112486428B (en) | 2020-11-18 | 2020-11-18 | Printing method, device and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112486428A CN112486428A (en) | 2021-03-12 |
CN112486428B true CN112486428B (en) | 2024-08-02 |
Family
ID=74931414
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011295281.XA Active CN112486428B (en) | 2020-11-18 | 2020-11-18 | Printing method, device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112486428B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN113536734B (en) * | 2021-07-06 | 2023-03-24 | 上海浩霖汇信息科技有限公司 | Rarely-used word standardization processing method and system and related products |
CN118927797B (en) * | 2024-07-22 | 2025-08-08 | 广州市科帕电子科技有限公司 | Editable inkjet coding system and inkjet coding method |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101602290A (en) * | 2008-06-13 | 2009-12-16 | 江门市得实计算机外部设备有限公司 | The impact printer of Datemark printing and this method of use |
CN107145244A (en) * | 2017-04-26 | 2017-09-08 | 北京汉王数字科技有限公司 | A kind of special-shaped characters input method, device and electronic equipment |
Family Cites Families (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
IT1159596B (en) * | 1983-08-29 | 1987-03-04 | Olivetti & Co Spa | DATA PROCESSING EQUIPMENT HAVING A CONTROLLER FOR AT LEAST ONE OUTPUT PERIPHERAL |
CN85107210B (en) * | 1985-09-28 | 1988-03-30 | 株式会社东芝 | Dot matrix printer with word memory device |
JPH05162389A (en) * | 1991-12-18 | 1993-06-29 | Tokyo Electric Co Ltd | Dot matrix impact printer |
CN1287337A (en) * | 2000-08-08 | 2001-03-14 | 北京中铁时代科技有限责任公司 | Ticket making card used specially in railway department |
CN111444680B (en) * | 2020-04-25 | 2023-05-16 | 中信银行股份有限公司 | Encoding expansion method and device for rarely used words, storage medium and electronic equipment |
CN111930322B (en) * | 2020-06-30 | 2022-08-26 | 厦门汉印电子技术有限公司 | Printing method, device, equipment and computer readable storage medium |
-
2020
- 2020-11-18 CN CN202011295281.XA patent/CN112486428B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101602290A (en) * | 2008-06-13 | 2009-12-16 | 江门市得实计算机外部设备有限公司 | The impact printer of Datemark printing and this method of use |
CN107145244A (en) * | 2017-04-26 | 2017-09-08 | 北京汉王数字科技有限公司 | A kind of special-shaped characters input method, device and electronic equipment |
Also Published As
Publication number | Publication date |
---|---|
CN112486428A (en) | 2021-03-12 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6204782B1 (en) | Unicode conversion into multiple encodings | |
CN112486428B (en) | Printing method, device and storage medium | |
AU2016277770B2 (en) | Use of bloom filters to simplify dynamic font augmentation and subsetting | |
CN108319578B (en) | Method for generating medium for data recording | |
US20090136123A1 (en) | Program pattern analyzing apparatus, pattern appearance status information production method, pattern information generating apparatus, and program | |
US7664805B2 (en) | System and method for modifying output of a computer program without source code modifications | |
US7257701B2 (en) | Method and system for configuring an operating system in a computer system | |
CN115660012A (en) | Label generating and printing method and device and storage medium | |
KR20230086802A (en) | Serialization method, reverse realization method, information processing program, information processing device and communication system | |
US20050200913A1 (en) | Systems and methods for identifying complex text in a presentation data stream | |
US20100147960A1 (en) | Methods, devices, and systems for printing bar codes | |
CN113326087B (en) | Chinese character library processing method and device on LVGL | |
US20090171959A1 (en) | Apparatus and method for performing table comparisons | |
CN115712601A (en) | Method for reading fixed-length files in batch based on springbatch | |
CN115687839A (en) | Page code conversion method and device, computer equipment and readable storage medium | |
CN100485692C (en) | XML data storage system and method thereof | |
US20060026518A1 (en) | Apparatus and method for processing text data according to script attribute | |
CN114265638A (en) | Communication method, device, equipment and storage medium based on plug-in compatibility | |
CN111078337A (en) | Pattern adjusting method, system and computer readable storage medium | |
CN111273913A (en) | Method and device for outputting application program interface data represented by specifications | |
Hagen et al. | The luamplib package | |
CN112529643B (en) | Electronic invoice processing method and device, storage medium and electronic equipment | |
US8055083B2 (en) | Portable bitmap rendering systems and methods | |
CN112347219B (en) | Vector map material library generation method, vector map generation system and electronic equipment | |
CN116301802A (en) | BI system-based method and device for customizing components |
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 |