The present disclosure generally relates to information processing and, more particularly, to an information processing apparatus, an information processing method, and a storage medium for processing drawing data.
There is a method of representing an outline shape of an object, such as a character, line, or figure, using coordinates of a plurality of points and information about a straight or curved line that sequentially connects the coordinates of the plurality of points as drawing data on the object. Such a coordinate point connection path is referred to as “path”. In a case of printing the object drawing data represented by the path from an application using a printer driver, drawing of a portion of the object may be omitted at the time of rasterization and consequently the object is printed without the omitted part. Such omission often occurs in N-in-1 (2-in-1, 4-in-1, etc.) layout processing, in which a plurality of pages is reduced in size and laid out to a single sheet, or layout processing such as printing resolution conversion. The omission occurs as follows. As a result of coordinate transformation to reduce the size of the object, the distance between a path constituting the portion of the object and a path located to face the path is reduced, and if the distance between the paths is less than the width of a single pixel at the time of rasterization, drawing of the portion may consequently be omitted. Especially in the case where the object represented by the path is a text object, drawing of a line of the portion of the text object may be omitted to result in the text printed in an illegible state.
There are methods for preventing the issues of omission of a portion of an object due to rasterization. Japanese Patent Application Laid-Open No. 2016-66222 discusses a method in which paths representing an outline of an object are identified if the distance between the paths is less than a threshold value and the positional coordinates of the identified paths are corrected. Japanese Patent Application Laid-Open No. 8-63144 discusses a method in which a raster image generated by setting a line width to a line of an outline of a character and a raster image generated by filling the inside of the line of the outline of the character are logical-sum-combined to generate a raster image with the thickened line to thereby prevent the character from being lost in the outline font.
However, the technique discussed in Japanese Patent Application Laid-Open No. 2016-66222 needs to calculate the distance between paths and coordinate correction positions, so that in a case of drawing data containing a large number of paths, it takes a long time to complete the processing. Further, since path information is re-generated by correcting the original positional coordinates of the paths, the original path information is lost. In the technique discussed in Japanese Patent Application Laid-Open No. 8-63144, an information processing apparatus generates two raster images, combines the generated raster images, and transmits the combined raster image to an output unit such as a printing apparatus, so that it takes a long time to complete the process of generating raster images, combining of the raster images, and transmitting data.
According to one or more aspects of the present disclosure, an information processing apparatus includes a memory that stores a program, and at least one processor that executes the program to perform determining whether a size of a path object contained in drawing data is less than or equal to a predetermined threshold value, and adding, to the drawing data, a drawing instruction to draw a line of a predetermined line width along an outline of the path object the size of which is determined to be less than or equal to the predetermined threshold value.
Further features of the present disclosure will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
Various exemplary embodiments, aspects, and features of the present disclosure will be described in detail below with reference to the drawings.
A first exemplary embodiment will be described.
A graphics device interface (GDI) application 103 is an application for generating a document or a presentation material. In the present exemplary embodiment, an application that calls a GDI function at the time of printing to thereby generate drawing data in a GDI format will be referred to as “GDI application”. GDI is a drawing program provided by Windows.
Printer drivers (104, 106) are modules configured to manage printing settings of the printing apparatus 102 and drawing. The printer driver has a function of receiving drawing data and converting the received data into data (hereinafter, “PDL data”) described in a page description language (PDL) interpretable by the printing apparatus 102. There are two types of printer drivers, the printer driver 104 (referred to as “GDI printer driver” herein) capable of converting drawing data in the GDI format into PDL data and the printer driver 106 (referred to as “XPS printer driver” herein) capable of converting drawing data in an XPS format into PDL data. XPS is the abbreviation for Extensible Markup Language (XML) Paper Specification and is an XML-based format for describing an electronic document that is developed by Microsoft Corporation. PDL data generated by the printer driver (104, 106) is transmitted to the printing apparatus 102 via a spooler 107. While there are various types of PDL, such as Printer Command Language (PCL), a Laser Beam Printer Image Processing System (LIPS), and PostScript, since the PDL type is not to be limited in the present exemplary embodiment, the data is to be converted into “PDL data interpretable by the printing apparatus 102”.
In a case of printing from the GDI application 103 using the GDI printer driver 104, the drawing data in the GDI format that is generated by the GDI application 103 is input to the GDI printer driver 104 and converted into PDL data. On the other hand, in a case of printing from the GDI application 103 using the XPS printer driver 106, the drawing data in the GDI format that is generated by the GDI application 103 needs to be converted into data in the XPS format processable by the XPS printer driver 106. Thus, a GDI-XPS conversion unit 105 converts the drawing data in the GDI format that is generated by the GDI application 103 into drawing data in the XPS format, and the converted drawing data in the XPS format is input to the XPS printer driver 106. The GDI-XPS conversion unit 105 is a processing unit provided by the OS and, specifically, is realized by a program called Microsoft XPS Document Converter (MXDC).
While the case where the drawing data generated by the GDI application 103 is printed is illustrated as an example in
First, a configuration in a case where the CPU 201 of the information processing apparatus 101 operates the printer driver (104 or 106) to thereby function as processing units 301 to 305 will be described. Specifically, the CPU 201 operates the printer driver to thereby function as a drawing data reception unit 301, a drawing data interpretation unit 302, a layout processing unit 303, a data editing unit 304, and a PDL data generation unit 305.
The drawing data reception unit 301 has a function of receiving drawing data generated by the GDI application 103 when a printing instruction is given by the user. In the case where the printer driver is the GDI printer driver 104, the drawing data input to the drawing data reception unit 301 is data in a GDI format. In the case where the printer driver is the XPS printer driver 106, the drawing data input to the drawing data reception unit 301 is data in an XPS format that is converted by the GDI-XPS conversion unit 105. The drawing data interpretation unit 302 interprets the drawing data received by the drawing data reception unit 301 and converts the data into intermediate data. The layout processing unit 303 performs layout processing on the intermediate data converted by the drawing data interpretation unit 302 based on printing layout setting data received from the OS. The layout processing is the processing of transforming the coordinates of points contained in the drawing data and, for example, if the printing layout setting is 2-in-1, the coordinates are transformed so as to reduce the size of the object to ½. The data editing unit 304 edits the intermediate data on which the layout processing has been performed. Details of the processing to be executed by the data editing unit 304 will be described below. The PDL data generation unit 305 converts the intermediate data edited by the data editing unit 304 to thereby generate PDL data interpretable by the printing apparatus 102.
Next, processing blocks 307 to 309 of the printing apparatus 102 will be described with reference to
A process performed by the printer driver (104 or 106) will be described with reference to
In step S1, the drawing data reception unit 301 receives drawing data, and the drawing data interpretation unit 302 interprets the drawing data and converts the drawing data into intermediate data. As described above, in the case of printing using the GDI printer driver 104, the drawing data received by the drawing data reception unit 301 of the GDI printer driver 104 is drawing data in a GDI format. In the case of printing using the XPS printer driver 106, the drawing data received by the drawing data reception unit 301 of the XPS printer driver 106 is drawing data in an XPS format. The intermediate data is drawing data (i.e., data in an intermediate format suitable for use in the printer driver) in a format suitable for executing steps S2 to S10 in the printer driver, but this is not always an essential configuration element.
In step S2, the layout processing unit 303 performs layout processing on the intermediate data converted by the drawing data interpretation unit 302 based on the specified layout setting. Then, the data editing unit 304 performs editing processing in steps S3 to S9 on the intermediate data on which the layout processing has been performed.
First, in step S3, the data editing unit 304 sequentially analyzes the drawing objects, as a processing target, in the intermediate data having undergone the layout processing. The types of the drawing objects in the intermediate data include a text object, a path object, and an image object, as in the case of the drawing objects in the drawing data described above with reference to
In step S4, the data editing unit 304 determines whether the drawing object analyzed as the processing target is a path object.
In step S4, if the data editing unit 304 determines that the drawing object analyzed as the processing target is not a path object (NO in step S4), the processing proceeds to step S10. On the other hand, if the data editing unit 304 determines that the drawing object analyzed as the processing target is a path object (YES in step S4), the processing proceeds to step S5. In step S5, the data editing unit 304 determines whether the size of the path object of the processing target satisfies a predetermined condition. Details of step S5 will be described below with reference to
In step S6, the data editing unit 304 determines whether the result of the determination in step S5 is “TRUE”. If the data editing unit 304 determines that the result is “TRUE” (YES in step S6), the processing proceeds to step S7. On the other hand, if the data editing unit 304 determines that the result is not “TRUE” (NO in step S6), the processing proceeds to step S10.
In step S7, the data editing unit 304 performs paint instruction determination on the path object of the processing target. Details of step S7 will be described below with reference to
In step S9, the data editing unit 304 adds a drawing instruction to draw a line of one pixel width along an outline (a path of a connection path connecting a plurality of points constituting the path object) of the path object of the processing target. Details of step S9 will be described below with reference to
In step S10, the data editing unit 304 determines whether there is an unanalyzed drawing object. If the data editing unit 304 determines that there is an unanalyzed drawing object (YES in step S10), the processing returns to step S3, and the next drawing object is analyzed as a processing target. On the other hand, if the data editing unit 304 determines that there is no unanalyzed drawing object (NO in step S10), the processing proceeds to step S11. In step S11, the PDL data generation unit 305 converts the intermediate data to thereby generate PDL data interpretable by the printing apparatus 102.
As described above, a path object with a size and a paint instruction that respectively satisfy the predetermined conditions is determined as a path object from which a portion of a path is likely to be omitted, and an instruction to draw a line of one pixel width along an outline of the path object is added. In this way, omission of the portion of the path constituting the path object at the time of rasterization is prevented.
Next, details of the size determination processing in step S5 in
In step S601, the data editing unit 304 identifies the position of a circumscribed rectangle of the path object of the processing target. The circumscribed rectangle is a rectangle that circumscribes the path object of the processing target, so that the size and shape of the path object can be calculated. Specifically, the position of the circumscribed rectangle is calculated based on the maximum and minimum values of the x- and y-coordinates of the points constituting the path of the path object, and then the height and width of the circumscribed rectangle are derived.
In step S602, the data editing unit 304 determines whether the minimum values of the height and width of the circumscribed rectangle are less than or equal to respective predetermined threshold values. In the case where the path object of the processing target is a path object representing a character string, the height and width of the circumscribed rectangle indicate the height and width of the character string. Thus, in a case where at least one of the height and width of the circumscribed rectangle is less than or equal to the predetermined threshold value, the size of each character of the character string represented by the path object is also less than or equal to the predetermined threshold value. In a case where a character represented by a path such as an outline font is drawn in a reduced size that is less than or equal to the predetermined threshold value, the possibility that a portion of the path constituting the character is not drawn and is thus omitted increases.
The threshold value can be predetermined based on the distance between the paths constituting a portion (e.g., a horizontal line portion of the character) of the character of the outline font and the printing resolution (resolution at the time of rasterization). The threshold value can be determined by, for example, rasterizing a predetermined character of the outline font in a plurality of font sizes, identifying the front size with which the distance between the paths corresponds to the distance of one pixel in a rasterized image, and determining the threshold value based on the height of the character of the identified font size.
In step S602, if the data editing unit 304 determines that the minimum values of the height and width of the circumscribed rectangle are less than or equal to respective predetermined threshold values (YES in step S602), the processing proceeds to step S603, and the data editing unit 304 sets a size determination flag to “TRUE”. On the other hand, in step S602, if the data editing unit 304 determines that the minimum values of the height and width of the circumscribed rectangle are more than respective predetermined threshold values (NO in step S602), the size determination flag remains “FALSE”, and the process ends.
Thus, if the height and width of the circumscribed rectangle are both more than the predetermined threshold values, the size determination flag is determined as “FALSE” in step S6 and then the processing proceeds to step S10, so that the processing does not proceed to step S9. The processing of step S9 in
Next, details of the paint instruction determination processing in step S7 in
In step S701, the data editing unit 304 acquires the paint instruction specified in the path object of the processing target. In step S702, the data editing unit 304 determines whether the acquired paint instruction is a fill instruction. If the paint instruction is a fill instruction (YES in step S702), the processing proceeds to step S703. On the other hand, if the paint instruction is not a fill instruction (i.e., if the paint instruction is a stroke instruction or stroke-and-fill instruction) (NO in step S702), the paint instruction determination flag remains “FALSE”, and the process ends. The stroke instruction is an instruction to edge an outline of a region surrounded by a plurality of points constituting a path with a line with a color and line width specified by pen/brush information, as described above with reference to
In step S703, the data editing unit 304 acquires brush color information from the brush information specified by the fill instruction in the path object of the processing target.
In step S704, the data editing unit 304 determines whether the acquired brush color is a single color. Since it is common to draw a character with a single color, if the brush color is not a single color, the possibility that the path object is not a character is high. Thus, if the brush color is not a single color (NO in step S704), it is determined that the path object is not a target of the processing of step S9 in
In step S705, the data editing unit 304 sets the paint instruction determination flag to “TRUE”, and the process ends.
As described above, in the process illustrated in
Next, a case will be described where the steps in
If a line of one pixel width is added to the path object in the data 801 in step S9 in
Next, an example of a data configuration of a drawing object before and after the processing of step S9 in
In the first exemplary embodiment, the method has been described in which the data editing unit 304 in the printer driver 106 adds the instruction to draw a line of one pixel width to the path object before the PDL data generation to thereby prevent omission of a character. In a second exemplary embodiment, a method in a case of adding a line of one pixel width at the printing apparatus 102 side will be described.
In step S1101, the PDL data reception unit 307 of the printing apparatus 102 receives PDL data generated by the printer driver 106 via the spooler 107.
Next, in step S1102, the PDL data editing unit 310 of the printing apparatus 102 sequentially analyzes the drawing commands in the received PDL data as a processing target. In step S1103, the PDL data editing unit 310 determines whether the drawing command analyzed as the processing target is a drawing command of a path object. In steps S1104 to S1107, the size determination of the drawing by the drawing command and the paint instruction determination are performed as in steps S5 to S8 in
While the instruction to draw a line of one pixel width is added in step S9 in
The units described throughout the present disclosure are exemplary and/or preferable modules for implementing processes described in the present disclosure. The term “unit”, as used herein, may generally refer to firmware, software, hardware, or other component, such as circuitry or the like, or any combination thereof, that is used to effectuate a purpose. The modules can be hardware units (such as circuitry, firmware, a field programmable gate array, a digital signal processor, an application specific integrated circuit, or the like) and/or software modules (such as a computer readable program or the like). The modules for implementing the various steps are not described exhaustively above. However, where there is a step of performing a certain process, there may be a corresponding functional module or unit (implemented by hardware and/or software) for implementing the same process. Technical solutions by all combinations of steps described and units corresponding to these steps are included in the present disclosure.
Embodiment(s) of the present disclosure can also be realized by a computerized configuration(s) of a system or apparatus that read(s) out and execute(s) computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment(s) and/or that include(s) one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computerized configuration(s) of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computerized configuration(s) may comprise one or more processors, one or more memories, circuitry, or a combination thereof (e.g., central processing unit (CPU), micro processing unit (MPU)), and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computerized configuration(s), for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.
While the present disclosure has been described with reference to exemplary embodiments, it is to be understood that the disclosure is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.
This application claims the benefit of priority from Japanese Patent Application No. 2018-086498, filed Apr. 27, 2018, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2018-086498 | Apr 2018 | JP | national |