Abstract: Barcodes can be printed while suppressing a drop in process efficiency. When the string of the font data written on the same line in the image buffer B as barcode image data consists of space characters, the control unit 30 of a printer 11 deletes the font data, writes the barcode image data to the image buffer B, and causes a print unit 33 to print a barcode image based on the buffered barcode image data.
2 -
Printer and control method of a printer
BACKGROUND
1. Technical Field
[0001]
The present invention relates to a printer that can connect to a control device, and to a control method of the printer.
2. Related Art
[0002]
Barcode printing systems that print barcodes on recording media including sheet media are known from the literature. See, for example, JP-A-2002-150211. [0004]
Printers that print barcodes execute a special process when printing barcodes in anticipation that the printed barcode will later be optically read, but need to suppress a drop in processing efficiency during barcode printing.
SUMMARY
An object of the present invention is to print barcodes while suppressing a drop in process efficiency. [0005]
To achieve the foregoing object, a printer according to the invention has a print unit that prints images on recording media; and a control unit that causes the print unit to print based on image data written to an image buffer, the control unit deleting the buffered font data, writing the barcode image data to the image buffer, and causing the print unit to print a barcode image based on the buffered barcode image data when a string related to font data written to the same line in the image buffer as the barcode image data is a space character string.
When a string printed on the same line as a barcode image only
includes space characters, printing a barcode image reflecting the string of space characters will not affect reading the barcode image. Note that printing space characters on the same line as the barcode image can be used to adjust the position of the barcode image.
Therefore, when a string related to font data written to the same line as barcode image data consists of only space characters, the printer in this aspect of the invention does not prohibit printing, but instead deletes the buffered font data, writes the barcode image data to the image buffer, and causes the print unit to print a barcode image based on the buffered barcode image data. When there is no effect on reading the barcode image, a barcode image being unnecessarily not printed is suppressed, and a drop in process efficiency is suppressed. [0006]
Preferably in the invention, when the control unit deletes the font data of a space character string and writes barcode image data to the image buffer, the control unit writes the barcode image data to a position in the image buffer reflecting the position where the deleted font data was written.
When printing space characters to adjust the position of the barcode.image is commanded, this configuration enables printing the barcode image at a position reflecting the position adjusted by printing the space characters. [0007].
Further preferably, the printer is connectable to a control device; and when the control unit receives a command instructing buffering font data of a space character string, writes font data for the space character string to the image buffer based on this command, and then receives a command from the control device instructing buffering barcode image data, the control unit stores position information identifying the position to write,the barcode
4 -
image data after the buffered font data in the image buffer, and then deletes the font data written to the image buffer, and writes the barcode image data to the position identified by the stored position information.
This configuration enables writing barcode image data in the image buffer at a position reflecting the position where font data for space characters should be written. [0008]
In another aspect of the invention, the control unit prohibits causing the print unit to print based on the buffered image data when font data for a string and barcode image data are written to the same line in the image buffer.
When text and a barcode image are printed on the same line, the text.can interfere, with reading the barcode image.
The printer according to this aspect of the invention therefore prohibits the print unit from printing based on the buffered image data when font data for a text string and barcode image data are buffered to the same line in the image buffer. As a result, text and a barcode image will not be printed on the same line, and barcodes can be printed in a way enabling accurate reading. [0009]
., , A printer according to another aspect of the invention is connectable to a control device; and the control unit writes image data to the image buffer based on a buffer command received from the control device, and causes the print unit to print an image based on the image data written to the image buffer based on^ a print instruction command received from the control device, and when a buffer command that includes a data packet storing data to be encoded and data size information indicating the size of the data packet, and instructs writing barcode image data to the image buffer, is received from the control device, sequentially reads
- 5 -
and encodes the data stored in the data packet, .and when the read target becomes the print instruction command before reading data of the data size indicated by the data size information ends, writes the barcode image data to the image buffer based on the completed encoding, then reads the print instruction command, and based on the print instruction command causes the print unit to print a barcode image based on the buffered image data.
This configuration enables printing a barcode image based on the data in the data packet of a buffer command even when the size of the data packet indicated by the data size information and the actual size of the data packet differ. [QOlO]
Another aspect of the invention is a control method of a printer having a print unit that prints images on recording media, the control method including: deleting the buffered font data; writing the barcode image data to the image buffer; and causing the print unit to print a barcode image based on the buffered barcode image data when a string related to font data written to the same line in the image buffer as the barcode image data is a space character string.
Therefore, when a string related to font data written to the same line as barcode image data consists of only space characters, the printer in this aspect of the invention does not prohibit printing, but instead deletes the buffered font data, writes the barcode image data to the image buffer, and causes the print unit to print a barcode image based on the buffered barcode image data. When .there is no effect on .reading the barcode image, a barcode image being unnecessarily not printed is suppressed, .and a drop in process efficiency is suppressed. ,[0011]
The control method preferably further includes writing the barcode image data to a position in the image buffer reflecting
the position where the deleted font data was written when deleting the font data of a space character string and writing barcode image data to the image buffer.
Further preferably, the control method also includes: receiving from a control device a command instructing buffering font' data of a space character string; writing font data for the space character string to the image buffer based on this command; storing position information identifying the position to write the barcode image data after the buffered font data in the image buffer when a command instructing buffering barcode image data is received from the control device; deleting the font data written to the image buffer; and writing the barcode image data to the position identified by the stored position information.
Further preferably, the control method also includes prohibiting causing the print unit to print based on the buffered image, data when font data for a string and barcode image data are written to the same line in the image buffer.
Yet further preferably, the control method also includes writing image data to the image buffer based on a buffer command received from the control device; causing the print unit to print an image based on the image data written to the image buffer based on a print instruction command received from the control device; receiving from the control device a buffer command that includes a data packet storing data to be encoded and data size information indicating the size of the data packet, and instructs writing barcode image data to the image buffer; sequentially reading and encoding the data stored in the data packet; writing the barcode image data to the image buffer based on the completed encoding when the read target becomes the print instruction command before reading data of the data size indicated by the data size information ends; and reading the print instruction command, and based on the print instruction command causing the print unit to
print a barcode image based on the buffered image data.
Effect of the invention
[0012]
The invention enables printing barcodes while suppressing a loss of process efficiency.
Other objects and attainments together with a fuller understanding of the invention will become apparent and appreciated by referring to the following description and claims taken in conjunction with the accompanying drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
FIG. 1 is a block diagram (step SH owing the functional configuration of a printing system according to an embodiment,of the invention.
FIG. 2A shows an example of the content of a control command.
FIG. 2B shows the content of a control command.
FIG. 2C illustrates the result of writing image data based on the render string command shown in FIG. 2B to an image buffer.
FIG. 2D illustrates the storage area to which the barcode image data is written.
FIG. 3A illustrates the content of a control command.
FIG. 3B illustrates the content of a render barcode command.
FIG. 3C illustrates image data based on the render barcode command shown in FIG. 3B rendered in the image buffer.
FIG. 4 is a flow chart showing the operation of the printer.
FIG. 5A illustrates the state of the image buffer before clearing the font data.
FIG. 5B illustrates the state of the image buffer after clearing the font data.
FIG. 6 is a flow chart showing the operation of the printer.
DESCRIPTION OF EMBODIMENTS
- 8
[0014]
A preferred embodiment of the invention is described below with reference to the accompanying figures.
FIG. 1 is a block diagram showing the functional configuration of a printing system 1 according to this embodiment of the invention.
As shown in FIG. 1, the printing system 1 includes a host computer 10, and a printer 11 (printing device) that prints images on a recording medium as controlled by the host computer 10 (control device).
As shown in FIG. 1, the host computer 10 has a host control unit 15, host display unit 16, host input unit 17, host interface 18, and host storage unit 19.
The host control unit 15 includes a CPU, ROM, RAM, and other peripheral circuits, and controls various parts of the host computer 10 . The host control unit 15 has a application execution unit 20 and a printer driver execution unit 21, which are further described below.
The host display unit 16 is an LCD panel or other display panel, and displays images on the display panel as controlled by the host control unit 15.
The host input unit 17 is connected to one or more input; devices, detects operation of the input devices, and outputs to the host control unit 15.
The host interface 18 communicates with the printer 11 according to a specific communication protocol as controlled by the host control unit 15.
The host storage unit 19 is a storage device such as a hard disk drive or EEPROM device, and stores data rewritably. [0015]
The printer 11 is a thermal printer with a thermal head 23 with a line of heat elements, and records images by heating the
recording surface of thermal roll paper R (recording media) with the thermal head 23 to form dots. More particularly, the printer 11 can cut the thermal roll paper R at a specific position after recording a specific image on the thermal roll paper R.
As shown in FIG. 1, the printer 11 has a control unit 30, display unit 31, input unit 32, print unit 33, storage unit 35, and interface 36.
The control unit 30 includes a CPU, ROM, RAM, and other peripheral circuits, and controls parts of the printer 11. The display unit 31 has a display panel such as an LCD panel that displays images orLEDs, and displays information such as the operating status of the printer 11 on the display panel or by driving the LEDs to turn on/off in specific patterns as controlled by the control unit 30.
The input unit 32 is connected to switches disposed to the printer 11, detects operation of the switches, and outputs: operating signals to the control unit 30.
In addition to the thermal head 2 3 described above, the print unit 3 3 also includes a conveyance mechanism that conveys the thermal roll paper R, and a cutting mechanism that cuts the thermal roll paper R. By reading and running firmware, the control unit 30 controls the thermal head 23 and motors to record specific images on the thermal roll paper R, and cuts the thermal roll paper R at a specific position, based on control commands received from ■ the host computer 10 while monitoring sensor output. This function of the control unit 30 is achieved by cooperation of hardware and software,- such as a CPU reading and running firmware.
The interface 3 6 communicates with the host computer 10 according to a specific communication protocol as controlled by the control unit 30. The storage unit 3 5 includes nonvolatile memory such as EEPROM or a hard disk drive, and nonvolatilely stores data rewritably. Firmware for controlling operation of the
10
printer 11 is stored in the storage unit 35. A font table 50 and conversion table 51 as described below are also stored in the storage unit 35. [0016]
Operation of the host computer 10 and printer 11 when printing a string on thermal roll paper R is described next.
Operation of the host computer 10 and printer 11 is described using printing the string ABC as an example.
The application execution unit 2 0 of the host control unit 15 on the host computer 10 is a function block embodied by the CPU running an application installed on the host computer 10. The printer driver execution unit 21 is a function block embodied by the CPU running a printer driver.
To print the string ABC, the application execution unit, 20 first generates data including information related to the print string, and outputs to the printer driver execution unit 21 using an API (Application Programming Interface) provided by the OS. (Operating System).
.Based on data input from the application execution unit 20, the printer driver execution unit 21 generates and sends control commands in the command language of the printer 11 to the printer 11. [0017]
FIG. 2A illustrates the content of a control command generated and sent by the printer driver execution unit 21 to the printer 11 to print a string (the string ABC in this example).
As shown in FIG. 2A, the control command includes a string buffer command MCI and a print instruction command iyiC2 .
The control commands sent to the printer 11 are stored sequentially in a receive buffer J. The receive buffer J is created in RAM, for example, for temporarily storing received data (see FIG. 1) . In this example, the string buffer command MCI and print
11
instruction command MC2 are sequentially stored in the receive buffer J.
The string buffer command MCI is a command that specifies the string, and instructs writing the font data corresponding to the specified string to an image buffer B. The image buffer B is a buffer created in RAM, for example, and is a temporary storage area for the image data of the image to be printed on the thermal roll paper R (see FIG. 1).
FIG. 2B illustrates the data structure of the string buffer command MCI.
As shown in FIG. 2B, the string buffer command MCI includes
a command code CI, which is the command code of the command; a data
packet DB storing the string to printer; and an end of string flag
SP identifying the end of the data packet DB. ;
[0018]
When storing a control command to the receive buffer J starts., the control unit 3 0 of the printer 11 accesses the receive buffer J, and reads the stored control commands in blocks,of a specific size (such as 1 byte) . The size of the command code CI, data packet DB, and end of string flag SD is an integer multiple of the specific block size used for reading the data, and is read by the control unit 3 0 based on the data blocks in the control command.
The control unit 30 first reads the command code CI. The-command code CI is a command code that instructs writing the font data for the print string to the image buffer B by the method described below.
Next, the control unit 3 0 sequentially reads the characters stored in the data packet DB. Note that for convenience of description, the size of one character is the same as the data size used for reading data from the receive buffer J in this example. Each character in the string is represented by a specific character code (such as ASCII code or Unicode) in the data packet DB. For
12
each character to print, the control unit 3 0 therefore sequentially reads the character code of the character. [0019]
After reading the character code of one character, the control unit 3 0 converts the character code to the corresponding font data based on the font table 50 and the conversion table 51.
The font table 50 is a table storing font data for each printable character. The font data is the actual data representing a character in a format that can be recorded on the recording medium, and in this embodiment is bitmap font data. The font data could be scalable font data, vector font data, or outline font data, for example, instead of bitmap font data.
A "character" in this embodiment is any character that can be recorded on the recording medium based on font data, and is iiot limited to characters that are used in language and have meaning, or symbols with meaning. More particularly, font data for space characters is also stored in the font table 50, and a space character is also a character. A space character means a character forming white space in an image, and includes spaces and tabs, for example.
The conversion table 51 is a table that, for each character code, relationally stores the character code and the address where the font data for the character identified by the character code is stored in the font table 50.
To convert a read character code to font data, the control unit 30 references the conversion table 51 to get the address corresponding to the character code that was read. Next, the control unit 30 accesses the font table 50, and gets the font data stored in the storage area at the acquired address.
After converting the character code to font data, the control unit 3 0 writes the font data to a specific position in the image buffer B. The font data is sequentially written one character at
13 -
a time from the beginning of the image buffer B. [0020]
FIG. 2C illustrates the state of the image buffer B after writing the font data for the string to the image buffer B based on the string buffer command MCI in a format appropriate to description.
For each character stored in the data packet DB, the control unit 30 reads.the character code, converts the character code to font data, and sequentially writes the font data to the image buffer B. Triggered by reading the end of string flag SD, the process buffering font data based on the command code CI ends.
As a result, font data for each character in the string is sequentially buffered as shown in FIG. 2C.
Note that when buffering font data to the image buffer B, the control unit 3 0 manages position information indicating where the font data should be written. As shown in FIG. 2C, the position indicated by the default position information is position Kl. When buffering font data for the first character, the control unit 3 0 uses position Kl as the starting point, and writes the font data so that the corner of the rectangular bitmap font data (the top left corner in the example in FIG. 2C) is positioned to the ... coordinates corresponding to position Kl. After buffering the font data for the first character, the control unit 3 0 moves the position denoted by the position information to position K2.
The control unit 3 0 thus manages position information indicating the position of the starting point for writing the next image data to the image buffer B. ,[0021]
The print instruction command MC2 is a command instructing printing an image based on the image data stored in the image buffer B.
When the control unit 3 0 reads a print instruction command
- 14
MC2, it accesses the image buffer B, controls the thermal head 23 and a drive circuit.for a conveyance motor not shown based on the image data in the image buffer B, outputs drive current at appropriate timing to the drive circuit to drive the mechanisms of the print unit 3 3 , and causes the print unit 3 3 to print an image.
After buffering font data for the string ABC to the image buffer B based on the string buffer command MCI, the control unit 30 in this embodiment reads the print instruction command MC2, and based on this command drives the print unit 3 3 to print an image based on the image data stored in the image buffer B. As a result, the string ABC is printed on the thermal roll paper R.
After printing the image, the image data stored in the image buffer B is cleared. [0022]
The operation of the host computer 10 and printer 11 when printing a barcode on the thermal roll paper R is described next.
Operation of the printer 11 when printing a barcode in operating mode Dl is described below. This embodiment has two modes for barcode printing, operating mode Dl described below and operating mode D2 described thereafter, and enables the user to select which operating mode to use. [0023]
To print a barcode, the application execution unit 2 0 and printer,driver execution unit 21 of the host computer 10 together generate and send control commands to the printer 11.
FIG. 3A illustrates the content of a control command generated and sent by the printer driver execution unit 21 to the printer 11 to print a barcode.
As shown in FIG. 3A, the control command includes a barcode buffer command MC3, and a print instruction command MC2. The control commands sent to the printer 11 are sequentially stored to. the receive buffer J.
- 15 -
The barcode buffer command MC3 is a command that specifies the barcode code, and instructs encoding the specified code and writing image data for the barcode to the image buffer B.
FIG. 3B illustrates the data structure of the barcode buffer command MC3.
As shown in FIG. 3B, the barcode buffer command MC3 includes a command code C2, which is the command code of the command; data size information DJ indicating the data size of the data packet CB (data packet) ; and the data packet CB storing the code (the data to be encoded). [0024]
When storing the command code to the receive buffer J, the control unit 30 first reads the command code C2 . The command code C2 is a command code that instructs writing image data for the barcode to the image buffer B by the method described below.
Next, the control unit 3 0 reads the data size information DJ to get the size of the data packet CB. In this example, the data size of the data packet CB denoted by the data size information DJ is 8 bytes.
Next, the control unit 3 0 sequentially reads the code stored in the data packet CB, and encodes the read code for conversion to barcode image data. The printer 11 includes an engine with this encoding function.
The control unit 3 0 reads the amount of code indicated by the data size from the code stored in the data,packet CB, and sequentially encodes the read code. Triggered by completing encoding the code of the specified data size (8 bytes in this example) in the data packet CB, the control unit 3 0 then writes image data for the barcode generated by encoding the code to the image buffer B. The control unit 3 0 thus completes the process related to buffering image data based on the command code C2.
This process results in barcode image data being stored in
- 1£
the image buffer B as shown in FIG. 3C.
After printing the image, the image data stored in the image buffer B is cleared. [0025]
Barcode images are intended to be optically read after being printed on the thermal roll paper R.
Therefore, when a barcode image is printed by a printer, the barcode image is preferably printed so that the barcode image can be accurately read. Suppressing a drop in processing efficiency in order to print the barcodes in this way is also desirable.
The printer 11 according to this embodiment therefore executes the following process when printing barcodes. [0026]
FIG. 4 is a flow chart showing the operation of the printer 11 after reading the command code 02 of the barcode buffer command MC3 .
After reading the command code C2 of the barcode buffer command MC3 (step SAl) , the control unit 3 0 determines if font data has been written to'the image buffer B (step SA2).
Font data may be stored in the image buffer B when the control unit 3.0 reads the command code C2 of the barcode buffer command MC3 if the host computer 10 sends the barcode buffer command MC3 without sending the print instruction command MC2 after sending the string buffer command MCI, for example.
If there is no font data in the image buffer B in step SA2, the control unit 30 writes barcode image data to the image.buffer B in the mode (operating mode Dl or operating mode D2) selected by the user (step SA3) .The details of processing in step SA3 are omitted. Next, the control unit 3 0 goes to step SA4. [0027] , .
If it is determined in step SA2 that font data is stored in the image buffer B (step SA2 returns YES), the control unit 3 0
17
determines if all of the buffered font data is font data for space characters (step SAB).
If the buffered font data contains font data for even only-one character other than a space character (step SA5 returns NO), the control unit 3 0 stops processing barcode image data based on the barcode buffer command MC3 (step SA6).
In other words, if font data for a string containing a character other than a space character is already buffered in this embodiment, the control unit 3 0 stops buffering barcode image data. As a result, the control unit 3 0 prohibits printing an image based on buffered image data if font data for a string containing a character other than a space character and image data for a barcode are buffered on the same line in the image buffer B. [0028]
That font data for a string and image data, for a barcode are stored on the same line in the image buffer B means, as shown in FIG. 2P, that the font data and the barcode image data overlap in part in the column direction (column direction YJ2 in FIG. 2D perpendicular to the direction in which the font data is written (line direction YJl in FIG. 2D).
More specifically, font data is image data that occupies ,an area of a specific number of dots in the column direction Y J2, and barcode image data is likewise image data that occupies an area of a specific number of dots in the column direction YJ2 . That the data is buffered to the same line means that the area of the font data in the column direction YJ2, and the area of the barcode image data in the column direction YJ2, overlap in part.
For example, writing font data for the string ABC to the image buffer B based on the string buffer command MCI for the string ABC results in the state shown in FIG. 2C. The position indicated by the position information in this event is K4. If image data for a barcode is then buffered based on the barcode buffer command MC3
without executing a print instruction command MC2, the barcode image data will be written starting from position K4 as shown in FIG. 2D. The position where the barcode image data is written is indicated by the shaded area in FIG. 2D. In this event, there is an overlapping part in the column direction YJ2 between the font. data for the string and the image data for the barcode. The font data for the string and the image data for.the barcode are therefore written to the same line in the image buffer B. [0029]
This embodiment of the invention thus prohibits writing barcode image data and font data for a string containing a character other than a space character on the same line, and printing a string containing a character other than a space , character and a barcode image on the same line is thereby prevented.
When a character other than a space character and a barcode image are printed on the same line, the character can interfere with reading the barcode image. The printer 11 according to this embodiment therefore prohibits the print unit 3 3 from printing based on the buffered image data when font data for a string and image data for a barcode are stored on the same line in the image buffer B. As a result, a text string and a barcode image will not be printed on the same line, and barcodes can be printed in a way enabling accurate reading. [0030]
After step SA5, the control unit 3 0 executes a predetermined error handling process (step SA7). For example, the control unit 30 controls the display unit 31 to display on the display panel, or to drive an LED in a specific way, to report that printing a string and a barcode image on the same line was commanded.. The control unit 3 0 may also send specific data to the host computer 10 to report the same to the host computer 10, for example. Further
19
alternatively, the control unit 3 0 may continue the printing process without printing the barcode image, or continue the printing process without printing either the string or the barcode image. [0031]
If all of the buffered font data is determined in step SA5 to be font data for space characters (step SA5 returns YES), the control unit 3 0 stores the position indicated by the position information to a specific address in storage unit 3 5 (step SA8). As described above, this' position information is information indicating the start position for buffering the next image data.
FIG. 5A shows the state of the image buffer B when font data for a string composed of space characters is buffered. In the example in FIG. 5A, font data for three space characters is written to the image buffer B. In this event, the position indicated by the position information is position K5, and in step SA8 the control unit 3 0 stores position K5.
Next, the control unit 3 0 deletes the font data already written to the image buffer B by clearing the image buffer B (step SA9) .
Next, when in operating mode Dl, the control unit 3 0 sequentially reads the data size information DJ and code stored in the data packet CB, and writes the barcode image data by the method, described above to the cleared image buffer B (step SAIO) . Data buffering when in the operating mode D2 is described below.
In this event, the control unit 3 0 buffers the barcode image data starting from the position stored in step SA8 (position K5 in the example in FIG. 5A).
FIG. 5B shows the state of the image buffer B after barcode image data is written by the process of step SAIO when space character font data is buffered as shown in FIG. 5A.
As shown in FIG. 5B, the barcode image data is written
20
Starting from position K5. As a result, the barcode image data is written from a position reflecting the position where space character font data was written. [0032]
As described above, in this embodiment, if a string of font data already written to the image buffer B (a string of font data written to the same line as the barcode image data) is font data for only space characters when buffering image data for a barcode, the control unit 3 0 deletes the buffered font data and writes the barcode image data to the image buffer B. As a result, when the print instruction command MC2 is later read, the control unit 3 0 causes the print unit 33 to print the barcode image based on the image data stored in the image buffer B.
When the string printed on the same line as a barcode image consists of space characters, printing the string of space characters on the same line as the barcode image has no effect on reading the barcode image. A drop in process efficiency can therefore be prevented in this event by printing the barcode image . If the string printed on the same line as a barcode image consists of space characters, this embodiment of the invention prints the barcode image after a process that deletes the font data, and a drop in process efficiency can be suppressed. [0033]
In addition, when printing a space character on the same line as a barcode image is commanded, the space characters can be handled as being inserted to adjust the position of the barcode image. This embodiment of the invention therefore writes the barcode image, data to the image buffer B based on the position of the space character font data, and the barcode image is printed to a position reflecting the position of the space characters.
Therefore, when printing space characters for the purpose of adjusting the position of the barcode image is commanded, this
21 -
embodiment of the invention can print the barcode image at the position reflecting the position adjusted by printing the space characters.
After step SAIO, the control unit 3 0 goes to step SA4. [0034]
In step SA4, the control unit 3 0 accesses the receive buffer J, reads the print instruction command MC2 (step SA4), and based on the command causes the print unit 3 3 to print based on the image data stored in the image buffer B (step SAll).
In this embodiment, the command following the barcode buffer command MC3 is a print instruction command MC2 due to the specifications of the printer driver. This is because if the command following the barcode buffer command MC3 is a string buffer command MCI, the position of the barcode image cannot be adjusted by the command. More specifically, by making the command following the barcode buffer command MC3 a print instruction command MC2, the barcode can be printed after buffering the barcode image data, and printing the barcode image and a text string on the same line can therefore be prevented.
Using a barcode buffer command MC3 as the next command after a command instructing buffering image data for an image (graphic image) other than text is also prohibited by the printer driver specifications in this embodiment. This is because printing an image other than a,space character on the same line for the purpose of adjusting the position of the barcode image is not allowed. [0035] .
Operation of the printer 11 when printing a barcode image in the operating mode D2 is described next.
As described with reference to FIG. 3B, the barcode buffer command MC3 includes.data size information DJ, and the data size of the data packet CB where the code is stored is the data size indicated by the data size information DJ.
22
However, the data size indicated by the data size information DJ,' and the actual size of the data packet CB, may differ. This difference may result from a change in the printer driver specifications, a version change, or modification of the program, for example.
The object of the operating mode D2 is to print a correct barcode image even when the data size indicated by the data size information DJ and the actual size of the data packet CB differ. The user can therefore select operating mode D2 as the operating mode when there is the possibility that the data size indicated by the data size information DJ and the actual size of the data packet CB may differ. [0036]
FIG. 6 is a flow chart showing the operation of the printer 11 in the operating mode D2.
The flow chart in FIG. 6 shows the operation of the printer 11 after starting to read the barcode buffer command MC3. As described above, the print instruction command MC2 is the command following the barcode buffer command MCS due to the specifications of the printer driver.
As shown in FIG. 6, after reading the command code C2 in the barcode buffer command MC3 (step SBl), the control unit 3 0 reads and then discards the data size information DJ (step SB2). The control unit 3 0 therefore does not recognize the data size of the data packet'CB in the operating mode D2.
As shown in FIG. 33, the data following the data size information DJ is the code stored in the data packet CB.
Next, the control unit 3 0 references the read target data stored in the receive buffer J (step SB3).
Next, the control unit 3 0 determines if the referenced data is a print instruction command MC2 (step SB4).
If the reference data is not a print instruction command MC2,
23
in other words, if the referenced data is part of the code stored in the data packet CB (step-SB4 returns NO) , the control unit 3 0 reads the code (step SB5), and encodes the read code (step SB6) . The control unit 3 0 then goes to step SB3.
If in step SB4 the reference data is a print instruction command MC2 (step SB4 returns YES) , the control unit 3 0 writes the barcode image data generated by encoding the code to the image buffer B (step SB7) . Note that the control unit 30 writes the image data starting from the position indicated by the position information.
Next, the control unit 3 0 reads the print instruction command MC2 (step SB8), and causes the print unit 33 to print the barcode image (step SB9). [0037] .
In the operating mode D2, if the data read next after starting to read the code regardless of the size of the data packet CB indicated by the data size information DJ is the print instruction command MC2, the control unit 3 0 reads the code and completes encoding. The control unit 3 0 then prints a barcode image based on the image data stored in the image buffer B. As a result, even if the data size indicated by the data size information DJ and the actual size of the data packet CB are different, a correct barcode can be printed using the data structure of the barcode buffer command MC3 and the next command being the print instruction command MC2. [0038]
In the operating mode D2 described above, the control unit 30 discards the data size information DJ in step SB2, and does not know the size of the data packet CB. However, the following,process may be executed if the actual size of the data packet CB does not exceed the data packet CB size indicated by the data size information DJ. That is, when the amount of code equal to the data
24 -
size indicated by the data size information DJ is read and encoding is completed, the next read data is the print instruction command MC2. Therefore, when the amount of code equal to the data size indicated by the data size' information DJ is read and encoding is completed, the control unit 3 0 reads data (reads the print instruction command MC2) without referencing the next read target data in the receive buffer J in step SB3. Next, the control unit 3 0 causes the print unit 33 to print based on the read print instruction command MC2. [0039]
As described above, the control unit 3 0 in this embodiment prohibits printing by the print unit 33 based on the buffered image data when font data for a string and image data for a barcode are buffered to the same line in the image buffer B. when the string of the font data written to the same line as the barcode image data consists of space characters, the control unit 3 0 discards the buffered font data. Next, the control unit 3 0 writes the barcode image data to the image buffer B, and causes the print unit 33 to print a barcode image based on the buffered barcode image data. This configuration therefore prevents printing a text string and a barcode image on the same line, and can print barcodes in a way enabling accurate reading.
Unnecessarily skipping printing a barcode image can also be suppressed by this configuration when there is no effect on reading the barcode image, and a drop in processing efficiency can be suppressed. [0040]
Furthermore, when the control unit 3 0 in this embodiment deletes space character font data and writes barcode image data to the image.buffer B, the barcode image data is written to a position reflecting the position where the deleted font data was written.
25
More specifically, after storing position information indicating the position where the barcode image data should be written following the buffered space character font data in the image buffer B, the control unit 3 0 deletes the font data from the image buffer B. Next, the control unit 3 0 writes the barcode image data to the position indicated by the stored position information.
When printing space characters is commanded for the purpose of adjusting the position of the barcode image, this configuration enables printing a barcode image to a position reflecting adjustment of the barcode position by the printed space characters. [0041]
In this embodiment, the control unit 30 sequentially reads and encodes the data stored in the data packet CB (data packet) when a barcode buffer command'MC3 is received, and when the print instruction command MC2 is read, writes the barcode image data to the image buffer B based on the encoded data regardless of the size of the data packet CB indicated by the data size information DJ, then reads the print instruction command, and based on the command causes the print unit 33 to print a barcode image based on the buffered image data.
This configuration enables printing a barcode image based on the data in the data packet of the barcode buffer command MC3 even when the data size of the data packet indicated by the data size information is different from the actual size of the data packet. [0042]
The invention is described above with reference to a preferred embodiment thereof, but the invention is not limited thereto and can be modified and adapted in many ways without departing from the scope of the accompanying claims.
If font data for a string including a character other, than a space character is already stored when writing barcode image data
- 26 -
to the image buffer B, the control unit 30 in the foregoing embodiment stops buffering barcode image data. As a result, the control unit 3 0 prohibits printing images based on buffered image data when font data for a string including a character other than a space character and barcode image data are written to the same line in the image buffer B. However, the method of prohibiting printing is not limited to the method described in the foregoing embodiment.
The printing method of the printer 11 is also not limited to thermal printing, and Inkjet or dot impact printing could be used.
Function units of the host Computer 10 and the printer 11 shown in FIG. 1 describe functional configurations achieved by the cooperation of hardware and software, and the specific implementation thereof is not specifically limited. Providing hardware corresponding to the individual function units is therefore not necessary, and the function of plural function units can obviously be achieved by a single processor executing a program. Some functions rendered by software in the foregoing embodiment may be rendered by hardware, and some functions rendered by hardware in the foregoing embodiment may be rendered by software. The specific detailed configuration of other parts of the printer 11 can also be obviously changed as desired without departing from the scope of the accompanying claims.
27 -
28
What is claimed is:
1. A printer comprising:
a print unit that prints images on recording media; and a control unit that causes the print unit to print based on image data written to an image buffer,
the control unit deleting the buffered font data, writing the barcode image data to the image buffer, and causing the print unit to print a barcode image based on the buffered barcode image data when a string related to font data written to the same line in the image buffer as the barcode image data is a space character string.
2. The printer described in claim 1, wherein:
when the control unit deletes the font data of a space character string and writes barcode image data to the image buffer, the control unit writes the barcode image data to a position in the image buffer reflecting the position where the deleted font data was written.
3. The printer described in claim 2, wherein:
the printer is connectable to a control device; and when the control unit receives a command instructing buffering font data of a space character string, writes font data for the space character string to the image buffer based on this command, and then receives a command from the control device instructing buffering barcode image data,
the control unit stores position information identifying the position to write the barcode image data after the buffered font data in the image buffer, and then deletes the font data written to the image buffer, and writes the barcode image data to the position identified by the stored position information.
29
4. The printer described in claim 1, wherein:
the control unit prohibits causing the print unit to print based on the buffered image data when font data for a string and barcode image data are written to the same line in the image buffer.
5. The printer described in claim 1, wherein:
the printer is connectable to a control device; and the control unit writes image data to the image buffer based on a buffer command received from the control device, and causes the print unit to print an image based on the image data written to the image buffer based on a print instruction command received from the control device, and
when a buffer command that includes a data packet storing data to be encoded and data size information indicating the size of the data packet, and instructs writing barcode image data to the image buffer, is received from the control device, sequentially reads and encodes the data stored in the data packet, and when the read target becomes the print instruction command before reading data of the data size indicated by the data size information ends, writes the barcode image data to the image buffer based on the completed encoding, then reads the print instruction command, and based on the print instruction command causes the print unit to print a barcode image based on the buffered image data.
6. A control method of a printer having a print unit that prints
images on recording media, the control method comprising:
deleting the buffered font data,-
writing the barcode image data to the image buffer; and causing the print unit to print a barcode image based on the buffered barcode image data when a string related to font data written to the same line in the image buffer as the barcode image
30 -
data is a space character string.
7. The control method of a printer described in claim 6, further comprising:
writing the barcode image data to a position in the image buffer reflecting the position where the deleted font data was written when deleting the font data of a space character string and writing barcode image data to the image buffer.
8 . The control method of a printer described in claim 7, further comprising:
receiving from a control device a command instructing buffering font data of a space character string;
writing font data for the space character string to the image buffer based on this command;
storing position information identifying the position' to write the barcode image data after the buffered font data in the image buffer when a command instructing buffering barcode image data is received from the control device;
deleting the font data written to the image buffer; and
writing the barcode image data to the position identified by the stored position information.
9. The control method of a printer described in claim 6, further
comprising:
prohibiting causing the print unit to print based on the buffered image data when font data for a string and barcode image data are written to the same line in the image buffer.
10. The control method of a printer described in claim 6, further
comprising:
writing image data to the image buffer based on a buffer
- 31
command received from the control device;
causing the print unit to print an image based on the image data written to the image buffer based on a print instruction command received from the control device;
receiving from the control device a buffer command that includes a data packet storing data to be encoded and data size information indicating the size of the data packet, and instructs writing barcode image data to the image buffer;
sequentially reading and encoding the data stored in the data packet;
writing the barcode image data to the image buffer based on the completed encoding when the read target becomes the print instruction command before reading data of the data size indicated by the data size information ends; and
reading the print instruction command, and based on the print instruction command causing the print unit to print a barcode image based on the buffered image data.
Dated
this
30"
day
of
June,
2014.
ROB DITMARK GROSER ofGRJSER&GROSER AGENT FOR THE APPLICANTS
| # | Name | Date |
|---|---|---|
| 1 | SPECIFICATION.pdf | 2014-07-03 |
| 2 | FORM 5.pdf | 2014-07-03 |
| 3 | FORM 3.pdf | 2014-07-03 |
| 4 | DRAWINGS.pdf | 2014-07-03 |
| 5 | 1759-del-2014-Correspondence-Others-(14-07-2014).pdf | 2014-07-14 |
| 6 | 1759-del-2014-English Translation-(03-09-2014).pdf | 2014-09-03 |
| 7 | 1759-del-2014-Correspondence Others-(03-09-2014).pdf | 2014-09-03 |
| 8 | 1759-del-2014-GPA-(16-09-2014).pdf | 2014-09-16 |
| 9 | 1759-del-2014-Correspondence-Others-(16-09-2014).pdf | 2014-09-16 |
| 10 | 1759-DEL-2014-FER.pdf | 2019-08-28 |
| 1 | 2019-08-2615-01-25_26-08-2019.pdf |