Print file format conversion method and device, electronic equipment and storage medium
The printer driver provided by the image forming equipment manufacturer obtains and converts intermediate printing files in the operating system, solving the printing failure problem caused by not installing a third-party conversion module, improving user experience and adaptability, and realizing the printing file format Effective conversion.
Patent Information
- Application Number
- CN202411053270.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-01
- Publication Date
- 2024-11-29
AI Technical Summary
When the third-party conversion module is not installed in some operating systems, printing operations cannot be performed normally, and the design and implementation of the third-party conversion module are complex and have problems, affecting the user experience.
Through the printer driver provided by the image forming equipment manufacturer, the intermediate printing file is obtained from the target program and the format is converted into a format that the image forming equipment can directly adopt, and the printing file in the target format is output to realize the conversion of the printing file format.
Even if a third-party conversion module is not installed, the printing file format conversion can be completed, which improves the user experience, adapts to a variety of image forming equipment, and improves the consistency of processing speed and printing effects.
Smart Images

Figure CN119045754A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image forming technology, and in particular to a print file format conversion method, device, electronic device and storage medium. Background Art
[0002] When a user issues a print instruction to an image forming device through a terminal device, a system print service provided by the operating system of the terminal device needs to adjust the format of the file issued by the user according to a data format recognizable by the image forming device.
[0003] In Linux system, word processing software such as WPS outputs vector files in formats such as PDF. The CUPS (Common UNIX Printing System) system printing service provided by Linux system calls a third-party conversion module to convert PDF vector files into print files in the target format according to the data format recognizable by the image forming device.
[0004] However, some operating systems do not have the third-party conversion module installed. At this time, when the terminal device needs to send a print instruction to the image forming device, the operating system cannot call the third-party conversion module to convert the PDF vector file into a print file in the target format, resulting in printing failure. In addition, the design and implementation of the third-party conversion module are extremely complex, and the third-party conversion module has some problems that cannot be repaired or improved, which will affect the user experience.
[0005] It should be pointed out that the information disclosed in the background technology section of this application is only intended to deepen the understanding of the general background technology of this application, and should not be regarded as an admission or suggestion in any form that the information constitutes prior art already known to those skilled in the art. Summary of the invention
[0006] In view of this, the present application provides a print file format conversion method, device, electronic device and storage medium, so as to solve the problem in the prior art that an operating system without a third-party conversion module installed cannot perform printing operations normally.
[0007] In a first aspect, an embodiment of the present application provides a method for converting a print file format, which is applied to a printer driver, and the method includes:
[0008] Acquire an intermediate print file from a target program, wherein the target program is a program that processes a document to be printed and outputs the intermediate print file;
[0009] converting the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform an image forming operation;
[0010] Output a target print file corresponding to the target format.
[0011] In the embodiment of the present application, the intermediate print file is obtained from the target program through the printer driver provided by the image forming device manufacturer, and the format of the intermediate print file is converted into the target format, and finally the target print file corresponding to the target format is output. It can be understood that even if the third-party conversion module is not installed in the operating system, the format conversion of the print file can be completed through the print driver, thereby completing the printing operation and improving the user experience.
[0012] In a possible implementation, the format of the intermediate print file includes a raster format and a bitmap format.
[0013] In an embodiment of the present application, the target program is a system printing service. When an application outputs vector format files such as PDF, the target program converts the vector format into a raster format and sends it to the printer driver. When an application outputs a bitmap format file, the target program directly sends the bitmap format file to the printer driver.
[0014] In a possible implementation, converting the raster format of the intermediate print file into a target format includes:
[0015] Divide every n lines of data in the intermediate print file into one data block, wherein n is less than or equal to the total number of lines of data that can be recorded in one page of the intermediate print file;
[0016] If any of the data blocks has a non-white area, any of the data blocks is processed into data corresponding to the target format.
[0017] In the embodiment of the present application, after receiving the intermediate print file, the printer driver starts to process the intermediate print file page by page, and divides the print file into multiple data blocks, and processes the non-blank data blocks into data corresponding to the target format. It can be understood that if a data block is blank, the data block is skipped, so that the intermediate print file can be processed quickly and the processing speed is improved.
[0018] In a possible implementation, dividing every n lines of data in the intermediate print file into one data block includes:
[0019] Each n-row data in each page of the intermediate print file is divided into one data block, wherein the number of data rows in the last data block of each page of the intermediate print file is less than or equal to n. In the embodiment of the present application, each n-row data in each page of the intermediate print file is divided into one data block, and the number of data rows in the last data block of each page of the intermediate print file is ≤n. It can be understood that when n=the total number of rows of data that can be recorded in one page of the intermediate print file, all the data in each page of the intermediate print file is one data block, and for the intermediate print file that is not fully recorded (that is, not every row in the intermediate print file has data), the number of data rows in the data block corresponding to this page of the intermediate print file is ≤n; when n<the total number of rows of data that can be recorded in one page of the intermediate print file, each page of the intermediate print file can be divided into multiple data blocks, and for the intermediate print file that is not fully recorded, the number of data rows recorded in the last data block of this page of the intermediate print file is less than n. In addition, if the total number of rows of data that can be recorded in one page of the intermediate print file cannot be divided by n, the number of data rows recorded in the last data block of the intermediate print file that is fully recorded will also be less than n. Through the method provided in the embodiment of the present application, it can be ensured that each row of data can be converted into a corresponding format, and invalid blank areas can be avoided from being processed, thereby improving the processing speed.
[0020] In a possible implementation, before obtaining the intermediate print file from the target program, the method further includes:
[0021] Controls the application to output intermediate print files in bitmap format.
[0022] In an embodiment of the present application, influenced by the print driver, the application may directly output an intermediate print file in a bitmap format, and the file displayed by the application to the user is also a file in a bitmap format. This ensures that the file previewed by the user is the same as the file printed out by the final image forming device, so that the printing effect meets the user's expectations.
[0023] In a possible implementation, before converting the format of the intermediate print file into a target format, the method further includes:
[0024] In response to a user's adjustment instruction for the intermediate print file, a print parameter of the intermediate print file is adjusted.
[0025] In the embodiment of the present application, if the intermediate print file format output by the application is in bitmap format, the user can directly adjust the print parameters when previewing the intermediate print file in bitmap format. Since the preview effect of the bitmap format is consistent with the print effect, the user can adjust the print parameters when previewing the print file in bitmap format so that the print effect is more in line with the user's expectations.
[0026] In a possible implementation, the converting the format of the intermediate print file into a target format includes: converting the intermediate print file into a raster image, wherein the raster image is a format directly adopted by the image forming device to perform an image forming operation;
[0027] The outputting of the target print file corresponding to the target format includes: outputting the raster image so that the image forming device performs an image forming operation using the raster image.
[0028] In the embodiment of the present application, the print driver can directly convert the intermediate print file into a raster image so that the image forming device performs an image forming operation on the raster image. Because some image forming devices can use raster images to perform image forming operations, the method provided in the embodiment of the present application can be adapted to a variety of image forming devices, thereby improving the adaptability of the method.
[0029] In a second aspect, an embodiment of the present application provides a print file format conversion device, comprising:
[0030] An intermediate print file acquisition module, used to acquire an intermediate print file from a target program, wherein the target program is a program that processes a document to be printed and outputs the intermediate print file;
[0031] a format conversion module, used for converting the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform an image forming operation;
[0032] The output module is used to output the target print file corresponding to the target format.
[0033] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0034] processor;
[0035] Memory;
[0036] and a computer program, wherein the computer program is stored in the memory, and the computer program includes instructions, and when the instructions are executed by the processor, the image forming device executes the method according to any one of the first aspects.
[0037] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods described in the first aspect.
[0038] It is understandable that the print file format conversion device provided in the second aspect, the electronic device provided in the third aspect, and the computer-readable storage medium provided in the fourth aspect are used to execute the method provided in the present application. Therefore, the beneficial effects that can be achieved can refer to the beneficial effects in the corresponding method, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0040] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0041] Figure 2 A flowchart of a file printing method in a related art provided in an embodiment of the present application;
[0042] Figure 3 A flowchart of a method for converting a print file format provided in an embodiment of the present application;
[0043] Figure 4 A schematic diagram of conversion between a raster format and a target format provided in an embodiment of the present application;
[0044] Figure 5 A flowchart of another method for converting a print file format provided in an embodiment of the present application;
[0045] Figure 6 A flowchart of another method for converting a print file format provided in an embodiment of the present application;
[0046] Figure 7 A schematic diagram of the structure of a print file format conversion device provided in an embodiment of the present application;
[0047] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0048] In order to better understand the technical solution of the present application, the embodiments of the present application are described in detail below with reference to the accompanying drawings.
[0049] It should be clear that the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.
[0050] The terms used in the embodiments of the present application are only for the purpose of describing specific embodiments, and are not intended to limit the present application. The singular forms "a", "said" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0051] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0052] To facilitate understanding, the application scenarios of the present application are first exemplified below.
[0053] See also Figure 1 , is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 As shown, in this application scenario, a terminal device 101 and an image forming device 102 are shown, wherein the terminal device 101 includes a display 1011 and a host 1012. The terminal device 101 and the image forming device 102 are connected via a wired or wireless communication network to transmit information. The communication network can be a local area network or a wide area network transferred by a relay device. When the communication network is a local area network, illustratively, the communication network can be a short-range communication network such as a wifi hotspot network, a wi fi P2P network, a Bluetooth network, a zigbee network, or a near field communication (NFC) network. When the communication network is a wide area network, exemplarily, the communication network can be a third-generation mobile communication technology (3rd-generation wireless telephone technology, 3G) network, a fourth-generation mobile communication technology (4G) network, a fifth-generation mobile communication technology (5G) network, a future evolved public land mobile network (public land mobile network, PLMN) or the Internet, etc.
[0054] in addition, Figure 1The terminal device 101 and the image forming device 102 shown in the figure are only exemplary descriptions and should not be used as a limitation on the scope of protection of the present application. For example, the terminal device 101 may be a laptop, a small laptop, a tablet computer, a mobile phone, a robot, smart glasses, etc. in addition to a desktop computer; the image forming device 102 includes but is not limited to a printer, a copier, a fax machine, a multi-function image making and copying device, an electrostatic printing device, and any other similar device.
[0055] In the Linux system, when a user wants to print a file, he or she can convert the file to be printed into a vector file in a format such as PDF through word processing software such as WPS installed on the terminal device. The CUPS system printing service provided by the Linux system calls a third-party conversion module to convert the PDF vector file into a print file in the target format based on the data format that the image forming device can recognize.
[0056] For ease of understanding, an embodiment of the present application provides a file printing method in the related art.
[0057] See also Figure 2 , is a flowchart of a file printing method in a related technology provided by an embodiment of the present application. Figure 2 As shown, it mainly includes the following steps.
[0058] Step S201: the application software generates an initial printing file in vector format;
[0059] Step S202: the application software sends an initial print file in vector format to the system print service;
[0060] Step S203: the system print service obtains the file format that the print driver can process;
[0061] Step S204: the system print service sends the intermediate print file to the print driver;
[0062] Specifically, the file format of the intermediate print file is a file format that can be processed by the print driver.
[0063] Step S205: the print driver processes the print parameters of the intermediate print file;
[0064] Step S206: the print driver sends the processed intermediate print file to the third-party conversion module;
[0065] It should be pointed out that the file format of the intermediate print file in this step remains unchanged, and is still in vector format.
[0066] Step S207: the third-party conversion module converts the format of the intermediate print file into the target format;
[0067] Step S208: the third-party conversion module sends the target print file corresponding to the target format to the print driver;
[0068] Step S209: the print driver processes the print data;
[0069] Specifically, processing print data includes adding PJL (Printer Job Language) commands and the like.
[0070] Step S210: the print driver sends the processed target print file to the system print service;
[0071] Step S211: the system print service sends the target print file to the image forming device.
[0072] However, some operating systems do not have the third-party conversion module installed. At this time, when the terminal device needs to send a print instruction to the image forming device, the operating system cannot call the third-party conversion module to convert the PDF vector file into a print file in the target format, resulting in printing failure. In addition, the design and implementation of the third-party conversion module are extremely complex, and the third-party conversion module has some problems that cannot be repaired or improved, which will affect the user experience.
[0073] In view of the above problems, the embodiment of the present application provides a method for converting the format of a print file, which obtains an intermediate print file from a target program through a printer driver provided by an image forming device manufacturer, converts the format of the intermediate print file into a target format, and finally outputs a target print file corresponding to the target format. It is understandable that even if a third-party conversion module is not installed in the operating system, the format conversion of the print file can be completed through the print driver, thereby completing the printing operation and improving the user experience. The following is a detailed description in conjunction with the specific implementation method and the accompanying drawings.
[0074] See also Figure 3 , is a flow chart of a method for converting a print file format provided in an embodiment of the present application. The method can be applied to Figure 1 The print driver in the application scenario shown, such as Figure 3 As shown, it mainly includes the following steps.
[0075] Step S301: Acquire an intermediate print file from a target program.
[0076] Specifically, the printer driver obtains the intermediate print file from the target program, wherein the target program is a program that processes the document to be printed and outputs the intermediate print file.
[0077] In one possible implementation, the target program is a system print service (i.e., a service provided by the operating system for performing print operations). After the user issues a print instruction through the application software, the application software such as WPS converts the format of the print file into a vector format such as PDF. The system print service obtains the file format that the print driver can handle, and determines whether the obtained file format is consistent with the file format that the print driver can handle. If they are consistent, the obtained print file is directly sent to the print driver as an intermediate print file; if they are inconsistent, the obtained print file is converted into a format into an intermediate print file that the print driver can handle, and then sent to the print driver.
[0078] Among them, the file format that the print driver can process includes a raster format or a bitmap format. In a possible implementation, the file format that the print driver can process is a raster format. After the user issues a print instruction through the application software, the application software such as WPS converts the format of the print file into a vector format such as PDF. The system print service obtains that the file format that the print driver can process is a raster format. Since the vector format is inconsistent with the raster format, the system print service converts the vector format of the print file into a raster format and sends the intermediate print file in the raster format to the print driver. In another possible implementation, the file format that the print driver can process is a bitmap format. After the user issues a print instruction through the application software, the application software such as WPS is affected by the print driver in the installation environment and converts the format of the print file into a bitmap format. The system print service obtains that the file format that the print driver can process is a bitmap format. Since the file format obtained by the system print service is consistent with the file format that the driver can process, the system print service sends the intermediate print file in the bitmap format to the print driver.
[0079] When the intermediate print file obtained by the print driver is in raster format, the print driver needs to convert the file format of the intermediate print file from raster format to a target format. In a possible implementation, the target format is a format recognizable by an image forming device such as PCL.
[0080] For ease of understanding, the embodiment of the present application also provides a schematic diagram of conversion between a raster format and a target format.
[0081] See also Figure 4, is a schematic diagram of conversion between a raster format and a target format provided in an embodiment of the present application. In a possible implementation, the print driver divides every n lines of data in the intermediate print file into one data block, and if there is a non-white area in any data block, the data block is processed into data corresponding to the target format, wherein n≤the total number of lines of data that can be recorded in one page of the intermediate print file. In other words, the print driver reads the intermediate print file page by page, divides every n lines of data in each page of the intermediate print file into one data block, and converts the non-blank data block into data corresponding to the target format, wherein each page of the intermediate print file is divided into at least one data block.
[0082] It can be understood that n=the total number of rows of data that can be recorded in one page of the intermediate print file means that the print driver processes a whole page of the intermediate print file at a time, that is, one page of the intermediate print file is a data block, and the print driver processes a whole page of data into data corresponding to the target format each time. Figure 4 As shown in a, Raster format is raster format, and PCL (Printer Control Language) format is one of the formats that can be recognized by the graphics forming device. Among them, Raster format data includes Image (that is, the specific content of image data), and Image is the data content corresponding to a whole page of intermediate print file. The print driver converts Raster to PCL format according to the image parameters of Raster format data and the specific content of image data. The print driver processes a whole page of intermediate print file at a time, and regards a page of intermediate print file as a data block, that is, the print driver regards the entire Image data in Raster format data as a data block, and converts it into Band Image (band image) in PCL format data.
[0083] n<the total number of rows that can record data in one page of intermediate print file means: the print driver processes part of the data in one page of intermediate print file at a time, that is, divides one page of intermediate print file into multiple data blocks, and the print driver processes the non-blank data blocks into data corresponding to the target format. Figure 4 As shown in b, the formats of Raster format data and PCL format data are the same as Figure 4 The a in is the same. But Figure 4 b in the Raster format data divides every n rows of data of the Image (i.e., the specific content of the image data) into one data block. For example, assuming that the total number of rows that can record data in the Image is 30 rows, if n is 10, then an Image can be divided into 3 data blocks; if n is 15, then an Image can be divided into 2 data blocks. Figure 4b in the figure means that the image is divided into three data blocks. The print driver first determines whether there is a non-white area in each data block. If there is a non-white area in a data block, the data block is a non-blank data block. The print driver processes the non-blank data blocks one by one into data corresponding to the target format (PCL format in the embodiment of the present application), that is, Figure 4 Band Image (1), Band Image (2) and Band Image (3) shown in b in FIG. 8 ; if a data block is a blank data block, the data block is skipped.
[0084] Of course, in actual applications, it is impossible for every line of each page of the intermediate print file to have data. Therefore, in the embodiment of the present application, every n lines of data in each page of the intermediate print file are divided into one data block, and the number of data lines in the last data block of each page of the intermediate print file is ≤n, where n is a preset data block. Figure 4 As shown in a, n = the total number of rows that can record data in a page of intermediate print file. Assuming that the total number of rows that can record data in a page of Image is 30, then n = 30, and every 30 rows of data in this page are divided into 1 data block; if not every row in this page has data, that is, the number of data rows in the last data block is m<n, then the m rows of data in the intermediate print file are divided into 1 data block. It can be understood that if there are 20 rows of data recorded in this page, then the 20 rows of data in this page are divided into 1 data block; if there are 15 rows of data recorded in this page, then the 15 rows of data in this page are divided into 1 data block. In addition, Figure 4 As shown in b, n<the total number of rows of data that can be recorded in one page of the intermediate print file. Assuming that the total number of rows of data that can be recorded in one page of the image is 30, then n<30. If the number of rows of data recorded in a certain area is m≥n, then every n rows of data in this area are divided into 1 data block; if the number of rows of data recorded in a certain area is m<n, then every m rows of data in this area are divided into 1 data block, wherein the total number of rows of data that can be recorded in any area is n.
[0085] The format of the intermediate print file may be a bitmap format in addition to the raster format. Specifically, the print driver controls the application to output the intermediate file in bitmap format, and the system print service sends the received intermediate print file in bitmap format to the print driver. Because the format of the print file output by the application is affected by the installation environment, the print driver that can process the intermediate print file in bitmap format can control the application to directly output the intermediate file in bitmap format. In addition, the application displays a preview file to the user while outputting the print file. In the related art, the application outputs a print file in vector format, and the system print service mobilizes a third-party conversion module to convert the vector format of the print file into the target format. Because the reliability and conversion quality of the third-party conversion module vary, the print file corresponding to the target format (i.e., the file finally output by the image forming device) and the print file previewed by the user may differ in terms of print content, image quality, color, etc. However, in the embodiment of the present application, the preview file displayed to the user is in bitmap format, and no third-party conversion module is required to perform format conversion, so it can be ensured that the user's preview effect is consistent with the final print effect, realizing "what you see is what you get".
[0086] When the format of the intermediate print file is a bitmap format, the user can input a print parameter adjustment instruction before converting the file format, and the print driver adjusts the print parameters of the intermediate print file in response to the user's adjustment instruction for the intermediate print file. Specifically, the print driver can adjust parameters such as the brightness, contrast, and hue of the image. For example, when printing an ID card, the image brightness can be increased to make the content of the ID card image clearer, thereby improving the printing effect.
[0087] In addition, when the application directly outputs a print file in a bitmap format, the system print service can convert the print file in a bitmap format into an intermediate print file in a raster format such as Raster, and then convert it into a raster image in a format such as PWG, so that the image forming device can directly use the raster image to perform an image forming operation. This method is applicable to an image forming device that can directly use a raster image to perform an image forming operation.
[0088] Step S302: converting the format of the intermediate print file into the target format.
[0089] Specifically, the print driver converts the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform image forming operations. In the embodiment of the present application, the target format includes printing formats such as PCL and raster images such as PWG.
[0090] In a possible implementation, the print driver converts the format of the intermediate print file into a print format such as PCL, so that the image forming device can perform the image forming operation. In addition, the print driver can convert the format of the intermediate print file into a raster image such as PWG. It should be noted that the raster image is different from the raster format mentioned above. The raster image is a format directly used by the image forming device to perform the image forming operation.
[0091] Step S303: outputting a target print file corresponding to the target format.
[0092] Specifically, the print driver outputs a target print file corresponding to a print format such as PCL or a raster image such as PWG.
[0093] In summary, in the embodiment of the present application, the intermediate print file is obtained from the target program through the printer driver provided by the image forming device manufacturer, and the format of the intermediate print file is converted into the target format, and finally the target print file corresponding to the target format is output. It can be understood that even if the third-party conversion module is not installed in the operating system, the format conversion of the print file can be completed through the print driver, thereby completing the printing operation and improving the user experience.
[0094] Corresponding to the above embodiment, the embodiment of the present application also provides a flow chart of another method for converting the format of a print file, which is used to convert an intermediate print file in a raster format into a target format.
[0095] See also Figure 5 , is a flow chart of another method for converting the format of a printed file provided in an embodiment of the present application. The method can be applied to Figure 1 The print driver in the application scenario shown, such as Figure 5 As shown, it mainly includes the following steps.
[0096] Step S501: the application software generates an initial printing file in vector format;
[0097] Step S502: the application software sends an initial print file in vector format to the system print service;
[0098] Step S503: the system print service obtains the file format that the print driver can process;
[0099] Step S504: the system print service sends the intermediate print file in raster format to the print driver;
[0100] Step S505: the print driver processes the print parameters of the intermediate print file;
[0101] Step S506: the print driver reads the raster format data by page, and encapsulates it into a target format by region;
[0102] Specifically, the raster format can be Raster format, and the target format can be PCL format, see Figure 4 Description of the illustrated embodiment.
[0103] Step S507: the print driver processes the print data;
[0104] Specifically, processing print data includes adding PJL (Printer Job Language) commands and the like.
[0105] Step S508: the print driver sends the processed target print file to the system print service;
[0106] Step S509: the system print service sends the target print file to the image forming device.
[0107] For specific contents involved in the embodiments of this application, please refer to the above Figure 3 to Figure 4 The description in the corresponding embodiment will not be repeated for the sake of brevity.
[0108] In addition, in a possible implementation, the application is affected by the installation environment and directly outputs the initial print file in bitmap format, and the print driver needs to convert the intermediate print file in bitmap format into the target format. Specifically, the embodiment of the present application provides a flow chart of another print file format conversion method.
[0109] See also Figure 6 , is a flow chart of another method for converting the format of a printed file provided in an embodiment of the present application. The method can be applied to Figure 1 The print driver in the application scenario shown, such as Figure 6 As shown, it mainly includes the following steps.
[0110] Step S601: the application software generates an initial print file in a bitmap format;
[0111] Step S602: the application software sends an initial print file in bitmap format to the system print service;
[0112] Step S603: the system print service obtains the file format that the print driver can process;
[0113] Step S604: the system print service sends the intermediate print file in bitmap format to the print driver;
[0114] Step S605: the print driver processes the print parameters of the intermediate print file;
[0115] Step S606: the print driver converts the intermediate print file in the bitmap format into a target print file in the target format;
[0116] Step S607: the print driver processes the print data;
[0117] Specifically, processing print data includes adding PJL (Printer Job Language) commands and the like.
[0118] Step S608: the print driver sends the processed target print file to the system print service;
[0119] Step S609: the system print service sends the target print file to the image forming device.
[0120] For specific contents involved in the embodiments of this application, please refer to the above Figure 3 to Figure 4 The description in the corresponding embodiment will not be repeated for the sake of brevity.
[0121] Corresponding to the above embodiment, the present application also provides a print file format conversion device.
[0122] See also Figure 7 , is a schematic diagram of the structure of a print file format conversion device provided in an embodiment of the present application. Figure 7 As shown, the print file format conversion device may include: an intermediate print file acquisition module 701, a format conversion module 702, and an output module 703. These components communicate via one or more buses. Those skilled in the art will appreciate that the structure of the image forming device shown in the figure does not constitute a limitation on the embodiments of the present application, and it may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0123] The intermediate print file acquisition module 701 is used to acquire the intermediate print file from the target program, where the target program is a program that processes the document to be printed and outputs the intermediate print file;
[0124] A format conversion module 702, configured to convert the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform an image forming operation;
[0125] The output module 703 is used to output the target print file corresponding to the target format.
[0126] Corresponding to the above embodiments, the present application also provides an electronic device.
[0127] See also Figure 8, is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 8 As shown, the image forming device 800 may include: a processor 801, a memory 802 and a communication unit 803. These components communicate via one or more buses. Those skilled in the art will appreciate that the structure of the image forming device shown in the figure does not limit the embodiments of the present application. It may be a bus structure or a star structure, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.
[0128] The communication unit 803 is used to establish a communication channel so that the image forming device can communicate with other devices, receive user data sent by other devices or send user data to other devices.
[0129] The processor 801 is the control center of the image forming device. It uses various interfaces and lines to connect various parts of the entire image forming device. It runs or executes software programs, instructions, and / or modules stored in the memory 802, and calls data stored in the memory to perform various functions of the image forming device and / or process data. The processor can be composed of an integrated circuit (IC), for example, it can be composed of a single packaged IC, or it can be composed of a plurality of packaged ICs with the same or different functions. For example, the processor 801 can only include a central processing unit (CPU). In the embodiment of the present application, the CPU can be a single computing core or multiple computing cores.
[0130] The memory 802 is used to store the execution instructions of the processor 801. The memory 802 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0131] When the execution instruction in the memory 802 is executed by the processor 801, the image forming apparatus 800 can execute Figure 3 Some or all of the steps in the illustrated embodiments.
[0132] In a specific implementation, the embodiment of the present application further provides a computer storage medium, wherein the computer storage medium may store a program, and when the program is executed, the program may include some or all of the steps in each embodiment of the simulation scene generation method provided in the embodiment of the present application. The storage medium may be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc.
[0133] In the embodiments of the present application, "at least one" refers to one or more, and "plurality" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.
[0134] Those of ordinary skill in the art will appreciate that the various units and algorithm steps described in the embodiments disclosed herein can be implemented in a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0135] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0136] In several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc., various media that can store program codes.
[0137] In this specification, the same or similar parts between the various embodiments can be referred to each other. In particular, for the device embodiment and the terminal embodiment, since they are basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description in the method embodiment.
Claims
1. A method for converting a print file format, characterized in that: Applied to a printer driver, the method comprises: Acquire an intermediate print file from a target program, wherein the target program is a program that processes a document to be printed and outputs the intermediate print file; converting the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform an image forming operation; Output a target print file corresponding to the target format.
2. The method according to claim 1, characterized in that The format of the intermediate print file includes a raster format or a bitmap format.
3. The method according to claim 2, characterized in that The converting the format of the intermediate print file into the target format comprises: Divide every n lines of data in the intermediate print file into one data block, wherein n is less than or equal to the total number of lines of data that can be recorded in one page of the intermediate print file; If any of the data blocks has a non-white area, any of the data blocks is processed into data corresponding to the target format.
4. The method according to claim 3, characterized in that The step of dividing every n lines of data in the intermediate print file into one data block comprises: Divide every n lines of data in each page of the intermediate print file into one data block, wherein the number of data lines in the last data block in each page of the intermediate print file is less than or equal to n.
5. The method according to claim 2, characterized in that: Before obtaining the intermediate print file from the target program, the method further includes: Controls the application to output intermediate print files in bitmap format.
6. The method according to claim 5, characterized in that Before converting the format of the intermediate print file into a target format, the method further includes: In response to a user's adjustment instruction for the intermediate print file, a print parameter of the intermediate print file is adjusted.
7. The method according to claim 5, characterized in that The converting the format of the intermediate print file into a target format includes: converting the intermediate print file into a raster image, wherein the raster image is a format directly adopted by the image forming device to perform an image forming operation; The outputting of the target print file corresponding to the target format includes: outputting the raster image so that the image forming device performs an image forming operation using the raster image.
8. A printing file format conversion device, characterized in that: include: An intermediate print file acquisition module, used to acquire an intermediate print file from a target program, wherein the target program is a program that processes a document to be printed and outputs the intermediate print file; a format conversion module, used for converting the format of the intermediate print file into a target format, wherein the target format is a format directly adopted by the image forming device to perform an image forming operation; The output module is used to output the target print file corresponding to the target format.
9. An electronic device, characterized in that: include: processor; Memory; and a computer program, wherein the computer program is stored in the memory, the computer program comprising instructions, which, when executed by the processor, cause the image forming device to perform the method of any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method according to any one of claims 1 to 7.
Citation Information
Cited By
Expansion program, data processing method and device, electronic equipment and storage medium
CN121029107A
