[ summary of the invention ]
In order to solve the technical problem that the printing performance of a CUPS (compute unified power system) in the existing Linux operating system is poor after the CUPS processes a document, the invention provides a method and a device for processing a print driver in the Linux operating system, which can perform custom editing on the document processed by the CUPS and forcibly convert the document into a PCL (personal computer) language, so that an image forming device can better execute the printing operation.
In order to achieve the above object, the technical solution provided by the present invention comprises:
one aspect of the present invention provides a method for processing a print driver in a Linux operating system, comprising:
receiving a job document sent by application software;
converting the job document into an intermediate document through a general driving module in the Linux operating system, and inserting instruction information corresponding to a printing language through an additional printing language file in the process of converting the job document into the intermediate document so that the intermediate document meets the requirement of a preset printing language specification;
the filtering control module carries out self-defining processing on the intermediate file, automatically converts the intermediate file into a printing file output to an image forming device through a printing language conversion module in the Linux operating system, and the corresponding printing language of the printing file is PCL language.
Preferably, the method further comprises: and in the process of inserting the additional printing language file into the instruction information corresponding to the printing language, inserting preset identification information, wherein the preset identification information is provided with corresponding printing instruction information in the filtering control module correspondingly.
Preferably, the method further comprises: and controlling a printing state monitor in a Linux operating system through the filtering control module, and inquiring the state information of the image forming devices and the current printed job through the printing state monitor, wherein the printing state monitor can simultaneously manage the state information of a plurality of image forming devices.
Preferably, the method further comprises: and judging whether the image forming device matched with the print driver in the Linux operating system meets a preset condition or not through the filter control module, and when the image forming device meets a preset requirement, sending a print document comprising a PCL language to the image forming device by the print driver.
Further preferably, the predetermined condition includes: and whether at least one of the name, the equipment ID and the manufacturer of the image forming apparatus is consistent with the information stored in the filtering control module.
Preferably, the filtering control module splits the intermediate document into a plurality of jobs, converts the jobs into documents in PCL language through the printing language conversion module, and merges the converted documents in PCL language into the printing document output to the image forming apparatus.
The second aspect of the present invention further provides a print driver processing apparatus in a Linux operating system, including:
the document receiving unit is used for receiving the job document sent by the application software;
the universal driving module is used for converting the job document into an intermediate document, and in the process of converting the job document into the intermediate document, instruction information corresponding to a printing language is inserted into the additional printing language file, so that the intermediate document meets the requirement of a preset printing language specification;
and the filtering control module is used for performing custom processing on the intermediate file, automatically converting the intermediate file into a printing file output to an image forming device through a printing language conversion module in the Linux operating system, wherein the printing language corresponding to the printing file is PCL language.
Preferably, the additional printing language file is further used for inserting predetermined identification information in the process of inserting the instruction information corresponding to the printing language, and the predetermined identification information corresponds to the corresponding printing instruction information set in the filtering control module.
Preferably, the filtering control module is further configured to control a print status monitor in a Linux operating system, and query the image forming apparatuses and status information of a currently printed job through the print status monitor, where the print status monitor is capable of managing status information of a plurality of image forming apparatuses at the same time.
Preferably, the filtering control module is further configured to determine whether the image forming apparatus cooperating with a print driver in the Linux operating system satisfies a predetermined condition, and the print driver sends a print document including PCL language to the image forming apparatus only when the image forming apparatus satisfies a predetermined requirement.
Further preferably, the predetermined condition includes: and whether at least one of the name, the equipment ID and the manufacturer of the image forming apparatus is consistent with the information stored in the filtering control module.
Preferably, the filtering control module is further configured to split the intermediate document into a plurality of jobs, the plurality of jobs are converted into PCL-language-included documents by the printing language conversion module, and the filtering control module is further configured to merge the plurality of converted PCL-language documents into the printing document output to the image forming apparatus.
The third aspect of the present invention also provides an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement a method as claimed in any one of the above.
The fourth aspect of the present invention also provides a computer-readable storage medium characterized by a computer program stored thereon; the computer program is executed by a processor to implement a method as claimed in any one of the above.
By adopting the technical scheme provided by the invention, at least one of the following beneficial effects can be obtained:
1. even if the CUPS in the Linux operating system does not process the document well enough, the filtering control module is combined with the additional printing language file, the received job document is automatically converted into the document of the PCL language by the printing driver, and the filtering control module can be combined with the characteristics of the image forming device, correspondingly, after the intermediate document converted by the CUPS, the printing instruction is converted into the PCL language meeting the requirements of the image forming device; thus, even if the PS processing performance of the common image forming device is poor, the printing quality and the printing speed can not be reduced when the common image forming device prints the job in the Linux operating system environment.
2. Inserting preset identification information into the job document by the additional printing language, wherein the preset identification information is provided with corresponding printing instruction information in the filtering control module correspondingly; the actual printing instruction information is set in the filtering control module, so that the confidentiality requirement can be better met, and the instruction information inserted by the printing driver is not easy to crack by a malicious third party.
3. The Linux operating system is provided with a print driver once, and can monitor the state information of the plurality of image forming devices simultaneously through the print driver, so that the state information of the plurality of image forming devices is more visual, and the print drivers corresponding to the image forming devices do not need to be installed.
4. Identification of the attribute of the image forming apparatus is added to the print driver, which prevents unauthorized image forming apparatuses from leaking user information.
5. In the process of performing language conversion on the intermediate document, splitting one print job into a plurality of (N) print jobs, processing the jobs simultaneously in a multithread mode, performing corresponding integration after the processing is completed, and then sending the jobs to an image forming device; the processing time of the job document in the computer is theoretically approximately equal to 1/N of the previous time, and the printing performance can be better improved.
[ detailed description ] embodiments
For better understanding of the technical solutions of the present invention, the following detailed descriptions of the embodiments of the present invention are provided with reference to the accompanying drawings.
It should be understood that the described embodiments are only some embodiments of the invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Examples
The present embodiment provides a method for processing a print driver in a Linux operating system, where the Linux operating system in the present embodiment includes but is not limited to: a winning bid kylin operating system, a silver river kylin operating system, a Chinese Kefand operating system and the like; the print driver processing method provided by this embodiment overcomes the technical problems that the existing print driver has a slow document processing speed and/or a poor processing performance of ps (postscript) instructions, and causes a slow printing speed of the image forming apparatus by setting an additional print language file and a filter control module in advance in the process of developing the print driver of the image forming apparatus. The image forming apparatus mentioned hereinafter may be a single-function printer with only a printing function, or may be a multi-function device integrated with at least one of scanning, copying, and facsimile functions.
As shown in fig. 1, the print driving processing method provided by the present embodiment includes:
s110, receiving a job document sent by application software; the print driver receives a job document to be printed from an application program, for example, a user opens a copy of the job document in a PDF reader developed by Adobe or fuxin corporation, a WPS developed by jinshan corporation, or Office software developed by microsoft corporation, selects a print driver provided in this embodiment, and then the print driver mentioned in this embodiment can receive the job document sent by the application program.
And S120, converting the job document into an intermediate document through a general driving module in the Linux operating system, and inserting instruction information corresponding to a printing language through an additional printing language file in the process of converting the job document into the intermediate document so that the intermediate document meets the requirement of a preset printing language specification.
When a user clicks a print option in an application program and confirms printing, the print driver may call a general driver module in the Linux operating system to convert a job document into an intermediate document, where the general driver module mentioned in this embodiment may be a built-in CUPS in the Linux operating system, a specific CUPS is determined according to a version of the Linux operating system or a CUPS version downloaded by the user from an open source software platform, and this embodiment does not specifically limit the built-in CUPS, and certainly, the print driver corresponding to the image forming apparatus provided in this embodiment may also be a built-in general driver module. Since the print driver provided by the present embodiment also needs to be installed in the Linux operating system, the technical solution of the present embodiment can be implemented as long as the job document can be converted into the intermediate document by the general-purpose driver module, regardless of the design in that manner. It should be noted that the intermediate file mentioned in this embodiment refers to a document obtained by converting the general driver module or a document added with an instruction that can be recognized by the image forming apparatus, on the basis of the original format of the job document corresponding to the application program; it is not mandatory that one output document be visible to the user.
In the process of converting the job document into the intermediate document, inserting the instruction information corresponding to the printing language by adding a Postscript Description (PPD) file, so that in the implementation process of converting the job document into the intermediate document by using a universal driving module (for example, a CUPS), if the CUPS converts the job document into a format, a command and a machine language which can be identified by an image forming device, even if the CUPS does not have good enough processing, for example, functions such as double-sided printing function, poster printing, watermark inserting and the like, the converted intermediate document can be enabled to correspond to the corresponding functions by adding the printing language file; such that the intermediate document meets the predetermined print language specification requirements. The additional printing language file provided by this embodiment adopts PCL format to write PPD file, can control the switch of the whole printing process, and can control UI (user interface) of the print driving attribute; compared with a single CUPS, the method can realize the expansibility of the printing driving function in a common Linux operating system, and particularly add some self-defining functions according to the image forming device.
In a preferred embodiment of this embodiment, during the process of converting the job document into the intermediate document by the general-purpose driver module (e.g., CUPS), the printing language of the job document is not converted; the document format output by a common application program comprises PDF or PS, and the intermediate document converted by the general driver module is set to be PDF or PS correspondingly.
S130, the filtering control module carries out self-defining processing on the intermediate file, automatically converts the intermediate file into a printing file output to the image forming device through a printing language conversion module in the Linux operating system, and the corresponding printing language of the printing file is PCL language.
In the embodiment, no matter which format the printing language of the intermediate document is, the intermediate document is automatically converted into the PCL language through the printing language conversion module, so that the subsequent image forming device can quickly complete the printing operation. The printing language conversion module can be a native Ghosstscript of a Linux system (which is used in many printing industries and is used for converting a document language format, such as CMYK format pictures converted from pdf); in the technical solution provided by this embodiment, conversion to the PCL language is required, so that a ghost script is integrated in a print driver, and through configuration of parameter values in the ghost script, an intermediate document received can be directly and automatically converted into the PCL language format no matter the intermediate document is in the PDF format or the PS format; in the development process of the print driver, which problems occur when the existing ghost script is subjected to print language conversion is tested in advance, the filtering control module (generally called a Filter module by a developer) performs custom processing, and the instructions and/or parameters which do not meet the expected requirements in the document after the ghost script is converted are automatically corrected. Of course, if the test finds that the document after the print language conversion by the Ghostscript can be well printed by the corresponding image forming apparatus, the modification corresponding to the custom processing is none. The print driver provided by the embodiment can directly and automatically perform custom processing on the intermediate file when executing the print processing, and the filtering control module automatically converts the intermediate file into a document in a PCL language through the print language conversion module in the Linux operating system and then outputs the document to the image forming device.
In the technical solution provided by this embodiment, the additional print language file in the print driver is provided with predefined identification information, and the filter control module is also provided with an additional function in advance, where the additional function is configured to enable the image forming apparatus to complete a specified function.
Therefore, with the technical solution provided by this embodiment, even if the CUPS in the Linux operating system does not process the document well enough, the filter control module is used to combine the additional print language file, the print driver automatically converts the received job document into the document in the PCL language, and the filter control module can combine the characteristics of the image forming apparatus to correspondingly convert the print instruction into the PCL language meeting the requirements of the image forming apparatus after the CUPS converts the intermediate document; thus, even if the PS processing performance of the common image forming device is poor, the printing quality and the printing speed can not be reduced when the common image forming device prints the job in the Linux operating system environment.
Preferably, the method provided by this embodiment further includes: and in the process of inserting the additional printing language file into the instruction information corresponding to the printing language, inserting preset identification information, wherein the preset identification information is provided with corresponding printing instruction information in the filtering control module correspondingly.
Therefore, the additional printing language inserts the preset identification information into the job document, and the preset identification information is provided with corresponding printing instruction information in the filtering control module; the actual printing instruction information is set in the filtering control module, so that the confidentiality requirement can be better met, and the instruction information inserted by the printing driver is not easy to crack by a malicious third party. For example, the print driver provided in this embodiment is provided with some special functions, for example, watermark information is added to the finally output print document or the print document is printed on a special-sized paper, but considering that the user may not want the special functions or information to be known by a malicious third party, only one piece of identification information may be inserted into the job document in the print additional print language, and the identification information may not directly embody an actual print operation instruction, but the identification information may be recognized by the filter control module in the print driver, and the filter control module may execute a print instruction corresponding to the identification information.
Preferably, the method provided by this embodiment further includes: by controlling the print status monitor in the Linux operating system through the filter control module and querying the image forming apparatuses and the status information of the currently printed job through the print status monitor, the print status monitor can simultaneously manage the status information of the plurality of image forming apparatuses (one embodiment, as shown in fig. 3). Therefore, according to the technical scheme provided by the embodiment, the print driver is installed in the Linux operating system once, and the state information of the plurality of image forming devices can be monitored simultaneously through the print driver, so that the state information of the plurality of image forming devices is more intuitive, and the print drivers corresponding to the devices with various image shapes do not need to be installed.
The present embodiment further preferably integrates the print status monitor into the print driver, and the application can know whether the image forming apparatus is currently in a printable status through the print driver, and if the image forming apparatus is not in the printable status (for example, a paper out status, a paper jam status, etc.), the print driver (print driving unit) may choose not to issue the job. In an alternative embodiment, the converted print job is automatically sent to the image forming apparatus when the image forming apparatus is available. In some security fields, for example, printing of invoice data, hospital bank documents and other documents, a job document may need to be applied for printing, and if the image forming apparatus is in a non-printable state and issues a job, the job may be lost, so that a subsequent user needs to apply for again; the solution provided by the present embodiment may improve this problem.
Preferably, in the above method provided by this embodiment, a current unstable factor still exists in the current Linux operating system is considered. For example, in the case that the Linux operating system is halted or unexpectedly shut down due to an external reason, the print driver (print driver unit) provided in this embodiment may automatically prompt the user to resend the print job after the computer installed with the Linux operating system is restarted through the error recovery mechanism.
Preferably, the method provided by this embodiment further includes: the filtering control module judges whether the image forming device matched with the printing driver in the Linux operating system meets a preset condition or not, and the printing driver sends the printing document comprising the PCL language to the image forming device when the image forming device meets a preset requirement. Further preferably, the predetermined condition includes: whether or not at least one of the name, device ID (number), and manufacturer information of the image forming apparatus is identical to the information stored in the filter control module. The condition provided by the embodiment may be one or more conditions, and in the case of multiple conditions, whether the predetermined condition is satisfied may be that any one or more of the multiple conditions needs to be satisfied. By adding identification of the attribute of the image forming apparatus in the print driver, this prevents unauthorized image forming apparatuses from leaking user information.
Preferably, in the method provided by this embodiment, the filtering control module first splits the intermediate document into a plurality of jobs, converts the jobs into documents in PCL language through the printing language conversion module, and then merges the plurality of converted PCL language documents into a printing document output to the image forming apparatus.
In the process of performing language conversion on the intermediate document, splitting one print job into a plurality of (N) print jobs, processing the jobs simultaneously in a multithread mode, performing corresponding integration after the processing is completed, and then sending the jobs to an image forming device; the processing time of the job document in the computer is theoretically approximately equal to 1/N of the previous time, and the printing performance can be better improved.
As shown in fig. 2, the embodiment further provides a print driver processing apparatus in the Linux operating system, in which the additional print language file, the filter control module, and the print language conversion module are the same as those mentioned in the above method in structure, function, and purpose, and therefore the following description is omitted.
As shown in fig. 2, the print driver processing apparatus in the Linux operating system provided in this embodiment includes:
a print driving unit (a black dashed line in fig. 2), the print driving unit provided by the present embodiment includes: a document receiving unit 210, an additional printing language file 220, a filtering control module 230, a printing language conversion module 240, and a status monitor 250. Of course, the print driving unit provided in this embodiment is not limited to the layout of fig. 2, and the general-purpose driving module 300 may be also provided in the print driving unit, or the print language conversion module 240 may be provided so as not to belong to the print driving unit.
In the print driver processing apparatus in the Linux operating system provided in this embodiment:
a document receiving unit 210 for receiving a job document sent by application software;
the universal driving module 300 is used for converting the job document into an intermediate document, and inserting instruction information corresponding to a printing language through the additional printing language file 220 in the process of converting the job document into the intermediate document, so that the intermediate document meets the requirement of a preset printing language specification;
and the filtering control module 230 is configured to perform custom processing on the intermediate file, and automatically convert the intermediate file into a print document output to the image forming apparatus through the print language conversion module 240 in the Linux operating system, where the print document corresponds to the print language PCL.
Preferably, the additional printing language file 220 is further used for inserting predetermined identification information in the process of inserting the instruction information corresponding to the printing language, and the predetermined identification information corresponds to the corresponding printing instruction information set in the filtering control module.
Preferably, the filtering control module is further configured to control the print status monitor 250 in the Linux operating system, and the print status monitor 250 can simultaneously manage status information of a plurality of image forming apparatuses by querying the print status monitor 250 for status information of the image forming apparatuses and a currently printed job (in an embodiment, as shown in fig. 3). Therefore, according to the technical scheme provided by the embodiment, the print driver is installed in the Linux operating system once, and the state information of the plurality of image forming devices can be monitored simultaneously through the print driver, so that the state information of the plurality of image forming devices is more intuitive, and the print drivers corresponding to the devices with various image shapes do not need to be installed.
The present embodiment further preferably integrates the print status monitor into the print driver, and the application program can know whether the image forming apparatus is currently in a printable status through the print driver, and if the image forming apparatus is not in the printable status (for example, a status of paper out, paper jam, etc.), the application program may choose not to issue the job. In an alternative embodiment, the converted print job is automatically sent to the image forming apparatus when the image forming apparatus is available. In some security fields, for example, invoice data, hospital bank and other documents are printed, a job document may need to be applied for printing, if the printing is in a non-printable state, the issuing of the job may cause the job to be lost, and a subsequent user needs to apply again; the solution provided by the present embodiment may improve this problem.
Preferably, in the above method provided by this embodiment, a current unstable factor still exists in the current Linux operating system is considered. For example, in the case that the Linux operating system is halted or unexpectedly shut down due to an external reason, the print driver provided in this embodiment may automatically prompt the user to resend the print job through the error recovery mechanism after the computer installed with the Linux operating system is restarted.
Preferably, the filtering control module 230 is further configured to determine whether the image forming apparatus cooperating with the print driver in the Linux operating system satisfies a predetermined condition, and the print driver transmits the print document including the PCL language to the image forming apparatus only when the image forming apparatus satisfies a predetermined requirement.
Further preferably, the predetermined condition includes: whether or not at least one of the name, device ID (number), and manufacturer information of the image forming apparatus is identical to the information stored in the filter control module.
Preferably, the filtering control module 230 is further configured to split the intermediate document into a plurality of jobs, the plurality of jobs being converted into documents including PCL language by the printing language conversion module, respectively, and to merge the plurality of converted PCL language documents into a printing document output to the image forming apparatus.
As shown in fig. 4, the present embodiment further provides an electronic device, including:
a memory 410;
a processor 420; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of the above.
The present embodiment also provides a computer-readable storage medium having a computer program stored thereon; the computer program is executed by a processor to implement a method as in any above.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.