CN112486428A - Printing method, printing device and storage medium - Google Patents

Printing method, printing device and storage medium Download PDF

Info

Publication number
CN112486428A
CN112486428A CN202011295281.XA CN202011295281A CN112486428A CN 112486428 A CN112486428 A CN 112486428A CN 202011295281 A CN202011295281 A CN 202011295281A CN 112486428 A CN112486428 A CN 112486428A
Authority
CN
China
Prior art keywords
printed
character
printing
printer
dot matrix
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011295281.XA
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.)
China Citic Bank Corp Ltd
Original Assignee
China Citic Bank Corp 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 China Citic Bank Corp Ltd filed Critical China Citic Bank Corp Ltd
Priority to CN202011295281.XA priority Critical patent/CN112486428A/en
Publication of CN112486428A publication Critical patent/CN112486428A/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/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/1253Configuration of print job parameters, e.g. using UI at the client
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1223Dedicated interfaces to print systems specifically adapted to use a particular technique
    • G06F3/1275Print workflow management, e.g. defining or changing a workflow, cross publishing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/126Character encoding

Abstract

The application discloses a printing method, a printing device and a storage medium. The method comprises the following steps: acquiring 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 rarely-used word dot matrix data corresponding to the characters to be printed in a preset dot matrix soft word library. And after the rarely-used word dot matrix data are assembled according to a bitmap printing mode instruction format of a printer with preset configuration parameters, the rarely-used word dot matrix data are sent to a first driving interface of the printer to be printed. The embodiment provided by the application solves the problem that in the related technology, if rarely-used words exist, direct printing can not be performed in a text instruction printing mode.

Description

Printing method, printing device and storage medium
Technical Field
The present application relates to the field of printing technologies, and in particular, to a printing method, an apparatus, and a storage medium.
Background
The stylus printer is a special printer, such as a bankbook printer, a high-speed line printer and the like, and has great difference with an ink-jet printer and a laser printer, and the difference of the stylus printer cannot be replaced by other types of printers, so that the stylus printer has unique market share and serves special industry users.
For stylus printers, there may be some uncommon words. Rarely used words as referred to in this application refer to chinese characters that are not contained in the hard word stock of the printer. For example, if some printers only support the GBK character set, the hard word stock of words other than GBK 21003 chinese characters is not included, and direct printing in the text instruction printing mode is not possible. If some printers support the kanji recorded in GB18030-2000, the kanji added in GB18030-2005 or the kanji recorded in the international/domestic standards such as Unicode thereafter cannot be printed. In the prior art, if the rarely-used word is to be printed, the hard word stock needs to be upgraded by a printer manufacturer, or only a new printer supporting the rarely-used word can be purchased, which requires hardware updating or purchasing cost. Upgrading the hard word stock is also limited by the number of printer word stock IC slots, the size of the supported capacity, etc.
Disclosure of Invention
The application provides a printing method, a printing device and a nonvolatile storage medium, which are used for solving the problem that in the related technology, if a rarely-used word exists, direct printing cannot be performed in a text instruction printing mode.
According to an aspect of the present application, there is provided a printing method including:
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 uncommon word;
if the character to be printed is a rarely-used character, searching rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft character library;
assembling the rarely-used word dot matrix data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, and sending the rarely-used word dot matrix data to a first driving interface of the printer for printing.
In some embodiments, determining whether the character to be printed is a uncommon word comprises:
determining a byte sequence corresponding to a character to be printed;
judging whether the byte sequence is in the coding range supported by the printer configuration parameters;
if not, the character to be printed is judged to be uncommon word.
In some embodiments, the method further comprises:
and if the character to be printed is not a rare word, sending the byte sequence of the character to be printed to a drive interface of the printer for printing.
In some embodiments, the print information further comprises a stream of control instruction bytes; the method further comprises the following steps:
if the character to be printed is a rarely-used word, preprocessing the rarely-used word dot matrix data based on a control instruction corresponding to the control instruction byte stream to obtain target dot matrix data;
after assembling rarely-used word dot matrix data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, sending the rarely-used word dot matrix data to a first driving interface of the printer for printing, wherein the first driving interface 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:
and if the character to be printed is a non-uncommon character, replacing the control instruction with a printer control instruction and sending the printer control instruction to the printer.
According to another aspect of the embodiments of the present invention, there is also provided a printing apparatus including:
an acquisition unit configured to acquire information to be printed, the information to be printed including characters to be printed;
a judging unit configured to judge whether the character to be printed is a uncommon word;
the searching unit is configured to search the rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft character library if the character to be printed is the rarely-used character;
the first printing unit is configured to assemble the rarely-used word dot matrix data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, and then send the rarely-used word dot matrix data to a first driving interface of the printer for printing.
In some embodiments, the determining unit comprises:
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 an encoding range supported by the printer configuration parameter;
a determination subunit configured to determine that the character to be printed is a 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 rare word.
In some embodiments, the print information further comprises a stream of control instruction bytes; the device also includes:
the preprocessing unit is configured to preprocess the uncommon word dot matrix data based on a control instruction corresponding to the control instruction byte stream to obtain target dot matrix data if the character to be printed is the uncommon word;
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 controls an apparatus in which the nonvolatile storage medium is located to execute a printing method when running.
According to another aspect of the embodiments of the present invention, there is also provided a printing apparatus, including a processor and a memory, the memory storing computer readable instructions, the processor being configured to execute the computer readable instructions, wherein the computer readable instructions are configured to execute a printing method when executed.
According to data statistics, at present, in billions of people in China, more than 6000 million people with rarely-used words exist in the name. The printing scenes of the citizens when handling related services in various industries are the text instruction printing mode of the stylus printer. The hard word stock of the stock stylus printer can support rarely used words except for GBK, so that the unused words cannot be printed. And upgrading the hard word stock of the printer is often not feasible due to the support of printer manufacturers, upgrading cost and the like. The printing driving method disclosed by the application can be used for better solving the problem, the change of the application program is smaller, and the overall cost is lower.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a schematic diagram of a 24 × 24 dot matrix for printing Chinese characters "o";
FIG. 2 is a 3-byte mapping chart of the printing needle and the input data when the stylus printer 24 draws a needle;
FIG. 3 is a flowchart of a configuration file reading method according to an embodiment of the disclosure;
FIG. 4 is a diagram illustrating a file format of a soft word stock according to an embodiment of the present application;
FIG. 5 is a flow chart of a printing method provided according to an embodiment of the disclosure;
FIG. 6 is a block diagram of a printing apparatus according to an embodiment of the disclosure; and
fig. 7 is a block diagram of a printing apparatus determination unit provided according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. 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 a stylus printer. The common needle printer printing head has 24 needles, 9 needles and other models, when printing Chinese characters or figures with 24 x 24 lattices, the 24 needle printer can finish printing once, and the 9 needle printer needs to print 3 times from top to bottom. The Chinese character printing generally needs a 16 × 16 or higher lattice, and is finer if a 24 × 24 or 48 × 48 lattice is used; characters such as english letters and numbers are also clear even if 8 × 8 dot matrix printing is used, half-corner characters such as english letters and numbers are generally 8 × 16 dot matrixes (8 dots wide and 16 dots high) when a chinese character is a 16 × 16 dot matrix, and half-corner characters such as english letters and numbers are generally 12 × 24 dot matrixes when a chinese character is a 24 × 24 dot matrix, that is, half-corner characters are printed with a width equal to half of a full-corner character such as a chinese character. Some stylus printers support carbon paper printing, and a user can select multi-copy paper according to requirements, wherein the common multi-copy paper comprises 2-link, 3-link and 4-link paper, and the common multi-copy paper also comprises 6-link printer paper. The multi-link paper can be printed at one time only by a stylus printer, and the ink-jet printer and the laser printer cannot realize multi-link paper printing.
A common printing mode for stylus printers is a text instruction printing mode, which is the mode currently used by most application developers. Printing using this mode presupposes that a printer capable of receiving the text command print mode requires hard word stock support. After receiving the text command, the printer queries the internal code of the character (such as ASCII code of the character, GBK or GB18030 code of Chinese character, BIG5 code, etc.) in the hard word stock to obtain the lattice sequence of the character or Chinese character, and finally sends the lattice sequence to the printing head to complete printing. Fig. 1 is a schematic diagram of a 24 × 24 dot matrix for printing a chinese character "o", where it should be noted that "o" does not belong to a uncommon word, and only an example of a printing process is illustrated.
In this embodiment, during storage, each dot of the dot matrix is used as a bit of one byte, and a value of 1 or 0 represents a filling point or a blank in the dot matrix. Since the 24-pin dot printer head has 24 pins, arranged from top to bottom, the 24 × 24 dot matrix word stock is stored by column scan. That is, 72 bytes are ordered first from top to bottom and then from left to right:
for the "o" word, the dot matrix font data of 72 bytes 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 the uncommon word needs to be printed, the uncommon word can be printed on a stylus printer supporting a bitmap printing mode by providing the uncommon word with data similar to the 24 × 24 dot matrix data.
Fig. 2 is a 3-byte correspondence diagram of a printing pin and input data when the stylus printer 24 performs drawing. The printer plots all 24 pins, divided into 3 groups, controlled by 3 data of 8 bytes to form a line of up to 24 vertical dots. And the position of each print pin has a corresponding value. Based on the correspondence, it is possible to determine which needle the printer fires. For printers that support the epsonsec/P command (some passbook printer commands are similar), the ESC command is required to send out the corresponding value to control the corresponding pin bump. If several needles are used simultaneously, the corresponding values of the arrays are added and the sum is sent to the printer. The following is a detailed description with reference to specific examples.
If the test is to be printed on a GBK-enabled stylus printer
Figure BDA0002785081910000061
", itThe middle 3 rd word is a rare word (Unicode code 2CC56, GB18030 code 9933C336), and is shown here in a pictorial representation because most people's PCs may not have a display font library for the word and cannot display it (high version android and iphone can display). The GB18030 code sequence of the 3 Chinese characters is 'B2, E2, CA, D4,99,33, C3, 36' (16-system, 0x of C/Java language is omitted, comma is a separator for easy reading, the same below).
For the present print driver interface, if the function C: pinprint (unsigned char str)
Scanning the first 2 bytes of the entry reference str to be 'B2, E2', belonging to the 'test' word of GBK, which is supported by a common printer, and directly sending the 2 bytes to the printer;
continuously scanning until 2 bytes behind the entry participant str are 'CA, D4', belonging to 'trial' words of GBK, which are supported by common printers, and directly sending the 2 bytes to the printers;
then, the scanning is continued until the 4 bytes behind the entry parameter str are '99, 33, C3, 36', and the 4-byte Chinese character (CJK Union Chinese character extension E) belonging to GB18030 is not supported by the common printer, so that the lattice data needs to be read from the soft character library. The data is then assembled according to the printer bitmap print mode instruction format:
for printers that support the EPSONESC/P commands (some passbook printer commands are similar) the commands for the image print mode are: ESC m n1 n2 d1 d2
Where ESC is Escape character (0x1B), "+" is ASCII coded 0x2A, m represents image density, 24 pin pattern with 180 dots/inch vertical dot density and 180 dots/inch horizontal dot density is three times as dense as CRT, m is 39(0x27)
The total number of columns N — N1+ N2 × 256 of the graph is calculated in reverse for N1 and N2 (MOD below is the remainder, int is the integer):
n1=N MOD 256
n2=int(N/256)
"d 1 d2.. di" after the command indicates the input image data, n1 and n2 determine how many image data are to be sent, and for a 24 × 24 dot matrix, 3 bytes of data need to be sent for each column, so that 3 times the number of columns is the number of bytes of image data required: 24 × 3-72 and N-24, so N1-24 (0x18) and N2-0.
The finally assembled printing instruction data is (16 system, 0x of C/Java language is omitted, comma is a separator for convenient reading):
1B, 2A, 27, 18, 00. (72 byte dot matrix word stock data for printing)
The printer has the following printing effects:
testing
Figure BDA0002785081910000071
The printing method provided by the present disclosure may include both profile reading and printing.
Fig. 3 is a flowchart of a configuration file reading method according to an embodiment of the present disclosure, where the configuration file reading method shown in fig. 3 includes:
step S01: opening a specified configuration file when the printing driver is initialized;
the configuration file includes at least the following printing parameters:
printer model, connection port (COM1, LPT1, etc.), bitmap print mode command, supported character set, supported encoding range (multiple segments are allowed), control command of multiple width/multiple height/multiple width and multiple height defined by the driver and corresponding printer control command, dot matrix soft library file name, missing word substitution symbol, etc.
For example, a model a printer supports the GBK character set, and the bitmap print instructions for the model a printer are: "ESC other parameters". The B model printer supports GB18030-2000 character set, and the bitmap printing instruction of the B model printer is as follows: "other parameters of ESC P". The bitmap print instructions for model C printers are: "other parameters of ESC Q". Where ESC is the Escape character (0x 1B).
The configuration file can configure corresponding parameters for printers of different models, and the embodiment provided by the disclosure can be suitable for printers of various models. Illustrative examples of profiles (Chinese is used below to aid understanding, and practical applications will typically use keywords consisting of English words or word abbreviations):
[ model A Printer ]
ESC other parameters
GBK (character set)
Parameter name 1 ═ parameter value 1
Parameter name 2 ═ parameter value 2
Parameter name 3 ═ parameter value 3
[ B model Printer ]
ESCP other parameters as bitmap print commands
Character set GB18030
Parameter name 1-parameter value 12
Parameter name 2 ═ parameter value 22
Parameter name 3 ═ parameter value 32
[ C model Printer ]
Bit map print command-ESCQ other parameters
Character set GB18030
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 parameter is configured for a row in the configuration file, the parameter is processed by reading one row at a time through loop reading, and then returning to the beginning of the loop and 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 if the wrong parameter values are encountered, an error is reported.
Optionally, one or more parameters are configured as legal parameter ranges.
For example, if a certain line of the profile is "gender ═ male", the corresponding parameter name is "gender", and the corresponding legal parameter value is "male". The parameter name is "sex", and the legal parameter range is "male" or "female", so that some wrong options can be automatically screened.
For example, gender, two values are generally set as "male" and "female". If an individual value, such as "public", is written, it is considered illegal.
Step S03: and opening the dot matrix soft font file so that the interface can read the files at any time.
The definition of the soft word stock is similar to the file in a computer and can be updated at any time. The definition of the hard word stock is generally an IC chip integrated in a printer, and the contents in the printer cannot be modified, added or deleted after being delivered from a factory.
This disclosure makes reference to soft word libraries in addition to the hard word libraries mentioned in the background. The hard word library includes some Chinese characters meeting the national mandatory standard, but does not necessarily include all the characters. For example, the Chinese character part recorded in GB18030-2000 belongs to the mandatory part of the national standard, so that most of the stylus printers are supported to GB18030-2000, and rarely-used characters newly added in GB18030-2005 are not in the hard word stock, thereby being incapable of being printed.
The soft word stock referred to in this disclosure includes various uncommon words, and is exemplified by a soft word stock provided by a word stock manufacturer of a population information system, such as a "fzsing-rkxx.ttf" square sons-population information word stock. The character library records more than 3 ten thousand Chinese characters, and covers all characters used by place names, surnames and personal names which are arranged in each region.
As another example, Google published a free large word stock of the original style of song in 2017, each of the 7 thick and thin types has 65535 characters, and the total number of the 7 thick and thin types is seven, so that 458745 Chinese characters are designed. That is, each word includes 65535 glyphs. The soft word stock can also be a Siyuan Song-style large word stock.
As another example, a soft word stock may also be implemented in a customized manner, and the soft word stock only contains uncommon words that are not contained in the hard word stock. The number of words in the soft word stock may be increasing.
Many soft word stock files are in custom formats, although open, 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, such as the file format shown in fig. 4, where a file header is an index table, which words are included in the soft word stock can be found, and a file body is lattice information of each word.
Fig. 5 is a flowchart of a printing method provided according to an embodiment of the present disclosure, where the printing method shown in fig. 5 includes:
step S10: acquiring information to be printed, wherein the information to be printed comprises characters to be printed;
in some embodiments, the characters to be printed may be sent through the scanning application of the printer via the interface.
Optionally, the information to be printed further includes a control instruction byte stream.
Step S11: judging whether the character to be printed is a uncommon word;
in some embodiments, step S11 may further include:
step S111, determining a byte sequence corresponding to the character to be printed;
alternatively, the byte sequence refers to a complete byte sequence.
Step S112, judging whether the byte sequence is in the 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 S113, if not, judging that the character to be printed is a uncommon word.
And if the character to be printed is in the encoding range supported by the printer configuration parameters, judging the character to be printed to be a non-uncommon character.
Step S12: if the character to be printed is a rarely-used character, searching rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft character library;
and if the corresponding rarely-used word lattice data cannot be found, replacing the rarely-used word lattice data with a character-missing replacing symbol of the configuration parameters.
Step S13: assembling the rarely-used word dot matrix data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, and sending the rarely-used word dot matrix data to a driving interface of the printer for printing.
And under the condition that the information to be printed also comprises a control instruction byte stream, 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, the characters supported by the hard word stock are replaced by the corresponding printer control instruction and sent to the printer; for uncommon words, the dot matrix data obtained in step S12 is correlated, and if the width command is used, the dot matrix data is enlarged by one time horizontally.
For uncommon words, the rarely used word dot matrix data obtained in step S12 or the rarely used word dot matrix data processed in step S13 are assembled in the format of the printer bitmap printing mode command of configuration parameters and then sent to the connection ports (COM1, LPT1, etc.) of the printer.
In this embodiment, the print driver interface provides an implementation of a common language such as C, Java, provides a library of calling functions (in the format of LIB/. DLL/. a/. so, etc.) and Java class methods (providing a jar package) in C language, and the application program calls by interface name.
If the printed part of the application program is Java, the jar package and the source code (provided by a third party for example) are decompiled, printed, modified and regenerated into a new jar package, and if the jar package is risky, the method can be realized by using Java agent technology to modify the byte code only in the memory when the byte code is loaded.
Fig. 6 is a structural diagram of a printing apparatus provided in an embodiment of the present disclosure, the printing apparatus including:
an acquisition unit 61 configured to acquire information to be printed, the information to be printed including characters to be printed;
a judging unit 62 configured to judge whether the character to be printed is a rare word;
the searching unit 63 is configured to search rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft word library if the character to be printed is rarely-used character;
and the first printing unit 64 is configured to assemble the rarely-used word dot matrix data according to a bitmap printing mode instruction format of the printer with preset configuration parameters, and then send the rarely-used word dot matrix data to a first driving interface of the printer for printing.
Fig. 7 is a structural diagram of a determination unit of a printing apparatus according to an embodiment of the disclosure, and as shown in fig. 7, the determination unit 62 includes:
a determination subunit 621 configured to determine a byte sequence corresponding to a character to be printed;
a determining subunit 622 configured to determine whether the byte sequence is in an encoding range supported by the printer configuration parameters;
a determination subunit 623 configured to, if not, determine that the character to be printed is a uncommon word.
In some embodiments, the apparatus further comprises:
and a second printing unit 65 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 rare word.
In some embodiments, the print information further comprises a stream of control instruction bytes; the device also includes:
the preprocessing unit 56 is configured to, if the character to be printed is a uncommon word, preprocess the uncommon word dot matrix data based on a control instruction corresponding to the control instruction byte stream to obtain target dot matrix 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 a replacing unit 67 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, which includes a processor and a memory, where the above-mentioned obtaining unit 61, the judging unit 62, the searching unit 63, the first printing unit 64, and the like are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to implement corresponding functions.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes 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 the 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, and the processor is configured to execute the computer readable instructions, 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 the current stylus printer hard word stock does not contain the rarely-used word when the rarely-used word is printed, and an application program uses a text instruction printing mode to cause printing failure. If the stylus printer supports a bitmap printing mode (the conventional bankbook printer of a bank basically supports), the driver of the invention can use an external word stock to send a dot matrix sequence of rarely-used words to the printer for printing. The invention realizes that the driver interface of the invention is called by directly sending character stream data to the printer through the application program, the change is small, and the calling according to the Windows GDI mode is not needed. In addition, the method and the system are not limited to be used under Windows by adapting the configuration file, can also be used under Linux or other operating systems, and do not need hardware upgrading or new purchase cost.
The characters supported by the hard word stock of the printer only send codes of the characters, the characters (rare words) not contained in the hard word stock only send dot matrix data of the soft word stock of the characters to be printed according to the graphs, and the mixed printing mode of the hard word stock and the soft word stock is much faster than the printing speed of the pure graph mode driven by Windows for scenes with few rare words. The configuration file can be used for printers of different manufacturers to eliminate the difference between the instruction and the support character set.
As will be appreciated by one skilled in the art, 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 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.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory. The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The 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 computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, 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 above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A method of printing, the 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 uncommon word;
if the character to be printed is a rarely-used character, searching rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft character library;
and after the rarely-used word dot matrix data are assembled according to a bitmap printing mode instruction format of a printer with preset configuration parameters, the rarely-used word dot matrix data are sent to a first driving interface of the printer to be printed.
2. The printing method of claim 1, wherein said determining whether the character to be printed is a uncommon word comprises:
determining a byte sequence corresponding to the character to be printed;
judging whether the byte sequence is in an encoding range supported by the printer configuration parameters;
if not, the character to be printed is judged to be uncommon words.
3. The printing method of claim 2, further comprising:
and if the character to be printed is not a rare word, sending the byte sequence of the character to be printed to a drive interface of a printer for printing.
4. The printing method according to claim 2, wherein the printing information further includes a control instruction byte stream; the method further comprises the following steps:
if the character to be printed is a rarely-used word, preprocessing the rarely-used word dot matrix data based on a control instruction corresponding to the control instruction byte stream to obtain target dot matrix data;
after the rarely-used word dot matrix data are assembled according to a bitmap printing mode instruction format of a printer with preset configuration parameters, a first driving interface which is sent to the printer for printing 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.
5. The method of claim 4, further comprising:
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.
6. A printing apparatus, characterized in that the apparatus comprises:
an acquisition unit configured to acquire information to be printed, the information to be printed including characters to be printed;
a judging unit configured to judge whether the character to be printed is a uncommon word;
the searching unit is configured to search rarely-used character dot matrix data corresponding to the character to be printed in a preset dot matrix soft word library if the character to be printed is rarely-used character;
and the first printing unit is configured to assemble the rarely-used word dot matrix data according to a bitmap printing mode instruction format of a printer with preset configuration parameters, and then send the rarely-used word dot matrix data to a first driving interface of the printer for printing.
7. The printing apparatus according to claim 6, wherein the determination unit includes:
a determining subunit configured to determine a byte sequence corresponding to the character to be printed;
a judging subunit configured to judge whether the byte sequence is in an encoding range supported by the printer configuration parameter;
a determination subunit configured to determine that the character to be printed is a uncommon word if not.
8. The printing apparatus of claim 7, wherein 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 a printer for printing if the character to be printed is not a uncommon word.
9. A non-volatile storage medium, comprising a stored program, wherein the program when executed controls a device in which the non-volatile storage medium is located to perform the printing method of any one of claims 1 to 5.
10. A printing apparatus comprising a processor and a memory, the memory having stored thereon computer readable instructions, the processor being configured to execute the computer readable instructions, wherein the computer readable instructions when executed perform the printing method of any one of claims 1 to 5.
CN202011295281.XA 2020-11-18 2020-11-18 Printing method, printing device and storage medium Pending CN112486428A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011295281.XA CN112486428A (en) 2020-11-18 2020-11-18 Printing method, printing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011295281.XA CN112486428A (en) 2020-11-18 2020-11-18 Printing method, printing device and storage medium

Publications (1)

Publication Number Publication Date
CN112486428A true CN112486428A (en) 2021-03-12

Family

ID=74931414

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011295281.XA Pending CN112486428A (en) 2020-11-18 2020-11-18 Printing method, printing device and storage medium

Country Status (1)

Country Link
CN (1) CN112486428A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536734A (en) * 2021-07-06 2021-10-22 上海浩霖汇信息科技有限公司 Rarely-used word standardization processing method and system and related products

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113536734A (en) * 2021-07-06 2021-10-22 上海浩霖汇信息科技有限公司 Rarely-used word standardization processing method and system and related products
CN113536734B (en) * 2021-07-06 2023-03-24 上海浩霖汇信息科技有限公司 Rarely-used word standardization processing method and system and related products

Similar Documents

Publication Publication Date Title
JPH04500876A (en) image generation software
CN108491199A (en) A kind of method and terminal automatically generating interface
US6776342B1 (en) Process for the parameterization of scanners for one-dimensional or two-dimensional printed codes
CN102081595A (en) Program generation device and program generation method
CN112486428A (en) Printing method, printing device and storage medium
US7664805B2 (en) System and method for modifying output of a computer program without source code modifications
CN115391439A (en) Document data export method, device, electronic equipment and storage medium
CN113918158A (en) Method, device and computer readable medium for automatic serialization of dictionary into service value
EP1566750B1 (en) Data processing unit and data processing program stored in computer readable medium
US20100147960A1 (en) Methods, devices, and systems for printing bar codes
CN102467490B (en) Font data processing method and device
CN114691712A (en) Method and device for generating bill and storage medium
CN100485692C (en) XML data storage system and method thereof
CN100390783C (en) Method and system for case conversion
CN114371762A (en) Method and device for printing customized label and storage medium
CN107209672B (en) Information processing apparatus and information processing method
CN112347219B (en) Vector map material library generation method, vector map generation system and electronic equipment
KR100236838B1 (en) Method for converting arc/info file to kxf data format
CN113326087B (en) Chinese character library processing method and device on LVGL
US8055083B2 (en) Portable bitmap rendering systems and methods
JP4338231B2 (en) External character management device and computer readable medium storing computer program for external character management
CN116301802A (en) BI system-based method and device for customizing components
CN113569836A (en) Drawing automatic identification system and method
CN116881399A (en) Data information processing method, device, electronic equipment and storage medium
US20200356631A1 (en) Semantic sequences for providing context to characters displayed via a terminal application

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