CN109062521B - Print data processing method and device, computer device and storage medium - Google Patents

Print data processing method and device, computer device and storage medium Download PDF

Info

Publication number
CN109062521B
CN109062521B CN201810802447.9A CN201810802447A CN109062521B CN 109062521 B CN109062521 B CN 109062521B CN 201810802447 A CN201810802447 A CN 201810802447A CN 109062521 B CN109062521 B CN 109062521B
Authority
CN
China
Prior art keywords
vector
character
dot matrix
data
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201810802447.9A
Other languages
Chinese (zh)
Other versions
CN109062521A (en
Inventor
李菁
侯济发
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuhai Baiyin Automation Equipment Co ltd
Original Assignee
Zhuhai Smarnet Equipment Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuhai Smarnet Equipment Co ltd filed Critical Zhuhai Smarnet Equipment Co ltd
Priority to CN201810802447.9A priority Critical patent/CN109062521B/en
Publication of CN109062521A publication Critical patent/CN109062521A/en
Application granted granted Critical
Publication of CN109062521B publication Critical patent/CN109062521B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/12Digital output to print unit, e.g. line printer, chain printer
    • G06F3/1201Dedicated interfaces to print systems
    • G06F3/1202Dedicated interfaces to print systems specifically adapted to achieve a particular effect
    • G06F3/1203Improving or facilitating administration, e.g. print management
    • G06F3/1208Improving or facilitating administration, e.g. print management resulting in improved quality of the output result, e.g. print layout, colours, workflows, print preview
    • 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

Abstract

The invention provides a printing data processing method and device, a computer device and a storage medium, wherein the method comprises the following steps: acquiring vector printing data; respectively carrying out dot matrix conversion on vector pictures and vector characters in the vector printing data to obtain dot matrix printing data; and sending the dot matrix printing data to a printer. Respectively carrying out dot matrix conversion on a vector picture and a vector character in the vector printing data, and the dot matrix conversion comprises the following steps: acquiring a character outline corresponding to the vector character; scaling the character outline by a preset size to obtain the coordinates of the character outline with pixels as a unit; performing rasterization processing on the character outline according to the coordinates; and generating dot matrix characters corresponding to the vector characters. The device provides an execution module for the method. The computer device has a processor, and the processor can realize the print data processing method when executing the program. The storage medium stores a computer program for implementing the above-described print data processing method. The invention can improve the quality of the vector data printed by the dot matrix printer.

Description

Print data processing method and device, computer device and storage medium
Technical Field
The invention relates to the field of print data processing, in particular to a print data processing method and a print data processing device applying the method. It also relates to a computer device for implementing the above method and to a storage medium capable of implementing the above method.
Background
When the dot matrix printer prints, the print data of the upper computer is usually required to be acquired, and the print data sent to the dot matrix printer by the upper computer includes the vector print data, so that the vector print data is required to be converted into the dot matrix print data for printing. Traditional editing software prints through a printer driver, edited vector printing data containing pictures and characters can be combined and converted into dot matrix printing data to be printed by a dot matrix printer conveniently, however, the effect of the characters and pictures printed in the mode is serious in distortion, and the printing effect is influenced.
Disclosure of Invention
The invention aims to provide a printing data processing method for improving the quality of printing vector data of a dot matrix printer.
It is a second object of the present invention to provide a print data processing apparatus for improving the quality of print vector data of a dot matrix printer.
It is a third object of the present invention to provide a computer apparatus for improving the quality of print vector data for a dot matrix printer.
It is a fourth object of the present invention to provide a storage medium for improving the quality of print vector data for a dot-matrix printer.
In order to achieve the first object, the present invention provides a print data processing method comprising: acquiring vector printing data; respectively carrying out dot matrix conversion on vector pictures and vector characters in the vector printing data to obtain dot matrix printing data; and sending the dot matrix printing data to a printer. Respectively carrying out dot matrix conversion on vector pictures and vector characters in the vector printing data, wherein the dot matrix conversion comprises the following steps: acquiring a character outline corresponding to the vector character; zooming the character outline by a preset size to obtain the coordinates of the character outline by taking pixels as units; performing rasterization processing on the character outline according to the coordinates; and generating dot matrix characters corresponding to the vector characters.
According to the scheme, before vector data is printed, the vector data is converted into dot matrix data, so that the data to be printed conforms to the printing parameter setting of the dot matrix printer, and the printing quality of the dot matrix printer for printing the vector data is improved. In addition, the printing data comprises picture data and/or character data, and different conversion modes are adopted for different types of data through respectively converting dot matrixes of vector pictures and vector characters, so that the vector characters and the vector pictures printed by the dot matrix printer are clearer and have better quality. In addition, when the dot matrix conversion of the vector character is carried out, firstly, the character outline corresponding to the character in the vector character is obtained, the character outline of the character is subjected to scaling processing, the coordinate after the scaling processing is obtained, and the character outline corresponding to the character is subjected to rasterization processing after the coordinate information is obtained, so that the dot matrix character corresponding to the vector character is generated. By carrying out scaling processing on the character outline of the character, the coordinate data required by the character during printing can be obtained, and the size of the character is more in line with the printing requirement. In addition, the character outline of the character is subjected to rasterization processing, so that the high-resolution vector data is converted into the low-resolution dot matrix data, and the vector data is more in line with the printing parameters of the dot matrix printer.
In a further scheme, the rasterizing processing is carried out on the character outline according to the coordinates, and the method comprises the following steps: acquiring intersection point coordinates of the character outline and a grid with pixels as units; and carrying out pixel filling on the character outline according to a preset rule to obtain the rasterized character.
Therefore, when the character outline is rasterized, firstly, the coordinates of the intersection points of the character outline and the grids taking the pixel as the unit are determined, so that the distribution condition of the character outline in the grids taking the pixel as the unit is judged, the area of each pixel grid falling into the character outline is determined, the character outline can be subjected to pixel filling by using a preset rule, and the rasterized character is obtained.
In a further aspect, the performing dot matrix conversion on the vector image and the vector character in the vector print data includes: carrying out graying processing on the vector picture to obtain a grayed picture; carrying out binarization processing on the grayed picture to obtain a binarized picture; carrying out Gaussian filtering on the binary image; and converting the filtered binary picture into a dot matrix picture.
Therefore, when the vector picture is subjected to dot matrix conversion, the vector picture is converted into a gray picture, binarization processing is performed on the gray picture, the vector picture can be conveniently converted into the dot matrix picture, the binary picture is smoother in the course of filtering the binary picture, the distortion degree is reduced, and the quality of converting the vector picture into the dot matrix picture can be improved.
In order to achieve the second object, the present invention provides a print data processing apparatus comprising: the data acquisition module is used for acquiring vector printing data; the data conversion module is used for respectively carrying out dot matrix conversion on the vector pictures and the vector characters in the vector printing data to obtain dot matrix printing data; and the data sending module is used for sending the dot matrix printing data to the printer. The data conversion module respectively carries out dot matrix conversion on the vector picture and the vector character in the vector printing data, and the data conversion module comprises the following steps: acquiring a character outline corresponding to the vector character; scaling the character outline by a preset size to obtain the coordinates of the character outline with pixels as a unit; performing rasterization processing on the character outline according to the coordinates; and generating dot matrix characters corresponding to the vector characters.
According to the scheme, the printing data processing device converts the vector data into the dot matrix data before printing the vector data, so that the data to be printed conforms to the printing parameter setting of the dot matrix printer, and the printing quality of the dot matrix printer for printing the vector data is improved. In addition, the printing data comprises picture data and/or character data, and different conversion modes are adopted for different types of data through respectively converting dot matrixes of vector pictures and vector characters, so that the vector characters and the vector pictures printed by the dot matrix printer are clearer and have better quality.
In order to achieve the third object, the present invention provides a computer device comprising a processor for implementing the steps of the above-mentioned print data processing method when executing a computer program stored in a memory.
In order to achieve the fourth object, the present invention provides a storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the above-described print data processing method.
Drawings
FIG. 1 is a flow chart of an embodiment of a print data processing method of the present invention.
Fig. 2 is a diagram showing an effect of rasterizing a character outline in the embodiment of the print data processing method of the present invention.
Fig. 3 is a block diagram of the configuration of an embodiment of the print data processing apparatus of the present invention.
The invention is further explained with reference to the drawings and the embodiments.
Detailed Description
The printing data processing method is applied to intelligent terminal equipment capable of carrying out data transmission with a dot matrix printer, and preferably, the intelligent terminal equipment comprises intelligent terminal equipment such as a desktop computer, a notebook computer, a tablet computer and a mobile phone. The printing data processing method can convert the vector data into dot matrix data and send the dot matrix data to the dot matrix printer for printing. The printing data processing device is applied to intelligent terminal equipment capable of carrying out data transmission with a dot matrix printer, and is used for realizing the printing data processing method. The present invention also provides a computer device, which includes a processor, and the processor can execute the instructions of the application program, so as to implement the steps of the above-mentioned print data processing method. The storage medium provided by the present invention stores a computer program, and the computer program realizes the steps of the above-described print data processing method when executed by a processor.
Print data processing method embodiment:
as shown in fig. 1, when the print data processing method of the present invention performs the print data processing, step S1 is first executed to acquire vector print data. The vector print data is acquired when the vector print data is processed. The acquired vector print data may be acquired by means of data import or by means of editing. For example, the printing data of characters or pictures to be printed is imported by clicking a virtual key for importing the printing of the printing data on an editing interface of software, so that vector printing data is obtained; or editing characters and pictures on an editing interface of the software to obtain vector printing data after the editing is finished.
After the vector print data is acquired, step S2 is executed to perform dot matrix conversion on the vector image and the vector character in the vector print data, respectively, and dot matrix print data is obtained. In order to enable the vector data to have better printing effect in the dot matrix printer, before printing, the vector printing data needs to be converted into dot matrix data, so that the data to be printed is more in line with the parameter setting of the dot matrix printer. The vector print data includes a vector picture and/or vector characters, so that when dot matrix conversion is performed, dot matrix conversion needs to be performed on the vector picture and the vector characters respectively.
The step of respectively performing dot matrix conversion on the vector picture and the vector character in the vector print data comprises the following steps: carrying out graying processing on the vector picture to obtain a grayed picture; carrying out binarization processing on the grayed picture to obtain a binarized picture; performing Gaussian filtering on the binary image; and converting the filtered binary picture into a dot matrix picture.
When the step of performing graying processing on the vector picture is executed, graying processing is performed by using an algorithm for converting color image RGB pixels into gray, wherein the algorithm for converting color image RGB pixels into gray is common knowledge of those skilled in the art, and is not described herein again. After the grayed picture is obtained, binarization processing is performed on the grayed picture, and during binarization processing, the binarization processing can be performed by using a currently known binarization algorithm, which is not described herein any more.
And after obtaining the binary image, performing Gaussian filtering on the binary image. In this embodiment, a two-dimensional gaussian function known to those skilled in the art is used for gaussian filtering, where the two-dimensional gaussian function is:
Figure BDA0001737434610000051
where x and y are pixel coordinates and σ is the standard deviation of the gaussian distribution. When Gaussian filtering is carried out, the standard deviation of Gaussian distribution can be set, so that a weight matrix is constructed by using a Gaussian function, the gray values of all pixel points in the binarized picture are calculated by using the weight matrix, and the filtered binarized picture is obtained.
For example, setting σ equal to 1, calculating a weight value of each pixel point through a gaussian function and performing weighted average, and obtaining a weight matrix with a filter radius of 1 as follows:
0.07511361 0.12384140 0.07511361
0.12384140 0.20417996 0.12384140
0.07511361 0.12384140 0.07511361
suppose the gray value of each pixel point is as follows:
11 12 13
35 36 37
18 19 20
multiplying the gray value of each pixel point by the corresponding weight value in the weight matrix to obtain the gray value of Gaussian filtering of the central pixel point:
0.82624969 1.486096838 0.976476903
4.33444911 7.350478401 4.582131917
1.35204494 2.35298666 1.502272159
repeating the steps for all the pixel points to obtain the image after Gaussian filtering.
In addition, the step of performing dot matrix conversion on the vector picture and the vector character in the vector print data respectively further includes: acquiring a character outline corresponding to the vector character; scaling the character outline by a preset size to obtain a coordinate taking a pixel as a unit; performing rasterization processing on the character outline according to the coordinates; and generating dot matrix characters corresponding to the vector characters.
The acquired vector print data includes vector characters, and therefore, when dot matrix conversion of the vector characters is performed, character outlines corresponding to the vector characters are acquired first. The font of each vector font is described by a mathematical curve, which contains key points on the boundary of the font, derivative information of a connecting line and the like, and the character outline corresponding to the vector character can be obtained by obtaining the mathematical vectors.
In this embodiment, a character outline corresponding to a vector character is obtained through a getglyphronoune function. Taking the TrueType vector text as an example, the TrueType file structure has the following common information:
head font header global information of font
cmap Mapping character codes to primitive, mapping character codes to primitive indices
glyf Primitive data primitive profile definition and grid adjustment instructions
maxp Maximum requirement table, summary data of memory allocation required in font
loca Position table index converting element index into position of element
name Name list of copyright description, font name, font family name, style name, etc
hhea Horizontal layout information
hmtx Level metric information
post PostScript FontInfo directory entry and PostScript name for all primitives
OS/2 OS/2 and Windows specific Specifications
When the contour information is obtained, the encoding mode of the vector character (for example, the encoding mode of the national standard GB 18030) needs to be determined, and the encoded value corresponding to the vector character is obtained according to the encoding mode. And finally, acquiring the initial position, the contour information and the like of the character contour through a GetGlyphOutline function according to the index number, so as to acquire the contour information corresponding to the vector character. The method for obtaining the character outline by using the GetGlyphOutline function is well known in the art and will not be described herein.
After the character outline corresponding to the vector character is obtained, the character outline is zoomed according to the preset size, and the coordinate of the character outline with the pixel as the unit is obtained. The preset size may be set according to the resolution of the printer and the size of the characters to be printed. For example, if the printer resolution is 180dpi and the size to be printed is 14.5 lbs., the character outline of the character is scaled to a character outline of 14.5 lbs font, and the scaled character outline is placed in a grid of 180 pixels per inch, thereby obtaining the coordinates of the pixels occupied by the character outline.
And after the coordinates of the character outline in pixel units are obtained, rasterization processing is carried out on the character outline according to the coordinates. The step of rasterizing the character outline according to the coordinates comprises the following steps: acquiring intersection point coordinates of the character outline and a grid with pixels as units; and carrying out pixel filling on the character outline according to a preset rule to obtain the rasterized character. The acquired contour information includes contour point coordinates and information such as a bezier line and a straight line segment for describing the contour. When rasterization processing is performed, a character outline is placed in a grid with pixels as units, and the character outline and the grid have intersection points, so that intersection point coordinates are obtained. And after the intersection point coordinates are obtained, pixel filling is carried out on the character outline according to a preset rule, and then the rasterized character can be obtained. In this embodiment, referring to fig. 2, the character outline of the character "edge" is placed in a grid using pixels as a unit, and when the area of a certain pixel point falling in the character outline is larger than half of the area of the pixel point, the pixel point is filled with black.
And performing rasterization processing on the character outline to obtain rasterized characters, and then generating dot matrix characters corresponding to the vector characters. When the rasterized character outline is subjected to dot matrix conversion, the raster with the character outline placed and taking pixels as units is scanned, when the scanned pixel points are filling pixel points, the scanned pixel points are expressed as '1', and when the scanned pixel points are not filling pixel points, the scanned pixel points are expressed as '0', so that dot matrix data of the character are obtained.
After the dot matrix print data is obtained, step S3 is executed to send a status confirmation command to the printer to confirm that the printer is in a normal operating state. In an optional scheme, before the status confirmation instruction is sent to the printer, whether the connection with the port of the dot matrix printer is successful is judged. Whether the dot matrix printer is successfully connected or not can be judged by sending a detection signal to the printer end and judging whether a response signal is received or not. And when the connection is successful, sending a status inquiry command to the printer, acquiring the current running status of the printer, and confirming that the printer works normally. The printer status query is well known to those skilled in the art and will not be described herein.
After confirming that the printer is operating normally, step S4 is executed to send dot-matrix print data to the printer. The dot matrix printer can print the printing data after receiving the printing data.
It should be noted that step S3 may be executed before step S1, and the dot matrix conversion process is performed on the vector print data after it is confirmed that the printer can operate normally. For example, after the editing interface clicks a printed virtual key, a state confirmation instruction is sent to the dot matrix printer, after the printer is confirmed to be in a normal working state, dot matrix conversion is carried out on the obtained vector printing data, and the dot matrix printing data is sent to the printer for printing after being converted.
Print data processing apparatus embodiment:
as shown in fig. 3, the print data processing apparatus of the present invention includes a data acquisition module 1, a data conversion module 2, a status confirmation module 3, and a data transmission module 4.
The data acquisition module 1 is used to acquire vector print data. The vector print data is acquired when the vector print data is processed. The data acquisition module 1 may acquire the vector print data by data import or by editing. For example, the printing data of characters or pictures to be printed is imported by clicking a virtual key for importing the printing of the printing data on an editing interface of software, so that vector printing data is obtained; or editing characters and pictures on an editing interface of the software to obtain vector printing data after the editing is finished.
The data conversion module 2 is configured to perform dot matrix conversion on the vector image and the vector character in the vector print data, respectively, to obtain dot matrix print data. In order to enable the vector data to have a better printing effect in the dot matrix printer, before printing, the data conversion module 2 needs to convert the vector printing data into dot matrix data, so that the data to be printed is more in line with the parameter setting of the dot matrix printer. Vector print data includes a vector picture and/or vector characters, so that when dot matrix conversion is performed, dot matrix conversion needs to be performed on the vector picture and the vector characters respectively.
The data conversion module 2 respectively performs dot matrix conversion on the vector image and the vector character in the vector printing data, and the steps include: carrying out graying processing on the vector picture to obtain a grayed picture; carrying out binarization processing on the grayed picture to obtain a binarized picture; performing Gaussian filtering on the binary image; and converting the filtered binary picture into a dot matrix picture.
When the data conversion module 2 executes the step of performing the graying processing on the vector picture, the graying processing is performed by using the color image RGB pixel to grayscale algorithm, wherein the color image RGB pixel to grayscale algorithm is common knowledge of those skilled in the art and is not described herein again. After the grayed picture is obtained, the data conversion module 2 performs binarization processing on the grayed picture, and during the binarization processing, the binarization processing can be performed by using a known binarization algorithm, which is not described herein again.
After the binarized picture is obtained, the data conversion module 2 performs gaussian filtering on the binarized picture. In this embodiment, a two-dimensional gaussian function known to those skilled in the art is used for gaussian filtering, where the two-dimensional gaussian function is:
Figure BDA0001737434610000081
where x and y are pixel coordinates and σ is the standard deviation of the gaussian distribution. When Gaussian filtering is carried out, the standard deviation of Gaussian distribution can be set, so that a weight matrix is constructed by using a Gaussian function, the gray values of all pixel points in the binarized picture are calculated by using the weight matrix, and the filtered binarized picture is obtained.
In addition, the step of the data conversion module 2 performing dot matrix conversion on the vector image and the vector character in the vector print data respectively further includes: acquiring a character outline corresponding to the vector character; scaling the character outline by a preset size to obtain a coordinate taking a pixel as a unit; performing rasterization processing on the character outline according to the coordinates; and generating dot matrix characters corresponding to the vector characters.
The acquired vector print data includes vector characters, and therefore, when performing dot matrix conversion of the vector characters, the data conversion module 2 first acquires character outlines corresponding to the vector characters. The font of each vector font is described by a mathematical curve, which contains key points on the boundary of the font, derivative information of a connecting line and the like, and the character outline corresponding to the vector character can be obtained by obtaining the mathematical vectors. In this embodiment, obtaining a character outline corresponding to a vector character through a getglyxoline function, and obtaining a character outline by using a getglyxoline function is a technique well known to those skilled in the art and will not be described herein again.
After the data conversion module 2 obtains the character outline corresponding to the vector character, the character outline is zoomed according to the preset size, and the coordinate of the character outline with the pixel as the unit is obtained. The preset size may be set according to the resolution of the printer and the size of the characters to be printed. For example, if the printer resolution is 180dpi and the size to be printed is 14.5 lbs., the character outline of the character is scaled to a character outline of 14.5 lbs font, and the scaled character outline is placed in a grid of 180 pixels per inch, thereby obtaining the coordinates of the pixel points occupied by the character outline.
The data conversion module 2 obtains the coordinates of the character outline in pixel units, and then performs rasterization processing on the character outline according to the coordinates. The step of rasterizing the character outline by the data conversion module 2 according to the coordinates comprises: acquiring intersection point coordinates of the character outline and a grid with pixels as units; and carrying out pixel filling on the character outline according to a preset rule to obtain the rasterized character. The acquired contour information includes contour point coordinates and information such as a bezier line and a straight line segment for describing the contour. When the data conversion module 2 performs rasterization processing, the character outline is placed in a grid with pixels as units, and the character outline and the grid have intersection points to acquire intersection point coordinates. After the intersection point coordinates are obtained, pixel filling is carried out on the character outline according to a preset rule, and the data conversion module 2 can obtain the rasterized character outline. In this embodiment, referring to fig. 2, the character outline of the character "edge" is placed in a grid using pixels as a unit, and when the area of a certain pixel point falling in the character outline is larger than half of the area of the pixel point, the pixel point is filled with black.
And the data conversion module 2 generates lattice characters corresponding to the vector characters after rasterizing the character outlines. When the rasterized character outline is subjected to dot matrix conversion, the raster with the character outline placed and taking pixels as units is scanned, when the scanned pixel points are filling pixel points, the scanned pixel points are expressed as '1', and when the scanned pixel points are not filling pixel points, the scanned pixel points are expressed as '0', so that dot matrix data of the character are obtained.
The status confirmation module 3 is used for sending a status confirmation instruction to the printer to confirm that the printer is in a normal working state. In an optional scheme, before the status confirmation module 3 sends the status confirmation instruction to the printer, it is determined whether the connection with the port of the dot matrix printer is successful. The status confirmation module 3 can determine whether the connection with the dot matrix printer is successful by sending a detection signal to the printer end and by receiving a response signal. When the connection is successful, the status confirmation module 3 sends a status inquiry command to the printer, acquires the current running status of the printer, and confirms that the printer works normally. The printer status query is well known to those skilled in the art and will not be described herein.
The data sending module 4 is used for sending the dot matrix printing data to the printer. The dot matrix printer can print the printing data after receiving the printing data.
The embodiment of the computer device comprises:
the computer device of the embodiment comprises: a processor, a memory, and a computer program, such as a query and interaction program, stored in the memory and executable on the processor. The steps in the above-described print data processing method embodiments are implemented when the processor executes the computer program. Alternatively, the processor realizes the functions of the respective modules in the above-described print data processing apparatus embodiment when executing the computer program.
For example, a computer program can be partitioned into one or more modules, which are stored in a memory and executed by a processor to implement the present invention. One or more of the modules may be a sequence of computer program instruction segments for describing the execution of a computer program in a computer device that is capable of performing certain functions.
For example, the computer device may be a computing device such as a mobile phone, a desktop computer, a notebook computer, and a palm computer. The computer device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that the computer apparatus may include more or fewer components, or combine certain components, or different components, e.g., the computer apparatus may also include input-output devices, network access devices, buses, etc.
For example, the Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, and so on. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The processor is the control center of the computer device and is connected to various parts of the whole computer device by various interfaces and lines.
The memory may be used to store computer programs and/or modules, and the processor may implement various functions of the computer device by executing or executing the computer programs and/or modules stored in the memory, as well as by invoking data stored in the memory. For example, the memory may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function (e.g., a sound receiving function, a sound-to-text function, etc.), and the like; the storage data area may store data (e.g., audio data, text data, etc.) created according to the use of the cellular phone, etc. In addition, the memory may include high speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), at least one magnetic disk storage device, a Flash memory device, or other volatile solid state storage device.
Storage medium embodiments:
the modules integrated by the computer device of the above embodiments, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow in the above-mentioned embodiment of the print data processing method may also be implemented by a computer program instructing related hardware to complete, where the computer program may be stored in a computer-readable storage medium, and when the computer program is executed by a processor, the steps in the above-mentioned embodiment of the print data processing method may be implemented. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The storage medium may include: any entity or device capable of carrying computer program code, recording medium, U.S. disk, removable hard disk, magnetic disk, optical disk, computer Memory, Read-Only Memory (ROM), Random Access Memory (RAM), electrical carrier wave signals, telecommunications signals, software distribution media, and the like. It should be noted that the computer readable medium may contain other components which may be suitably increased or decreased as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, in accordance with legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunications signals.
Therefore, before vector data is printed, the vector data is converted into dot matrix data, and the data to be printed conforms to the printing parameter setting of the dot matrix printer, so that the printing quality of the dot matrix printer for printing the vector data is improved. In addition, the printing data comprises picture data and/or character data, and different conversion modes are adopted for different types of data through respectively converting dot matrixes of vector pictures and vector characters, so that the vector characters and the vector pictures printed by the dot matrix printer are clearer and have better quality. In addition, when the dot matrix conversion of the vector character is carried out, firstly, the character outline corresponding to the character in the vector character is obtained, the character outline of the character is subjected to scaling processing, the coordinate after the scaling processing is obtained, and the character outline corresponding to the character is subjected to rasterization processing after the coordinate information is obtained, so that the dot matrix character corresponding to the vector character is generated. By carrying out scaling processing on the character outline of the character, the coordinate data required by the character during printing can be obtained, and the size of the character is more in line with the printing requirement. In addition, the character outline of the character is subjected to rasterization processing, so that the high-resolution vector data is converted into the low-resolution dot matrix data, and the vector data is more in line with the printing parameters of the dot matrix printer.
It should be noted that the above is only a preferred embodiment of the present invention, but the design concept of the present invention is not limited thereto, and any insubstantial modifications made by using the design concept also fall within the protection scope of the present invention.

Claims (8)

1. A print data processing method, comprising: acquiring vector printing data; respectively carrying out dot matrix conversion on the vector picture and the vector character in the vector printing data to obtain dot matrix printing data; sending the dot matrix printing data to a printer; the method is characterized in that:
the dot matrix conversion of the vector image and the vector character in the vector printing data comprises:
carrying out graying processing on the vector picture to obtain a grayed picture;
carrying out binarization processing on the grayed picture to obtain a binarized picture;
performing Gaussian filtering on the binary image;
converting the filtered binary picture into a dot matrix picture;
acquiring a character outline corresponding to the vector character;
zooming the character outline by a preset size to obtain the coordinates of the character outline with pixels as a unit;
performing rasterization processing on the character outline according to the coordinates;
and generating the lattice character corresponding to the vector character.
2. The print data processing method according to claim 1, characterized in that:
the rasterization processing of the character outline according to the coordinates comprises the following steps:
acquiring the intersection point coordinates of the character outline and a grid with pixels as units;
and carrying out pixel filling on the character outline according to a preset rule to obtain a rasterized character.
3. The print data processing method according to claim 1 or 2, characterized in that:
prior to the sending the dot matrix print data to the printer, the method further comprises:
and sending a state confirmation instruction to the printer to confirm that the printer is in a normal working state.
4. A print data processing apparatus comprising: the data acquisition module is used for acquiring vector printing data; the data conversion module is used for respectively carrying out dot matrix conversion on the vector pictures and the vector characters in the vector printing data to obtain dot matrix printing data; the data sending module is used for sending the dot matrix printing data to a printer; the method is characterized in that:
the data conversion module respectively performs lattice conversion on the vector image and the vector character in the vector printing data, and the lattice conversion comprises the following steps:
carrying out graying processing on the vector picture to obtain a grayed picture;
carrying out binarization processing on the grayed picture to obtain a binarized picture;
performing Gaussian filtering on the binary image;
converting the filtered binary picture into a dot matrix picture;
acquiring a character outline corresponding to the vector character;
zooming the character outline by a preset size to obtain the coordinates of the character outline with pixels as a unit;
performing rasterization processing on the character outline according to the coordinates;
and generating the lattice character corresponding to the vector character.
5. The print data processing apparatus according to claim 4, wherein:
the data conversion module performs rasterization processing on the character outline according to the coordinates, and the rasterization processing comprises the following steps:
acquiring the intersection point coordinates of the character outline and a grid with pixels as units;
and filling pixels in the character outline according to a preset rule to obtain a rasterized character.
6. The print data processing apparatus according to claim 4 or 5, wherein:
the device further comprises:
and the state confirmation module is used for sending a state confirmation instruction to the printer before sending the dot matrix printing data to the printer to confirm that the printer is in a normal working state.
7. A computer device, characterized by: the computer arrangement comprises a processor for implementing the steps of the print data processing method according to any one of claims 1 to 3 when executing the computer program stored in the memory.
8. A storage medium having a computer program stored thereon, characterized in that: the computer program, when executed by a processor, implements the steps of the print data processing method of any of claims 1 to 3.
CN201810802447.9A 2018-07-20 2018-07-20 Print data processing method and device, computer device and storage medium Active CN109062521B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810802447.9A CN109062521B (en) 2018-07-20 2018-07-20 Print data processing method and device, computer device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810802447.9A CN109062521B (en) 2018-07-20 2018-07-20 Print data processing method and device, computer device and storage medium

Publications (2)

Publication Number Publication Date
CN109062521A CN109062521A (en) 2018-12-21
CN109062521B true CN109062521B (en) 2022-05-27

Family

ID=64817587

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810802447.9A Active CN109062521B (en) 2018-07-20 2018-07-20 Print data processing method and device, computer device and storage medium

Country Status (1)

Country Link
CN (1) CN109062521B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901803B (en) * 2019-03-12 2022-09-09 南京沁恒微电子股份有限公司 Additional printing processing method for micro printer and computer readable storage medium
CN111752491A (en) * 2019-03-26 2020-10-09 上海宝信软件股份有限公司 Multifunctional dot matrix mark application system and method
CN110134347B (en) * 2019-04-30 2022-08-16 深圳市雄帝科技股份有限公司 Image processing method, image processing device, computer equipment and storage medium
CN110784773A (en) * 2019-11-26 2020-02-11 北京奇艺世纪科技有限公司 Bullet screen generation method and device, electronic equipment and storage medium
CN111080664B (en) * 2019-12-30 2022-03-08 合肥联宝信息技术有限公司 Data processing method and device, computer storage medium and computer
CN113442598B (en) * 2020-03-27 2023-01-24 湖南鼎一致远科技发展有限公司 Thermal transfer printer
CN111813350B (en) * 2020-05-29 2022-12-13 厦门汉印电子技术有限公司 Method, device and equipment for sending print data and storage medium
CN113268207A (en) * 2021-05-12 2021-08-17 武汉先同科技有限公司 Printing control method and system based on image processing technology
CN113362427B (en) * 2021-06-29 2024-03-15 深圳市创想三维科技股份有限公司 Contour generation method, device, computer equipment and medium for hypotenuse three-dimensional word
CN113806278A (en) * 2021-09-13 2021-12-17 珠海趣印科技有限公司 Word stock chip processing method capable of arbitrarily changing vector word stock and word stock chip

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6327950A (en) * 1986-07-22 1988-02-05 Toshiba Corp Display control system
CN1169561A (en) * 1996-04-22 1998-01-07 惠普公司 Method and apparatus for adaptive adjustment of cache altocation for storage of font data by super-high-speed buffer registor
CN101145243A (en) * 2006-09-15 2008-03-19 精工爱普生株式会社 Method and apparatus for preserving font structure
CN102476507A (en) * 2010-11-23 2012-05-30 天津中兴软件有限责任公司 Printing method of thermal printer
CN103177709A (en) * 2011-12-20 2013-06-26 北大方正集团有限公司 Method and device for displaying characters
CN103631545A (en) * 2013-11-26 2014-03-12 深圳市科曼医疗设备有限公司 Printing method and system
CN106274088A (en) * 2016-08-16 2017-01-04 江苏科技大学 Thermal-sensitive printer printing velocity optimization method based on timeslice segmentation
CN106313907A (en) * 2016-08-16 2017-01-11 江苏科技大学 Thermal printer text printing method and thermal printer text printing system based on image conversion

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS6327950A (en) * 1986-07-22 1988-02-05 Toshiba Corp Display control system
CN1169561A (en) * 1996-04-22 1998-01-07 惠普公司 Method and apparatus for adaptive adjustment of cache altocation for storage of font data by super-high-speed buffer registor
CN101145243A (en) * 2006-09-15 2008-03-19 精工爱普生株式会社 Method and apparatus for preserving font structure
CN102476507A (en) * 2010-11-23 2012-05-30 天津中兴软件有限责任公司 Printing method of thermal printer
CN103177709A (en) * 2011-12-20 2013-06-26 北大方正集团有限公司 Method and device for displaying characters
CN103631545A (en) * 2013-11-26 2014-03-12 深圳市科曼医疗设备有限公司 Printing method and system
CN106274088A (en) * 2016-08-16 2017-01-04 江苏科技大学 Thermal-sensitive printer printing velocity optimization method based on timeslice segmentation
CN106313907A (en) * 2016-08-16 2017-01-11 江苏科技大学 Thermal printer text printing method and thermal printer text printing system based on image conversion

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Chinese TrueType Font Support in X Window;叶以民;《Journal of Computer Science and Technology》;19991231;全文 *
基于打印指令的检测数据快速解析与输出系统研究与实现;李大森;《中国优秀硕士学位论文全文数据库 信息科技辑》;20090715;全文 *

Also Published As

Publication number Publication date
CN109062521A (en) 2018-12-21

Similar Documents

Publication Publication Date Title
CN109062521B (en) Print data processing method and device, computer device and storage medium
US6757431B2 (en) Resolution conversion for anti-aliased images using loose gray scale template matching
CN108875855A (en) Print method, apparatus, equipment and the storage medium of polar plot
JP3142550B2 (en) Graphic processing unit
JP2004152267A (en) Apparatus for printing, method thereof, image processing method and apparatus therefor
CN102024250B (en) Image processing apparatus and control method
WO2018135295A1 (en) Print control device, page data correction method, and raster data generating method
JPH07322074A (en) Equipment and method for data processing to process 2 level image file that a dither ring happened
CN108269233B (en) Text dithering method based on shading halftone
EP1328112A2 (en) Fast text/graphics resolution improvement with chain-code table look-up
EP0616463B1 (en) Apparatus for smoothed scaling of facsimile images
CN115620321A (en) Table identification method and device, electronic equipment and storage medium
JPH05120441A (en) Vector picture plotting device
JP2000500705A (en) Alignment of machine readable codes to printer pixels
JP4259949B2 (en) Image creating apparatus, image creating program, and recording medium
JP3952188B2 (en) Image interpolation apparatus, image interpolation method, and image interpolation program
US9424499B2 (en) Method for printing a grayscale raster image by grayscale value dispersion
US9363414B2 (en) Halftone mechanism
CN109671040B (en) Print picture data processing method, computer device, and computer-readable storage medium
EP2629236B1 (en) Rasterization method and device
CN112419146A (en) Image processing method and device and terminal equipment
JP4259950B2 (en) Image recognition apparatus, image recognition program, and recording medium
CN112733567B (en) Method and device for identifying two-dimension code of motor vehicle and computer readable storage medium
JP2002290763A (en) Image processing method and image processing device
US10839562B2 (en) Methods and systems for enabling object attribute driven super resolution encoding

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
TR01 Transfer of patent right

Effective date of registration: 20240204

Address after: 519000 Zone G, second floor, No. 1 plant, No. 15, Nanping Pingbei Second Road, Xiangzhou District, Zhuhai City, Guangdong Province

Patentee after: Zhuhai Baiyin automation equipment Co.,Ltd.

Country or region after: China

Address before: 519000 C area B District, 5 A, 168 building, 168 Road, Yi Sha Road, Ping Sha town, Zhuhai, Guangdong.

Patentee before: ZHUHAI SMARNET EQUIPMENT CO.,LTD.

Country or region before: China

TR01 Transfer of patent right