Host device, printing system, and data processing method
10102457 ยท 2018-10-16
Assignee
Inventors
Cpc classification
G06F3/1225
PHYSICS
G06F3/1204
PHYSICS
G06Q20/209
PHYSICS
G06F3/1285
PHYSICS
International classification
G06F3/12
PHYSICS
H04N1/00
ELECTRICITY
Abstract
Text data is acquired from print request data, print content is expressed as raster data and print data is generated using a printer command based on the print request data, the acquired text data is added to the print data using the command, and the print data is sent with the text data to the printer.
Claims
1. A host device comprising: a processor configured to receive print request data from an application, extract text data for a print object from the print request data, rasterize extracted text data and create image data, generate imaged print data from the image data using a printer command based on the print request data, rearrange the extracted text data in order, add rearranged text data to the imaged print data using the printer command, and send the imaged print data with the added rearranged text data to a printer, wherein the added text data is not printed by using the printer command and being sent to a server by the printer.
2. The host device described in claim 1, wherein: the image data is expressed by raster data.
3. The host device described in claim 1, wherein: the processor executes a process of sorting the extracted text data into the order the text data to be printed appears when printed.
4. The host device described in claim 1, wherein: the processor adds the rearranged text data to the imaged print data by inserting the rearranged text data between a page mode command and a cancel command that cancels printing of the added text data in the page mode.
5. The host device described in claim 1, wherein: the processor adds the rearranged text data to the imaged print data using a start command for a text mode that sends the print data to the printer as text data, and a specific number of characters of the rearranged text data followed by a clear command.
6. A printer connected to a host device and a server, the printer comprising: a printer processor that receives imaged print data with added text data from the host device, extracts the added text data from the imaged print data, sends the added text data to the server, and a print mechanism that executes a printing process based on the imaged print data, and does not print the added text data, wherein the imaged print data is generated by the host device including a host processor, and the host processor is configured to receive print request data from an application, extract text data from the print request data, rasterize extracted text data and create image data, generate the imaged print data from the image data using a printer command based on the print request data, rearrange the extracted text data in order, add rearranged text data to the imaged print data using the command, and send the imaged print data with the added rearranged text data to the printer, wherein the added text data is not printed by using the printer command.
7. The printer described in claim 6, wherein: the printer processor stores the rearranged text data, and sends the rearranged text data at a specific time to the server.
8. The printer described in claim 6, wherein: the image data is expressed by raster data.
9. The printer described in claim 6, wherein: the host processor of the host device sorts the extracted text data into the order the text data to be printed appears when printed.
10. The printer described in claim 6, wherein: the host processor of the host device adds the rearranged text data to the imaged print data by inserting the rearranged text data between a page mode command and a cancel command that cancels printing of the added text data in the page mode.
11. The printer described in claim 6, wherein: the host processor of the host device adds the rearranged text data to the imaged print data using a start command for a text mode that sends the print data to the printer as text data, and a specific number of characters of the rearranged text data followed by a clear command.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1)
(2)
(3)
(4)
(5)
(6)
(7)
(8)
(9)
(10)
DESCRIPTION OF EMBODIMENTS
(11) Preferred embodiments of the present disclosure are described below with reference to the accompanying figures. The embodiments described below do not, however, limit the technical scope of the disclosure. Note also that like or similar parts are identified in the following figures by the same reference numerals or symbols.
Embodiment 1
(12)
(13) Note that raster data is data expressing the object to be printed with a gray scale value of each color for each pixel in the printed image.
(14) As shown in
(15) The POS terminal 1 is a terminal device of a POS system used at a checkout counter in a supermarket, for example, and is communicatively connected to a receipt printer 2. The POS terminal 1 is a host device of the receipt printer 2, and instructs the receipt printer 2 to produce a receipt or coupon, for example, when processing a sale transaction (at the time of payment). The POS terminal 1 is a computer, and while not shown in the figure includes a CPU, RAM, ROM, and disk drive, and other peripheral devices such as a display, keyboard, barcode reader, and card reader not shown.
(16) As shown in
(17) The POS application unit 11 runs the transaction process at the point or sale, and sends data including receipt and coupon print requests to a POS server not shown. When requesting printing, the POS application unit 11 outputs the print request data to the printer driver unit 12. The print request data is expressed by standard commands, and in this example is expressed in the GDI (Graphics Device Interface) language.
(18) The printer driver unit 12 handles driver functions for the receipt printer 2. The printer driver unit 12 receives print request data output from the POS application unit 11, and generates and sends print data in the command language of the receipt printer 2 based on the print request data to the receipt printer 2. As described above, when generating the print request data, the printer driver unit 12 executes a process that adds text data to the print data. This process is a major feature of the printing system according to the disclosure, and is described in detail below.
(19) The POS application unit 11 and printer driver unit 12 are embodied by programs (a POS application program and printer driver program) defining the steps in the processes, a CPU that executes the programs, and RAM or other memory device, for example.
(20) The receipt printer 2 is a printer that prints receipts, coupons, or other objects as instructed by the POS terminal 1. The printing method may be inkjet, thermal, or other printing method. The receipt printer 2 prints the print objects on roll paper, for example, and cuts the paper with a cutter after printing is completed.
(21) The receipt printer 2a is an intelligent printer in this example, and, in addition to a print control unit as used in a typical printer, includes a data processing device (computing device) similar to a personal computer.
(22) Functional components of the receipt printer 2 include, as shown in
(23) The text data processing unit 21 is embodied by the data processing device described above, that is, a CPU, ROM, RAM, hard disk drive, and other peripheral components, and a program defining the process content. The text data processing unit 21 receives print data sent from the POS terminal 1, and executes processes to extract text data from the print data, and send the acquired text data to the sales information analysis server 3.
(24) The print control unit 22 is the control unit of the printer, and controls the printing process based on the received print data. The print control unit 22 is embodied by a program and a CPU, ROM, RAM, ASIC, and NVRAM, for example.
(25) The print mechanism unit 23 operates as control led by the print control unit 22, and prints on paper. The print mechanism unit 23 includes a printhead, print media conveyance device, and cutter, for example.
(26) The sales information analysis server 3 is a server computer that receives the text data sent from the receipt printer 2, and uses the received text data to execute a sales analysis process and electronic receipt issuing process.
(27) In the sales analysis process, information such as the names, quantities, and prices of the purchased products, the store where the products were purchased, the date of sale, and the total purchase amount that is printed on the receipt are acquired from the text data, and used to analyze variations in sales based on the time of day, seasonal variations, and regional (location) variations, for example. Because essential information printed on the receipt is extracted from the text data in the electronic receipt issuing process, a screen showing the content of the requested receipt can be provided to the terminal device in response to user access from the terminal device.
(28) The processes described below are executed when printing a receipt is requested in the printing system according to this embodiment of the disclosure.
(29) As described above, the print request data is expressed according to the GDI specification, and the print objects contained in the receipt requested to be printed is represented by a GDI function. Text expressing the store name and product names, numbers expressing numerical information such as prices, and images expressing a store logo, for example, are contained in the print objects.
(30) The printer driver unit 12 sequentially interprets the GDI functions in the print request data and builds an image of the print objects (an image expressed by pixels), that is, executes a process that creates an image, but when the print object is text data comprising characters and numbers, acquires (extracts) the text data (step S3 in
(31) When the text data acquisition process (step S3 in
(32) The printer driver unit 12 then executes a process to reorder the acquired text data (step S6 in
(33) More specifically, because the print objects for text data expressed by GDI functions contain information identifying where to print the objects, the printer driver unit 12 sorts the text data representing the print objects into the order the objects appear on the receipt. Yet more specifically, the printer driver unit 12 first sorts the text data vertically starting from the top of the receipt to the bottom, and then sorts any objects at the same vertical (lengthwise) position from left to right on the receipt.
(34) Next, the printer driver unit 12 executes a process that adds the sorted text data to the generated data (step S7 in
(35) More specifically, in one example, this process of adding the text data can be done using page mode commands. Because the print objects contained in the print data are normally expressed by raster data as described above, the receipt printer 2 prints the received raster data sequentially and does not store the data. However, in the page mode, the data for the print objects in a specific area (such as one page or one receipt) are stored (buffered) to memory in the receipt printer 2 and then used to print that area (page or receipt). The print objects also do not need to be expressed by raster data in the page mode, and may be text data. Also in the page mode, commands are written in the print data starting with a page mode registration command (start page mode command), followed by the data for the print objects, and commands for executing the printing process.
(36) In this example, page mode commands are used to add a page mode registration command, the resorted text data acquired as described above, and a cancel command sequentially to the print data generated as described above.
(37)
(38) The block identified by reference numeral A1 in
(39) Note that other commands may be used to add text data. For example, in the text mode, text data may be added using text data of a character count not exceeding the printing width, and a clear command. More specifically, the printer driver unit 12 first adds a start text mode command between the raster data of the generated print data (C2 in
(40) When this addition process ends, the printer driver unit 12 sends the print data with the added data to the receipt printer 2 (step S8 in
(41) This completes processing by the printer driver unit 12.
(42) The process executed by the text data processing unit 21 of the receipt printer 2 is described next.
(43) The text data processing unit 21 first receives the print data sent from the printer driver unit 12 (step S11 in
(44) If the text data processing unit 21 determines by this process that there is no text data, it outputs the print data directly to the print control unit 22 (step S14 in
(45) Using the example of print data shown in
(46) In the above example that uses a text mode and adds a specific number of text data objects and clear commands, the text data portion is extracted and stored, and all of the print data is sent to the print control unit 22.
(47) Alternatively, after acquiring and storing the text data, the text data processing unit 21 may delete the text data portion from the print data, and then send the remaining print data to the print control unit 22. In this event, the portion added by the text data adding process is deleted.
(48) When acquiring and storing the text data (S13) and sending the received print data (S14) are completed, the text data processing unit 21 sends the stored text data to the sales information analysis server 3 (step S15 in
(49) Because the sales information printed on the receipts is included in the transmitted text data, the sales information analysis server 3 can execute processes to analyze the information or issue electronic receipts.
(50) This completes processing by the text data processing unit 21.
(51) The process executed by the print control unit 22 and print mechanism unit 23 is described next.
(52) The print data transmitted from the text data processing unit 21 is first received by the print control unit 22 (step S21 in
(53) The print control unit 22 controls the print mechanism unit 23 based on the interpreted commands, and controls the print mechanism unit 23 to print on the paper (step S23 in
(54) The text data that was added by the text data adding step is then deleted by the command added after the text data, and is not printed by the print mechanism unit 23 (step S24 in
(55) In the print data shown in
(56) In the above example that adds a specific amount of text data and a clear command using a text mode, the specific amount of text data is deleted by the immediately following clear command and is not printed.
(57) Only the portion that should be printed as a receipt is therefore printed, and the data that is added for acquiring the sales information is not printed. When the added text data is deleted by the text data processing unit 21, only the portion that should be printed as a receipt is printed.
(58) Processing by the print control unit 22 and print mechanism unit 23 thus ends.
(59) Because the text portion added to the print data by the adding process described above is expressed by commands that can be interpreted by the receipt printer 2 and is processed without affecting the printing process, the receipt printer 2 can print receipts without throwing an error even if the receipt printer 2 is not a so-called intelligent printer and does not have the portion corresponding to the text data processing unit 21.
(60) As described above, because the printer driver unit 12 in the printing system according to this embodiment adds text data for the information printed on the receipt to the print data and sends the combined text data and print data to the receipt printer 2, the printer can easily extract the information printed on the receipt even if the print objects are rasterized by the host.
(61) Furthermore, because the printer driver unit 12 acquires the text data added to the print data before the print objects are rasterized, processing is simple and information can be accurately acquired.
(62) Furthermore, the existing POS application does not need to be modified to add the ability to extract information from receipt data to an existing system because this functionality can be added by adding a function for adding text data to the printer driver unit 12 and adding a data acquisition function to the text data processing unit 21.
(63) Because the process of rasterizing print objects on the host side in an existing system does not change, the resulting printout also does not change.
(64) Furthermore, because the printer driver unit 12 sorts and adds text data in the order the data appears on the receipt, the text data can be easily used by the sales information analysis server 3, for example.
(65) Furthermore, because the printer driver unit 12 uses commands for the receipt printer 2 to add text data to the print data, the commands can be easily interpreted by the receipt printer 2 and the print control unit 22 does not return an error.
(66) A POS system is used as an example in the embodiment described above, but the disclosure is not to limited to use in POS systems. For example, the disclosure can be used in systems that execute a specific application including producing printouts from a printer, such as systems used in hospitals and package delivery companies, and is particularly effective when modifying the existing application program is difficult.
Embodiment 2
(67)
(68) A sales information analysis function can therefore be easily added to an existing POS system without needing to modify the existing POS application or printer driver, and the resulting printouts will also not change.
(69) As shown in
(70) The POS terminal 1a is a terminal device of a POS system used at a checkout counter in a supermarket, for example, and is communicatively connected to a receipt printer 2a. The POS terminal 1a is a host device of the receipt printer 2a (print control device), and instructs the receipt printer 2a to produce a receipt or coupon, for example, when processing a sale transaction (at the time of payment). The POS terminal 1a is a computer, and while not shown in the figure includes a CPU, RAM, ROM, hard disk drive, and other peripheral devices such as a display, keyboard, barcode reader, and card reader not shown.
(71) As shown in
(72) The POS application unit 11a runs the transaction process at the point of sale, and sends data including receipt and coupon print requests to a POS server not shown. When requesting printing, the POS application unit 11a outputs the print request data to the printer driver unit 13a. The print request data is expressed by standard commands, and in this example is written in the GDI (Graphics Device Interface) language.
(73) Note that the POS application unit 11a resides on the application layer of the computer used as the POS terminal 1a, and is embodied by programs defining the steps in the processes, a CPU that executes the programs, and RAM or other memory device, for example.
(74) The filter driver unit 12a (acquisition unit) receives the print request data output from the POS application unit 11a to the printer driver unit 13a before the printer driver unit 13a receives the data, and extracts the text data to be printed from the print request data. The filter driver unit 12a resides on the kernel layer of the operating system of the computer used as the POS terminal 1a, and is embodied by a program defining the steps of the is process, a CPU that executes the program, and RAM or other memory device, for example.
(75) The printer driver unit 13a handles the receipt printer 2a driver function. The printer driver unit 13a receives print request data output from the POS application unit 11a, and generates and sends print data in the command language of the receipt printer 2a based on the print request data to the receipt printer 2a. The printer driver unit 13a rasterizes the print objects (content to be printed) contained in the print request data, and includes the raster data in the print data.
(76) The raster data is data expressing the object to be printed with a gray scale value of each color for each pixel in the printed image.
(77) Note that the printer driver unit 13a resides on the application layer of the computer used as the POS terminal 1a, and is embodied by a driver program, a CPU that executes the program, and RAM or other memory device, for example.
(78) The command merging unit 14a (merging unit) runs a process adds the text data acquired by the filter driver unit 12a to the print data generated by the printer driver unit 13a. This process is described further below. Note that the command merging unit 14a resides on the application layer of the computer used as the POS terminal 1a, and is embodied by a program defining the process, a CPU that executes the program, and RAM or other memory device, for example.
(79) The receipt printer 2a is a printer that prints receipts, coupons, or other objects as instructed by the POS terminal 1a. The printing method may be inkjet, thermal, or other printing method. The receipt printer 2a prints the print objects on roll paper, for example, and cuts the paper with a cutter after printing is completed.
(80) The receipt printer 2a is an intelligent printer in this example, and, in addition to a print control unit as used in a typical printer, includes a data processing device (computing device) similar to a personal computer.
(81) Functional components of the receipt printer 2a include, as shown in
(82) The text data processing unit 21a is embodied by the data processing device described above, that is, a CPU, ROM, RAM, hard disk drive, and other peripheral components, and a program defining the process content. The text data processing unit 21a receives print data sent from the PUS terminal 1a, and executes processes to extract text data from the print data, and send the acquired text data to the sales information analysis server 3a.
(83) The print control unit 22a is the control unit of the printer, and controls the printing process based on the received print data. The print control unit 22a is embodied by a program and a CPU, ROM, RAM, ASIC, and NVRAM, for example.
(84) The print mechanism unit 23a operates as controlled by the print control unit 22a, and prints on paper. The print mechanism unit 23a includes a printhead, print media conveyance device, and cutter, for example.
(85) The sales information analysis server 3a is a server computer that receives the text data sent from the receipt printer 2a, and uses the received text data to execute a sales analysis process and electronic receipt issuing process.
(86) In the sales analysis process, information such as the names, quantities, and prices of the purchased products, the store where the products were purchased, the date of sale, and the total purchase amount that is printed on the receipt are acquired from the text data, and used to analyze variations in sales based on the time of day, seasonal variations, and regional (location) variations, for example. Because essential information printed on the receipt is extracted from the text data in the electronic receipt issuing process, a screen showing the content of the requested receipt can be provided to the terminal device in response to user access from the terminal device.
(87) The processes described below are executed when printing a receipt is requested in the printing system according to this embodiment of the disclosure.
(88) As described above, the print request data is generated according to the GDI specification. Because GDI functions on the OS kernel layer are called when the print request data is passed to the printer driver unit 13a, the filter driver unit 12a captures the print request data where the GDI function is called.
(89) The filter driver unit 12a then sequentially interprets the commands in the received print request data (step S2a in
(90) The filter driver unit 12a then sends the received print request data to the printer driver unit 13a (step S4a in
(91) The printer driver unit 13a interprets the transmitted print request data, rasterizes the print objects to be printed in the receipt, and generates print data using commands for the receipt printer 2a with the content to be printed as raster data. The resulting print data is then sent to the destination set in the printer driver unit 13a. The command merging unit 14a is previously set as the destination in this example.
(92) Referring again to
(93) More specifically, the command merging unit 14a sorts the text data representing the print objects into the order the objects appear on the receipt based on the printing position information in the print data. Yet more specifically, the command merging unit 14a first sorts the text data vertically starting from the top of the receipt to the bottom, and then sorts any objects at the same vertical (lengthwise) position from left to right on the receipt.
(94) Next, the command merging unit 14a generates an add command to add the sorted text data to the generated print data (step S6a in FIG. 7). In this process, the command merging unit 14a generates an add command that adds the text data to the print data using the command language of the receipt printer 2a so that the print data can be understood (interpreted) by the print control unit 22a of the receipt printer 2a and the text data is not printed by the receipt printer 2a.
(95) More specifically, in one example, this process of adding text data can be done using page mode commands. Because the print objects contained in the print data are normally expressed by raster data as described above, the receipt printer 2a prints the received raster data sequentially and does not store the data. However, in the page mode, the data for the print objects in a specific area (such as one page or one receipt) are stored (buffered) to memory in the receipt printer 2a and then used to print that area (page or receipt). The print objects also do not need to be expressed by raster data in the page mode, and may be text data. Also in the page mode, commands are written in the print data starting with a page mode registration command (start page mode command), followed by the data for the print objects, and commands for executing the printing process.
(96) In this example, page mode commands are used to add a page mode registration command, the resorted text data acquired as described above, and a cancel command sequentially to the print data generated as described above.
(97)
(98) The block identified by reference numeral A1a in
(99) Note that other commands may be used to add text data. In a second example, text data may be added using text data of a character count not exceeding the printing width, and a clear command, in the text mode. More specifically, the command merging unit 14a first prepares a start text mode command. Next, the command merging unit 14a determines the number of characters can fit on one line within the printing width, sequentially extracts and adds this number of characters of text data from the resorted text data to the start text mode command, and then adds a clear command. This number of characters of text data and clear commands are repeatedly added until there is no more text data. The add command is the data from the generated start text mode command to the clear command at the end.
(100) When an add command is generated in this way, the command merging unit 14a executes a process to add the add command to the print data generated by the printer driver unit 13a (step S7a in
(101) The command merging unit 14a inserts the add command to the place indicated by reference numeral A1a in
(102) When this addition process ends, the command merging unit 14a sends the print data resulting from the add process to the receipt printer 2a (step S8a in
(103) This completes processing in the POS terminal 1a.
(104) The process executed by the text data processing unit 21a of the receipt printer 2a is described next.
(105) The text data processing unit 21a first receives the print data sent from the command merging unit 14a (step S11a in
(106) If the text data processing unit 21a determines by this process that there is no text data, it outputs the print data directly to the print control unit 22a (step S14a in
(107) Using the example of print data shown in
(108) In the above example that uses a text mode and adds a specific number of text data objects and clear commands, the text data portion is extracted and stored, and all of the print data is sent to the print control unit 22a.
(109) Alternatively, after acquiring and storing the text data, the text data processing unit 21a may delete the text data portion from the print data, and then send the remaining print data to the print control unit 22a. In this event, the portion added by the adding process is deleted.
(110) When acquiring and storing the text data (S13a) and sending the received print data (S14a) are completed, the text data processing unit 21a sends the stored text data to the sales information analysis server 3a (step S15a in
(111) Because the sales information printed on the receipts is included in the transmitted text data, the sales information analysis server 3a can execute processes to analyze the information or issue electronic receipts.
(112) This completes processing by the text data processing unit 21a.
(113) The process executed by the print control unit 22a and print mechanism unit 23a is described next.
(114) The print data transmitted from the text data processing unit 21a is first received by the print control unit 22a (step S21a in
(115) The print control unit 22a controls the print mechanism unit 23a according to the interpreted commands, and controls the print mechanism unit 23a to print on the paper (step S23a in
(116) The text data that was added by the text data adding step is then deleted by the command following the text data, and is not printed by the print mechanism unit 23a (step S24a in
(117) In the print data shown in
(118) In the above example that adds a specific amount of text data and a clear command using a text mode, the specific amount of text data is deleted by the immediately following clear command and is not printed.
(119) Only the portion that should be printed as a receipt is therefore printed, and the data that is added for acquiring the sales information is not printed. When the added text data is deleted by the text data processing unit 21a, only the portion that should be printed as a receipt is printed.
(120) Processing by the print control unit 22a and print mechanism unit 23a thus ends.
(121) Because the text portion added to the print data by the adding process described above is expressed by commands that can be interpreted by the receipt printer 2a and is processed without affecting the printing process, the receipt printer 2a can print receipts without throwing an error even if the receipt printer 2a is not a so-called intelligent printer and does not have the portion corresponding to the text data processing unit 21a.
(122) As described above, text data for the text portion of the print objects is added to the print data by functions of the filter driver unit 12a and command merging unit 14a in the printing system according to this embodiment even if the POS application unit 11a and printer driver unit 13a process conventional print requests and print commands. Modifying the existing POS application and printer driver is therefore not necessary, and functionality can be added while not changing the appearance of the printout, when adding functions for adding text data and text data analysis to an existing system.
(123) Furthermore, when the printer driver of an existing system sends the print content as raster data to the printer, there is also no concern about the printouts of the existing system changing when adding the functions described above because there is no need to change existing processes to add new functionality.
(124) Furthermore, because text data is added to the print data, the information printed on a receipt can be easily extracted on the printer side.
(125) Furthermore, because the printer driver unit 12 acquires the text data to add to the print data before rasterizing the print objects, processing is simple and the printed information can be accurately acquired.
(126) Furthermore, because the command merging unit 14a adds the text data after first sorting it to the order printed on the receipt, the text data can be easily used by the sales information analysis server 3a or other device.
(127) Furthermore, because the command merging unit 14a uses commands in the language of the receipt printer 2a to incorporate text data in the print data, the data can be easily interpreted on the receipt printer 2a side and the print control unit 22a will not throw an error.
(128) A POS system is used as an example in the embodiment described above, but the disclosure is not so limited to use in POS systems. For example, the disclosure can be used in systems that execute a specific application including producing printouts from a printer, such as systems used in hospitals and package delivery companies, and is particularly effective when modifying the existing application program is difficult.
(129) The disclosure being thus described, it will be obvious that it may be varied in many ways. Such variations are not to be regarded as a departure from the spirit and scope of the disclosure, and all such modifications as would be obvious to one skilled in the art are intended to be included within the scope of the following claims.