Print controlling apparatus and computer-readable recording medium storing print control program
09836677 · 2017-12-05
Assignee
Inventors
Cpc classification
G06F3/121
PHYSICS
G06K15/4045
PHYSICS
G06F3/1285
PHYSICS
International classification
G06K15/00
PHYSICS
Abstract
A print controller includes a communication section configured to communicate with a printer, a communication controlling section configured to request transmission of a transmission command for acquiring response data to the printer, and a printing data processing section configured to process printing data on a host-based system and transmit the processed printing data to the printer via the communication section. During communication on the host-based system, the printing data processing section transmits the transmission command to the printer via the communication section and acquires the response data returned from the printer in response to the transmission command. The communication controlling section processes the acquired response data as response data corresponding to the transmission command.
Claims
1. A print controlling apparatus for controlling a printer, the print controlling apparatus comprising: a communication interface configured to communicate with the printer; and a processor constituting a communication controlling section configured to request transmission of a transmission command for acquiring response data to the printer, and a printing data processing section configured to process printing data on a host-based system and transmit the processed printing data to the printer via the communication interface, wherein the printing data processing section, during communication on the host-based system, transmits the transmission command to the printer via the communication interface and acquires the response data returned from the printer in response to the transmission command, the communication controlling section processes the acquired response data as response data corresponding to the transmission command, the communication controlling section specifies a storage location of the response data to the printing data processing section, the printing data processing section receives the response data from the printer and stores the response data in the specified storage location, the communication controlling section acquires the response data from the specified storage location, and the printing data processing section performs control so that the printing data processing section abstains from performing other communication processes due to exclusive control during the communication on the host-based system including the transmission of the transmission command from the printing data processing section to the printer and the acquisition of the response data returned from the printer to the printing data processing section.
2. The print controlling apparatus according to claim 1, further comprising: a spooler configured to control an output order of a plurality of pieces of printing data, wherein the spooler calls the printing data processing section in response to a request from the communication controlling section.
3. The print controlling apparatus according to claim 1, wherein the printing data processing section is realized by a series of methods, which are a method startPrintJob of starting printing, a method writePrintData of processing and transmitting printing data, and a method endPrintJob of ending the printing, and transmission of the transmission command and acquisition of the response data are performed by the method writePrintData in processes performed by the series of methods.
4. The print controlling apparatus according to claim 1, wherein the communication interface is an interface compatible with a USB standard.
5. The print controlling apparatus according to claim 1, wherein the communication controlling section uses a specific area of the printing data to specify the transmission command to the printing data processing section.
6. A non-transitory computer-readable recording medium storing a print control program for allowing a computer to control a printer, allowing the computer to realize a communication controlling function of requesting transmission of a transmission command for acquiring response data to the printer; and a printing data processing function of processing printing data on a host-based system and transmitting the processed printing data to the printer via a communication interface, wherein the printing data processing function, during communication on the host-based system, allows transmission of the transmission command to the printer via the communication interface and acquisition of the response data returned from the printer in response to the transmission command, the communication controlling function processes the acquired response data as response data corresponding to the transmission command, the communication controlling function specifies a storage location of the response data, the printing data processing function receives the response data from the printer and stores the response data in the specified storage location, the communication controlling function acquires the response data from the specified storage location, and the printing data processing function performs control so that the printing data processing function abstains from performing other communication processes due to exclusive control during the communication on the host-based system including the transmission of the transmission command to the printer and the acquisition of the response data returned from the printer.
Description
BRIEF DESCRIPTION OF THE DRAWINGS
(1) The invention will be described with reference to the accompanying drawings, wherein like numbers reference like elements.
(2)
(3)
(4)
(5)
(6)
(7)
(8)
DESCRIPTION OF EXEMPLARY EMBODIMENTS
(9) Embodiments of the invention will be described below according to the following order. 1. First Embodiment (1) Configuration of Print Controller (2) Configuration of Software Functions (3) Method for Controlling Printing (4) Operation and Advantages 2. Other Embodiments
1. First Embodiment
(10) (1) Configuration of Print Controller
(11)
(12) The display 11 includes a display section 111 for displaying an image and a touch screen module 112 for receiving an operation of a user. The display section 111 includes, for example, a liquid crystal display (LCD) and a driver circuit for driving the LCD and is connected to the video card 13. The video card 13 connects the bus 15 to the display 11. The touch screen module 112 includes an electrostatic capacitance-type sensor or a resistive film-type sensor and outputs to the I•OIF 14 a voltage value corresponding to the position of the operation performed by the user.
(13) The operation key 12 includes push buttons and is a user interface for receiving an operation of a user.
(14) The I•OIF 14 outputs to the bus 15 a signal generated in response to the operation of the user via the touch screen module 112 or via the operation key 12.
(15) The bus 15 is connected to the CPU 16, the external storage device 17, the I•OIF 14, the RAM 18, the ROM 19, the video card 13, and the USBIF 20. The bus 15 includes a chipset (not shown) and controls communication between the CPU 16 and the other devices.
(16) The CPU 16 loads to the RAM 18 a program stored in the external storage device 17 or the ROM 19 and executes the program, thereby integrally controlling the drive of the terminal 10. The ROM 19 stores a BIOS program which is executed when the CPU 16 is started. The RAM 18 serves as a work area in which programs and data to be processed by the CPU 16 are expanded.
(17) The external storage device 17 stores an operation system (OS) program 17a for imparting a function as an operation system (OS) to the CPU 16, an application program 17b for imparting functions of applications to the CPU 16, and a printer driver program (PDRV program) 17c for controlling a printer 200 in cooperation with the OS. The OS program 17a is, for example, Windows 10 (Windows is a registered trademark). The application program 17b allows the CPU 16 to realize functions of applications including drawing software, PDF file viewers, browsers, and web applications. The PDRV program 17c is a V4 printer driver and has an extended function.
(18) The USBIF 20 includes a USB controller and a USB cable and connects the bus 15 to the printer 200. In this embodiment, a communication section is implemented by the USBIF 20.
(19) The printer 200 is an ink jet printer or a laser printer. The printer 200 is compatible with the PDRV program 17c stored in the external storage device 17. The drive of the printer 200 is controlled in accordance with printing data and a transmission command SC transmitted from the terminal 10 via the USBIF 20. The internal configuration of the printer 200 is known, and the description thereof is thus omitted.
(20) (2) Configuration of Software Functions
(21)
(22) The application 160 generates printing data including images and sentences. The printing data is assumed to be compatible with an XML paper specification (XPS) format, but the printing data may be compatible with formats other than the XPS format. The application 160 has a function of issuing a maintenance command to the printer 200. The maintenance command is a command that allows the printer 200 to execute processes including the acquisition of status information indicating a remaining ink level, cleaning, and the like. The command issued by the application 160 is hereinafter referred to as a transmission command SC.
(23) The OS 170 includes a spooler 171 and a USB port monitor 172 and controls the printer 200 in cooperation with the printer driver 180. The spooler 171 controls the output process of data (spool data) during a printing process and the transmission and reception of data in response to a request from the printer driver 180. The USB port monitor 172 monitors the port number used when the application 160 performs communication, and the USB port monitor 172 performs actual communication using the port number during the printing process and bidirectional communication.
(24) The printer driver 180 includes an higher communication module 181, a graphics module 182, and an extension function section 183. The higher communication module (communication controlling section) 181 receives the printing data from the application 160 and performs receiving and sending of control data (transmission command SC, response data RD) between the higher communication module 181 and the application 160. During the printing process, the graphics module 182 converts the printing data generated by the application 160 into data of a format with which the printer 200 is compatible. The extension function section 183 includes modules for extending functions executed during the printing process and the bidirectional communication.
(25) The extension function section 183 includes a plurality of functional modules for each function thereof. Each functional module includes a script file written in JavaScript and an Extensible Markup Language (XML) file. The XML file serves as a schema defining each function, and the script file operates based on the XML file, thereby providing an extended function to the printer driver 180. Each functional module is called by the spooler 171, thereby being executed.
(26)
(27) The host-based printing processing is the function of processing pages or editing the output order of the pages, and the like for spool data output from the spooler 171 via the USBIF 20. This function is provided to Windows 8.1 and subsequent versions. As functions for realizing the host-based printing process, the USB Bidi extender 184 has a method (function) startPrintJob( ) of executing a process relating to setting an initial value necessary for printing, a method (function) writePrintData( ) of processing the spool data and executing the process of transmitting the spool data to the printer 200, and a method (function) endPrintJob( ) of executing processes after the printing has ended.
(28) The methods of the USB Bidi extender 184 are read by the spooler 171 in the following order: startPrintJob( ) writePrintData( ) and endPrintJob( ) so as to execute a series of the host-based printing processes. The spooler 171 does not accept other processes due to exclusive control while the series of processes (startPrintJob( ) writePrintData( ) and endPrintJob( ) is executed. The function which the terminal 10 (CPU 16) realizes by the functions startPrintJob( ) writePrintData( ) and endPrintJob( ) of the USB Bidi extender 184 is hereinafter also referred to as a printing data processing section 185.
(29) (3) Method for Controlling Printing
(30) Next, a method for controlling printing by using the extended function will be described.
(31) At step S11, the application 160 issues the transmission command SC to request the printer 200 for status information (the response data RD). For example, the status information is information allowing the application 160 to display a UI screen indicating the status of the printer 200.
(32) At step S12, the higher communication module 181 performs a process to transmit the transmission command SC to the printer 200.
(33) At step S121, the higher communication module 181 generates a transmission data structure from the transmission command SC. The transmission data structure is structure data including the transmission command SC and auxiliary information. The transmission command included in the transmission data structure is similar to the transmission command SC issued by the application 160. The auxiliary information includes an identifier indicating whether or not the transmission data structure is printing data and reference information to which the printing data processing section 185 refers when communication using the transmission command SC and the response data RD is performed.
(34) The transmission command included in the transmission data structure is hereinafter denoted by a different reference number (310 in
(35)
(36) At step S122, the higher communication module 181 requests that the spooler 171 processes the transmission data structure 300 on the host-based system. In response to the request from the higher communication module 181, the spooler 171 sequentially calls the functions StartPrintJob( ) writePrintData( ) and endPrintJob( ) from the USB Bidi extender 184 in order to process the transmission data structure 300 (steps S13, S15, and S18).
(37) First, at step S13, the spooler 171 calls the function startPrintJob( ). The called function startPrintJob( ) allows the CPU 16 (printing data processing section 185) to set an initial value necessary for the host-based system (step S14).
(38) At step S15, the spooler 171 calls the function writePrintData( ). In this embodiment, the called function writePrintData( ) allows the transmission of the transmission command SC to the printer 200 and the acquisition of the response data RD from the printer 200 (step S16) to be performed.
(39)
(40) At step S161, the printing data processing section 185 determines whether or not the identifier 320 is included in the transmission data structure 300.
(41) If the identifier 320 is included in the transmission data structure 300 (YES at step S161), the printing data processing section 185 acquires the transmission command 310 and the reference information 330 from the transmission data structure 300 at step S162.
(42) At step S163, the printing data processing section 185 transmits the transmission command SC obtained from the transmission data structure 300 to the printer 200 via the USBIF 20. The printing data processing section 185 controls the USB port monitor 172 and transmits a transmission command SC310 to the printer 200. When the printer 200 receives the transmission command SC310 via the USBIF 20, the printer 200 interprets the transmission command SC and generates the response data RD corresponding to the transmission command SC.
(43) At step S164, the printing data processing section 185 acquires the response data RD from the printer 200. The printer 200 transmits the response data RD to the terminal 10 via the USBIF 20 (step S17 in
(44) If the acquisition of the response data RD from the printer 200 has not been completed (NO at step S165), the printing data processing section 185 continues acquiring the response data RD (step S164). Completion of the acquisition of the response data RD is determined by transmitting an “end identifying command 331” obtained from the transmission data structure 300 by the printing data processing section 185 to the printer 200 via the USBIF 20. If the end identifying command response data RD332 is not returned from the printer 200 in response to the end identifying command 331, the printing data processing section 185 determines that the acquisition of the response data RD from the printer 200 has not ended. On the other hand, if the end identifying command response data RD332 is returned from the printer 200 in response to the end identifying command 331, the printing data processing section 185 determines that the acquisition of the response data RD from the printer 200 has been completed.
(45) If the acquisition of the response data RD has been completed (YES at step S165), the printing data processing section 185 stores the response data RD in the response data storage area of the RAM 18 at step S166. The location of the response data storage area is determined based on a reference destination indicated by the location 333 of the response data storage area obtained from the transmission data structure 300.
(46) If at step S161, the printing data processing section 185 determines that the identifier is not included in the transmission data structure 300 (NO at step S161), the printing data processing section 185 determines data received from the higher communication module 181 to be normal printing data at step S167, and host-based printing will be performed.
(47) Referring back to
(48) When the processes by the spooler 171 have ended, the higher communication module 181 acquires at step S20 the response data RD from the response data storage area specified by the transmission data structure 300.
(49) At step S21, the higher communication module 181 sends the acquired response data RD to the application 160. For example, the application 160 displays a UI screen in which the status of the printer 200 is displayed based on the response data RD acquired from the higher communication module 181.
(50) (4) Operation and Advantages
(51) As described above, in the first embodiment, the host-based printing process by the extension function section 183 is also used to synchronize the transmission command SC with the response data RD. In the host-based printing process, interruption by, for example, other applications is inhibited before the series of functions startPrintJob( ) writePrintData( ) and endPrintJob( ) has been executed. Therefore, processes from the transmission of the transmission command SC to the acquisition of the response data RD can be performed as a series of processes.
(52) The function by the printing data processing section 185 is called by the spooler 171 and is then executed. Therefore, even when the application 160 issues transmission commands SC in succession, the spooler 171 starts transmitting a next transmission command SC and acquiring next response data RD after the acquisition of response data RD corresponding to a preceding transmission command SC has ended (i.e., endPrintJob( ) has ended). As a result, the series of processes including the transmission of the transmission command SC and the acquisition of the response data RD is continuously performed, so that interruption of the response data RD can be reduced.
(53) The higher communication module 181 specifies an area in which the response data RD is to be stored, so that the processing load necessary for acquiring the response data RD can be reduced.
2. Other Embodiments
(54) The higher communication module 181 may be any module as long as the module uses a specific area in the printing data to request the spooler 171 to perform processes. The specific area may be, for example, a comment field included in the printing data, and the transmission command SC and the reference information may be written in the comment field to request the spooler 171 to perform the processes. The spooler 171 can refer to the comment field included in the printing data to determine that the printing data is the transmission command SC.
(55) The invention is not limited to the above-described embodiments. It will be appreciated by those skilled in the art that the following are an embodiment of the invention.
(56) The mutually replaceable members, configuration, and the like disclosed in the above-described embodiments can be applied through an appropriate change in the combination thereof.
(57) Although not disclosed in the above-described embodiments, members, configuration, and the like in the related art mutually replaceable with the members, configuration, and the like disclosed in the above-described embodiments can be applied through an appropriate replacement or a change in the combination thereof.
(58) Although not disclosed in the above-described embodiments, members, configuration, and the like that are assumed by those skilled in the art based on the related art to be replacements for the members, configuration, and the like disclosed in the above-described embodiments can be applied through an appropriate replacement or a change in the combination thereof.