Information processing apparatus for generating printing data by different methods, computer readable recording medium and method of controlling the information processing apparatus

An information processing apparatus includes a printing setting reception part generating setting information from printing settings when a printing request is given by an application; an image processing part converting document data obtained from the application into printing data for a printer based on the setting information; and a determination part determining whether the application having called the image processing part is a specific application, by determining at least one of whether the setting information includes specific application information described by the application and whether the specific application information is included in an argument of a function for calling the image processing part. When it has been determined that the specific application has called the image processing part, the image processing part generates the printing data by a method different from a method of a case of having been called by an application other than the specific application.

BACKGROUND OF THE INVENTION

1. Field of the Invention

The present invention relates to an information processing apparatus that converts document data from an application and transmits the converted data to a printer.

2. Description of the Related Art

When a user prints document data that has been created using an application or the like, printing data is transmitted to a printer through a process carried out by the application, a printer driver and an Operating System (OS) in cooperation. In a case where the OS of a Personal Computer (PC) in which the application operates is Windows (registered trademark), there are two types of a printing process:

Windows printing scenario of RAW spooling

Windows printing scenario of EMF spooling

FIG. 1illustrates a general configuration of one example of a Windows printing scenario of RAW spooling. A PC600has an application601, and, as functions of an OS (not shown), has a Graphical Device Interface (GDI)602, a printer driver610, a spooler603, a printer processor606and a port monitor605.

The printer driver610includes a User Interface (UI) part612and a graphics part611. When a user inputs an instruction for printing a document to the application601, the application601sends a DEVMODE structure (hereinafter, simply referred to as DEVMODE) to the UI part612of the printer driver610. DEVMODE is a data structure in which member variables are defined for setting printing conditions in printer drivers of various types that operate on an OS in common. In response to receiving DEVMODE, the UI part612of the printer driver610displays a printing setting screen page (also may be called a “printing dialog”) on a display device.

The user sets printing conditions such as a paper sheet size, the required number of copies, duplex printing, and/or the like, by the displayed printing setting screen page, and inputs an instruction for printing. The UI part612receives the printing conditions that have been thus set by the user, and sends DEVMODE that includes the printing settings to the application601.

The application601shown inFIG. 1is, for example, an application of a document creation program (for example, MS-Word (registered trademark)). When having received DEVMODE from the UI part612, the application601calls the GDI602with a GDI call, and sends DEVMODE and the document data to the GDI602.

When having received DEVMODE and the document data from the application601, the GDI602calls the graphics part611of the printer driver610by a DDI call, and sends DEVMODE and the document data to the graphics part611.

The graphics part611reads DEVMODE obtained from the GDI602uses the document data for which the application601has given an instruction to print, creates printing data (RAW data)800that reflects the printing settings, and sends the created printing data800to the spooler603. It is noted that the printing data800includes rendering data (for example, PDL data) and control data (for example, a PJL printing command).

The spooler603stores the printing data800obtained from the graphics part601as a spool file604. The printer processor606processes the printing data800and sends the processed printing data800to the spooler603. The spooler603sends the printing data800to the port monitor605. The port monitor605monitors ports that the PC600has, and sends the printing data800to a port to which the printer700is connected. The printer700prints the printing data800.

FIG. 2illustrates one example of a general configuration of the above-mentioned “Windows printing scenario of EMF spooling”. According to the “Windows printing scenario using EMF spooling”, the processes from the printing instruction by the user through the calling of the GDI602by the application601are the same as those ofFIG. 1.

Then, the GDI602generates EMF data900and sends the generated EMF data900to the spooler603. When all of the document data of the application601has been stored in the spooler603as EMF data900, the spooler603informs the printer processor606of starting despooling, and the printer processor606obtains the spool data (EMF data)900. The printer processor606carries out an editing process on the obtained EMF data900such as collecting data for each page, reversing the order, preparing for bookbinding and/or the like, and then, carries out a GDI call and sends the thus processed EMF data900to the GDI602.

The GDI602calls the graphics part611of the printer driver610by a DDI call, and sends DEVMODE and the EMF data900to the graphics part611. The graphics part611creates printing data (RAW data)800using the EMF data900and DEVMODE, and sends the created printing data800to the spooler603. When all of the printing data800has been thus sent from the graphics part611, the spooler603sends the printing data800to the port monitor605.

DEVMODE has a Public area and a Private area. The Public area is a common area that can be used without regard to particular printers or printer drivers, and common member variables are defined for respective printer drivers that operate on an OS. The Private area is a so-called extended area for defining member variables for each of the printer drivers. Accordingly, in the Private area, it is possible to define member variables to be used to manage printing conditions concerning functions unique to each of the printer drivers (printer).

Thus, in the Private area of DEVMODE, adding and/or updating of the member variables may occur. In order to manage such a Private area of DEVMODE, a technology has been proposed (for example, see a patent reference No. 1 (Japanese Laid-Open Patent Application No. 2009-230426)). The patent reference No. 1 discloses a printer driver in which only the size of a Private area is fixed, and member variables are not fixed. Then, the member variables and the positions thereof are fixed by an information arrangement file. Thereby, it is possible to eliminate the need of re-compiling each printer driver by preparing different information arrangement files for respective printer drivers.

The printer driver described in the patent reference No. 1 can flexibly configure the Private area. Generally speaking, a printer driver is the same even when an application that calls the printer driver differs as long as a printer is the same.

However, there is a case where it is preferable to carry out a specific process only in a case where a printer driver is called by a specific application. For example, the graphics part611creates the control data from DEVMODE. Further, the graphics part611also creates the control data from information of document data that the application601has or from information not included in DEVMODE. However, there is a case where the specific application does not have information of document data that a general application has. In such a case, the printer driver may create the control data that is erroneous.

If the printer driver can detect that it has been called by the specific application, it is possible to use the control data created by the graphics part611called by the general application, or not to create the control data. However, generally speaking, the printer driver has no such a system of detecting that it has been called by the specific application.

SUMMARY OF THE INVENTION

According to one aspect, an information processing apparatus has a printing setting reception part that generates setting information from received printing settings at a time of a printing request given by an application; an image processing part that converts document data obtained from the application into printing data for a printer based on the setting information; and an application determination part that determines whether the application that has called the image processing part is a specific application, from at least any one of whether the setting information includes specific application information described by the specific application and whether an argument of a function for calling the image processing part includes specific application information. In a case where the application determination part has determined that the image processing part has been called by the specific application, the image processing part generates the printing data by a method different from a method of a case where the application determination part has determined that the image processing part has been called by the application other than the specific application.

DETAILED DESCRIPTION OF THE EMBODIMENTS

Below, an information processing apparatus, a computer readable information recording medium and a method of controlling an information processing apparatus will be described by embodiments.

First Embodiment

FIG. 3schematically shows one example of a procedure of generating printing data or the like by a printer driver in the related art for comparison. It is noted that a printing procedure according to the first embodiment can be applied to both RAW spooling and EMF spooling. Thus, they are not distinguished in the following descriptions.

As mentioned above, the UI part612receives printing settings from a user, stores DEVMODE, and sends DEVMODE to an application601. The application601is a general term of software such as document creation software, browser software or the like for creating document data to be printed.

The application601sends DEVMODE and document data to the graphics part611. The “document data” includes not only the contents of a document but also bibliographic matters such as a size of original sheets of paper, an orientation of the original sheets of paper, and/or the like.

The graphics part611of the printer driver610creates, from DEVMODE and document data, rendering data (RAW data), Job control data and Page control data, and sends the created data to the printer700. The Job control data and the Page control data will be described later. The printer700interprets the Job control data and the Page control data, and thus, can print the rendering data (RAW data).

FIG. 4schematically illustrates a procedure of generating printing data or the like by a printer driver30according to the first embodiment. InFIG. 4, the procedure of generating, by a graphics part33, rendering data, Job control data and Page control data, is the same asFIG. 3. However, to these items of data, a prefix “int” is attached for the purpose of identification.

When a user gives an instruction for printing to an application31, the user sets “to display printing preview screen page” by the PC before the printing is started. An application32for thus carrying out preview displaying corresponds to a “specific application”, and will be hereinafter referred to as a Preview.exe32.

(i) After creating rendering data, Job control data and Page control data, the graphics part33reports this fact to the application31. As a result, the application31finishes the printing. The graphics part33, for the present, finishes the printing based on the above-mentioned setting of “to display printing preview screen page”.

(ii) Further, a UI part34starts the Preview.exe32based on the setting of “to display printing preview screen page” in response to the reporting by the application31of the finish of the printing.

(iii) The Preview.exe32carries out preview displaying using the already created rendering data, Job control data and Page control data. The user sees a result of the preview displaying and understands how the printing will be actually carried out; can additionally carry out new settings for the printing, if any, such as collecting plural pages into one page, stapling, punching, bookbinding, and/or the like, of these settings have been forgotten to do; or can change the printing settings.

(iv) When the user then gives an instruction to start printing, the Prview.exe32writes “preview setting” in DEVMODE for the purpose of recording that the Preview.exe32has called the printer driver30. The “preview setting” will be described later. The Preview.exe32sends DEVMODE′ that reflects the new printing settings (if any) to the UI part34.

(v) Next, the Preview.exe32gives an instruction to print to the graphics part33. For this purpose, the Preview.exe32sends the rendering data, Job control data and Page control data to the graphics part33. The graphics part33reads DEVMODE′ via the UI part34, and thus, can detect from the “preview setting” of DEVMODE′ that the printer driver30has been called by the Preview.exe32.

(vi) The graphics part33first reads DEVMODE′ and determines whether the printer driver30has been called by a specific application (in this case, the Preview.exe32). Then, when having determined that the printer driver30has been called by the specific application, the graphics part33operates as follows:

a. The graphics part33newly creates Job control data, using DEVMODE′. Thus, it is possible to reflect the printing settings (if any) that the user has carried out in response to the above-mentioned preview displaying.

b. The graphics part33utilizes the Page control data obtained from the Preview.exe32, as it is (instead of newly creating it). Since all the information required for the Page control data is not included in DEVMODE′, the graphics part33thus does not generate the Page control data in a case where the printer driver30has been thus called by the Preview.exe32.

c. The rendering data obtained from the Preview.exe32is utilized, as it is. Since the rendering data that has been already created by the graphics part33is not changed even when the Preview.exe32carries out the preview displaying, the graphics part33does not need to again create the rendering data. Thus, the graphics part33carries out nothing at this stage.

(vii) The graphics part33sends the rendering data, Job control data and Page control data to a printer200.

Thus, the printer driver30according to the first embodiment can detect from the “preview setting” of DEVMODE that it has been called by a specific application, and can carry out a special process accordingly.

Configuration Example

FIG. 5Ashows one example of a general configuration of a printing system400.FIG. 5Bshows one example of a hardware configuration of a Personal Computer (PC)100. The PC100and the printer200are connected by a network300. The PC100receives a user's operation, and the application31such as document creation software requests printing by using a GDI, a DDI and the printer driver30. The printer driver30creates printing data according to a procedure described later, and transmits the printing data to the printer200. The printer200may be a duplicating machine, a copier, a facsimile machine or the like as long as it has an image forming function. Further, the printer200may have an image forming function of an electrophotographic method or an inkjet method. Further, the PC100and the printer200may also be directly connected by a USB cable or the like.

As shown inFIG. 5B, the PC100has a CPU11, a ROM12, a RAM13, an external I/F14, a communication device15, an input device16, a display control part17and a storage device18, which are mutually connected by a bus. The CPU11reads an Operating System (OS)10, the application31, the printer driver30and the Preview.exe32from the storage device18, and executes them by using the RAM13as a work area.

The application31requests the printer200to carry out printing, and may be one of various types, for example, document creation software, browser software, presentation material creation software or the like. The application31may be any application as long as it can carry out creating document data to be printed, editing the same, displaying the same, managing the same, and/or so, and print the same. It is noted that the document data may include not only characters/letters, symbols, and/or numerical values, but also various printing targets such as images, photographs and/or the like.

The RAM13is used as a work memory (main storage memory) that temporarily stores necessary data. In the ROM12, BIOS, data that is initially set, a startup program, and/or the like, are stored.

The external I/F14is an interface in which a cable such as a USB cable and/or a portable recording medium20are/is loaded. The communication device15is a LAN card or an Ethernet (registered mark) card, and transmits packet data (i.e., printing data in the first embodiment) to the printer200in response to an instruction given by the CPU11.

The input device16is a user interface to receive a user's various operation instructions, such as a keyboard, a mouse, and/or the like. The input device16may also be a touch panel or a voice input device. The display control part17controls rendering of a display device19by a predetermined resolution, the number of colors and/or the like based on image information given by the application31as instructions. The display device19is a Flat Panel Display (FPD) of liquid crystal, organic EL or the like.

The storage device18is a non-volatile memory such as a Hard Disk Drive (HDD), a flash memory or the like, and stores the OS10, the printer driver30, the application31and the Preview.exe32.

The recording medium20is a non-volatile memory, for example, a SD card, a USB memory, or the like. The OS10, the application30, the Preview.exe32and the printer driver30are distributed in such a manner of being recorded in the recording medium20or being downloaded from a server (not shown).

FIG. 6Ashows one example of a functional block diagram of the printer driver30. The printer driver30includes the UI part34, a graphics part33and a linkage part35. Further, the graphics part33has a rendering part301and a printing confirmation part302. Functions that are not necessary for explaining the first embodiment are omitted.

The UI part34displays on the display device19the printing setting screen page (printing dialog) based on DEVMODE and printing settings that are already stored, and receives printing settings that are set by a user. The UI part34stores the received printing settings in DEVMODE, and sends them to the application31.

The printing confirmation part302reads DEVMODE and determines whether an application that is the calling source is a specific application.

The linkage part35carries out communication with the Preview.exe32. For example, the linkage part35sends printing data that has been generated by the rendering part301to the Preview.exe32, obtains DEVMODE′ from the Preview.exe32and sends it to the UI part34.

FIG. 6Bshows one example of a functional block diagram of the Preview.exe32. The Preview.exe32has a UI part36. The UI part36is another instance generated from the same class as that of the UI part34of the printer driver30. The UI part36of the Preview.exe32can use printing data generated by the printer driver30, and carry out preview displaying.

FIG. 7shows one example of a functional block diagram of the PC100. The PC100includes the application30, the Graphics Device Interface (GDI)38, the printer driver30, the Preview.exe32and a spooler37.

The GDI38is provided as a program of the OS10of Windows (registered trademark) family. The GDI38converts a GDI call into a DDI call, and sends the DDI call to the graphics part33. The spooler37spools printing data, and sends it to the printer200.

According to the first embodiment, when a user selects “to display printing preview screen page” from the printing setting screen page, the Preview.exe32operates.

FIG. 8Ashows one example of settings for preview displaying that is carried out in the printing setting screen page. For example, a check box501of “to display printing preview screen page” is provided at a tab “utility” from among several tabs. When a user has checked the check box501, the UI part34registers, in DEVMODE, the fact that the “to display printing preview screen page” has been selected.

FIG. 8Bshows one example of a preview displaying screen page500that is displayed after printing is started. In a preview field502, the document data created by the application31is displayed through preview displaying.

Further, using the preview displaying screen page500, a user can edit respective settings such as:

a size of printing sheets of paper503;

a number of sheets to print504;

Further, a user can edit printing jobs, using the preview displaying screen page500. By editing jobs, a user can change the order of plural printing jobs, carry out printing of plural printing jobs with the same settings, and/or carry out printing of plural printing jobs as a single job. By editing printing jobs, it is possible to put plural printing jobs in a state of immediately before the printing, and then carry out the printing in a lump or with the same settings.

The “to display printing preview screen page” that has been once set by a user using the printing setting screen page500is registered in DEVMODE. Thus, the preview displaying screen page500is displayed even when a user has carried out operations to start the printing without confirming the printing settings. Thus, the user can confirm the printing settings before the actual printing is started, and thus, it is possible to avoid a problematic situation of carrying out the printing with erroneous printing settings resulting in a useless consumption of sheets of paper.

Below, operations of the respective blocks ofFIG. 7will be described in sequence. First, the processes S101through S104are those approximately the same as those of the related art.

S101: The application31carries out printing settings by sending DEVMODE to the UI part34.

S102: The application31sends a printing instruction to the GDI38by a GDI call.

S103: The GDI38converts the GDI call into a DDI call, and requests the graphics part33to generate printing data.

S104: The printing confirmation part302reads DEVMODE, and determines whether the application31that is the calling source is a specific application.

FIG. 9Aillustrates one example of DEVMODE. DEVMODE has two areas, i.e., the Public area (“Public DEVMODE”) and the Private area (“Private DEVMODE”). The Public area is a common area without regard to the printer200and the printer driver30, member variable common to the respective printer drivers30that operate on the OS are defined. The Private area is an extended area in which member variables can be defined for each of the printer drivers30. InFIG. 9A, “dmDuplex”, “dmReserved1” and “dmReserved2” are shown as member variables of the Public area. “mysetting01” is shown as a member variable of the Private area.

The meanings of the member variables of the Public area are prescribed by values that are set therein, respectively. When “DMDUP_SIMPLEX” is set in “dmDuplex”, this means that “duplex printing is not carried out”. When “DMDUP_HORIZONTAL” is set in “dmDuplex”, this means that “duplex printing is carried out while each sheet of paper is reversed in a horizontal direction”. When “DMDUP_VERTICAL” is set in “dmDuplex”, this means that “duplex printing is carried out while each sheet of paper is reversed in a vertical direction”. Further, the printer driver30can give a unique meaning to a member variable of the Private area. Thus, for example, when “Yes” is set in “mysetting01”, this means to skip blank pages. When “No” is set in “mysetting01”, this means not to skip blank pages.

On the other hand, “dmReserved1” and “dmReserved2” are member variables that are not read by the printer driver30(i.e., reserved areas that are not currently used) in the Public area. Normally, “0x00000000” is set there.

As will be described later, according to the first embodiment, the Preview.exe32sets a value other than “0x00000000” in at least any one of “dmReserved1” and “dmReserved2”. Thus, the printing confirmation part302reads “dmReserved1” and “dmReserved2”, and then, when “0x00000000” has been set there, the printing confirmation part302determines that the general application31has called the graphics part33. When a value other than “0x00000000” has been set there, the printing confirmation part302determines that a specific application (i.e., the Preview.exe32) has called the graphics part33.

When the printing confirmation part302has determined that the general application31has called the graphics part33, the rendering part301carries out the following rendering process.

FIG. 10is a flowchart showing one example of the rendering process that the rendering part301carries out. As described above, the rendering part301generates rendering data and control data. However, rendering data and control data to be interpreted by the printer200and rendering data and control data to be interpreted by the Preview.exe32have somewhat different formats. That is, rendering data and control data to be interpreted by the Preview.exe32have formats that are used by the printer driver30internally, and are intermediate data. In this regard, instead of switching an internal process of the rendering part301between a process of one type of generating rendering data and control data for the Preview.exe32and a process of generating another type of rendering data and control data for the printer200depending on whether preview displaying is to be carried out in the PC100, implementation is made easier by separating the internal process into two stages to obtain the respective types of rendering data and control data. Thus, the rendering part301generates the printing data through two stages, i.e., pre-processing and post-processing, for providing the intermediate data to the Preview.exe32, regardless of whether a user has selected “to display printing preview screen page”. In order to distinguish between the two types of printing data obtained from the pre-processing and the post-processing, respectively, “int” (internal) is attached to the printing data obtained from the pre-processing.

Then, depending on whether a user has selected “to display printing preview screen page”, the rendering part301carries out the pre-processing and the post-processing in certain timings shown below.

In a case where the user has selected “to display printing preview screen page”, the rendering part301stops processing after carrying out the pre-processing. The Preview.exe32then carries out “preview displaying” using rendering data and control data thus generated by the pre-processing of the first time. After the preview displaying, the rendering part301obtains the int printing data from the Preview.exe32, carries out the pre-processing of the second time, and then, carries out the post-processing.

On the other hand, when a user has not selected “to display printing preview screen page”, the rendering part301carries out the pre-processing, and then, carries out the post-processing.

That is, in any case, the pre-processing is carried out. However, as will be described later, the pre-processing of the first time and the pre-processing of the second time have different processing contents. The pre-processing of the first time in a case where a user has selected “to display printing preview screen page” and the pre-processing in a case where a user has not selected “to display printing preview screen page” have the same processing contents. Further, the processing contents of the post-processing are the same without regard to whether a user has selected “to display printing preview screen page”.

FIGS. 11A and 11Billustrate the two types of printing data obtained from the pre-processing and the post-processing, respectively. The control data is a printing command(s) described in PJL for notifying the printer200of control for the entirety of the printing job and control for page units. Thus, the control data will be referred to as Job control data (for the entirety of the printing job) and Page control data (for page units). The rendering data is RAW data of PDL for the printer200obtained from converting the document data that is generated by the application31. The printing data ofFIGS. 11A and 11Bcorresponds to the document data having two pages. One set of Job int control data is required for one set of printing job, and thus, only one set of Job int control data exists in one set of the printing data. On the other hand, Page int control data and int rendering data are generated for each page, and thus, the number of sets of data corresponding to the number of pages are included in one set of the printing data, as shown inFIGS. 11A and 11B.

As shown inFIGS. 11A and 11B, the rendering part301generates data shown below at the pre-processing when called by the general application31:

(a)—general: Job int control data that is created from DEVMODE

(b)—general: Page int control data that is created from DEVMODE

(c)—general: int rendering data that is obtained from converting the document data

Further, the rendering part301generates data shown below at the post-processing:

(d): Job control data that is created from the Job int control data

(e): Page control data that is created from the Page int control data

(f): rendering data that is created from the int rendering data

FIG. 12Ashows one example of the Job int control data andFIG. 12Bshows one example of the Page int control data. In the Job int control data, control data for printing the entirety of a printing job is registered, such as a printing resolution, a size of sheets of paper, a margin, a number of copies, a tray of sheets of paper, a type of sheets of paper, N-Up, and the like.

In contrast thereto, in the Page int control data (FIG. 12B), control data for printing each page of a printing job is registered, such as a size of original sheets of paper, an orientation of the original sheets of paper, a resolution of the original sheets of paper, a color mode, whether image as a size of original sheets of paper and the like is held in neither DEVMODE nor the Preview.exe32.

Returning toFIG. 7, processes S105through S108will now be described. The processes S105through S108are those for carrying out “preview displaying”. When the rendering part301has completed the pre-processing, the rendering part301notifies the application31of this matter. Since “to display printing preview screen page” is registered in DEVMODE, the graphics part33finishes the printing job. Further, the application31notifies the UI part34of the finish of printing.

S105: The UI part34of the printer driver30reads DEVMODE, and starts the Preview.exe32.

S106: The UI part36of the Preview.exe32requests “int printing data” and DEVMODE from the linkage part35for the purpose of display a preview screen page.

S107: The linkage part35obtains “int printing data” and DEVMODE from the graphics part33of the printer driver30, and sends them to the UI part36of the Preiew.exe32.

S108: The UI part36of the Preview.exe32carries out “preview displaying” such as that shown inFIG. 8Busing the int printing data.

FIG. 13schematically illustrates one example of the processes of S105through S108. InFIG. 13, the Preview.exe32is inserted between two sets of processes of the printer driver30(on the left side and the right side, respectively). The printer driver30carries out the pre-processing and the post-processing, and only the contents of the pre-processing are different between before and after (on the left side and the right side, respectively, of) the process of the Preview.exe32. Through the processes S101through S104described above, the pre-processing of the left-side process of the printer driver30is finished. The application31is released from the printing process at this stage (storing the file by “JobEnd”).

The UI part36of the Preview.exe32obtains “int printing data” and DEVMODE, and thus, carries out the following processes.

(P1) The UI part36gives the “int printing data” a printer driver API, and requests the printer driver API to carry out “preview displaying”.

(P2) The UI part36gives DEVMODE to a DEVMODE editing part, and requests the DEVMODE editing part to receive printing settings that are made by a user and edit DEVMODE accordingly.

It is noted that the printer driver API and the DEVMODE editing part are merely expressions of software implementation, and thus, the Preview.exe32may also carry out “preview displaying”, receive printing settings and edit DEVMODE accordingly.

The DEVMODE editing part sets a predetermined value(s) in “dmReserved1” and “dmReserved2” (member variables) of DEVMODE without regard to whether a user has changed the printing settings. The predetermined value(s) may be any value(s) other than “0x00000000”. In this example, “SA (0x53, 0x41)” are used.

FIG. 9Bshows one example of DEVMODE that has been edited by the Prewview.exe32. As shown, in “dmReserved1” and “dmReserved2”, character codes of hexadecimal numbers that mean “SA” are set, as follows:

It is noted that it is not necessary to set values in the two member variables separately, and instead, a predetermined value other than “0x00000000” may be set in any one of “dmReserved1” and “dmReserved2”. Such a setting corresponds to the above-mentioned “preview setting”.

Member variables of the Public area are values that can also be set by an application. Thus, an application (i.e., the Prewview.exe32) may set a value(s) in “dmReserved1” and/or “dmReserved2”. Although it is not impossible to set values of member variables of the Private area, an application cannot know the contents of the Private area, normally. Thus, it is difficult to use a function of a printer, which function is unique to the manufacturer, without using an API or the like for accessing the UI part and/or DEVMODE. However, in the method according to the first embodiment, an application (i.e., the Prewview.exe32) can easily set a function unique to the manufacturer (i.e., “preview setting”).

When a user carries out printing settings and/or editing a printing job using the preview displaying screen page500ofFIG. 8Band then presses a “print” button510thereof, the right-side process of the printer driver30inFIG. 13is started. That is, the Preview.exe32transmits the int printing data to the GDI38by an Escape ( ) function. The Escape ( ) function is an API for transmitting a printing instruction(s) that cannot be processed by the GDI38to the printer driver30as it is (or as they are).

FIGS. 14A and 14Bschematically illustrate “int printing data” to be transmitted to the printer driver30by the Preview.exe32.FIG. 14Ashows “int pitting data” before being changed, and14B shows “int pitting data” after being changed. The change of “being changed” may include a change made by a user and/or a change of “dmReserved1” and “dmReserved2”. In order to indicate the change by a user or the change by the Preview.exe32, DEVMODE is changed into DEVMODE′ inFIG. 14B. In the right-side process of the printer driver30inFIG. 13, the pre-processing and the post-processing are carried out on the “int printing data” ofFIG. 14B.

Returning toFIG. 7, processes S109through S114will now be described. The processes S109through S114are those of sending the “int printing data”, which has been received from the Preview.exe32, to the printer200by the printer driver30.

S109: The UI part36of the Preview.exe32sends DEVMODE′ to the UI part34of the printer driver30. For example, DEVMODE′ is designated as an argument of CreateDC ( ).

S110: The UI part36of the Preview.exe32sends the “int printing data” to the graphics part33of the printer driver30. For example, the “int printing data” that does not include DEVMODE′ is transmitted by Escape ( ).

S111: The GDI38converts a GDI call of the second time into a DDI call, and requests the graphics part33to generate printing data.

S112: The printing confirmation part302of the graphics part33reads DEVMODE′ that the UI part34has thus obtained, and determines whether an application that is the calling source is a specific application. At this time, the “preview setting” has been registered in DEVMODE′ as shown inFIG. 9B. Thus, the printing confirmation part302determines that the specific application (i.e., the Preview.exe32) has carried out the calling.

S113: The rendering part301carries out the pre-processing according to the determination result of the printing confirmation part302, and then, carries out the post-processing. The rendering part301sends the printing data to the spooler37.

S114: The spooler37gives the printer200the printing data, and gives an instruction thereto to carry out printing.

FIG. 15schematically illustrates the processes S109through S114. As mentioned above, the Preview.exe32sends DEVMODE′ to the UI part34and sends the “int printing data” to the graphics part33. The rendering part301needs DEVMODE′, and thus, the UI part34sends DEVMODE′ to the rendering part301. It is noted that the rendering part301operates under the system privilege of the OS10, and the UI part34operates under the user privilege. Thus, the rendering part301and the UI part34cannot communicate with one another directly. However, they can access DEVMODE (or DEVMODE′) in common.

After that, the process of the printer driver30shown on the right side ofFIG. 13is started. As mentioned above, the rendering part301generates data shown below based on the determination result indicating that the printing confirmation part302has been called by the specific application.

(a)—specific: Job int control data that is generated from DEVMODE′

(b)—specific: Page int control data that has been obtained from Preview.exe32(i.e., Page int control data is not created from DEVMODE′)

(c)—specific: the int rendering data that will be given to the post-processing

That is, in a case where the rendering part301has been called by the specific application (i.e., the Preview.exe32), the int printing data that has been already created is obtained, and thus, a process is skipped over for data for which the process is not required.

The rendering part301generates data shown below in the post-processing.

(d): Job control data that is created from the Job int control data (newly created)

(e): Page control data that is created from the Page int control data (the same as the original one)

(f): rendering data that is created from the int rendering data (the same as the original one)

The printer200can carry out printing as usual by using the printing data thus obtained from the post-processing.

FIG. 16is one example of a sequence diagram illustrating an operation procedure of the PC100. It is noted that inFIG. 16, the GDI38and so forth are omitted.

S1: As a result of a user's operation, the application31starts the UI part34, and the user carries out printing settings. The application31carries out the printing settings in the UI part34(i.e., creates DEVMODE).

S2: The application31calls the graphics part33via the GDI38, and starts printing.

S2.1: The rendering part301of the graphics part33reads DEVMODE, and carries out the pre-processing of generating the data of “(a)—general” through “(c)—general” (mentioned above) that are those generated in the pre-processing when the rendering part301has been called by the general application31. DEVMODE and the thus created “int printing data” are stored as a file.

S3: The application31gives an instruction to the UI part34to finish printing, when the “int printing data” has been thus generated.

S3.1: The UI part34starts the Preview.exe32since “to display printing preview screen page” has been set in DEVMODE.

S3.1.1: The Preview.exe32obtains the “int printing data” and DEVMODE.

S3.1.2: The Preview.exe32deletes the “int printing data” and DEVMODE, from which the “int printing data” and DEVMODE have been thus obtained in S3.1.1. This is because, since the Preview.exe32has thus already secured the “int printing data” and DEVMODE, the “int printing data” and DEVMODE that have been previously stored are to be deleted so that existence of the two sets of the “int printing data” and DEVMODE will be avoided. It is noted that the deletion process of S3.1.2may be carried out after “preview displaying” instead of this timing.

S4: The Preview.exe32requests the UI part34to start printing.

S5: The Preview.exe32calls the GDI38with the Escape ( ) function, and starts printing.

Thus, the rendering part301reads DEVMODE′, and generates the data of “(a)-specific” through “(c)-specific” (mentioned above) and carries out the post-processing.

Thus, in the printer driver30according to the first embodiment, a specific application carries out “preview setting” in DEVMODE, thus the graphics part33detects that it has been called by the specific application, and thus can carry out special processes.

A variant of the first embodiment will now be described. According to the first embodiment, the Preview.exe32carries out “preview setting” in dmReserved1 and dmReserved2 of DEVMODE. However, it is also possible to carry out “preview setting” in another member variable(s) of the Public area.

FIG. 17shows one example of “preview setting” to be registered in another member variable(s) of the Public area. “dmDisplayFrequency” is a member variable for designating the frequency of the display device19in Hz units. This member variable does not function at a time of printing by the printer200(i.e., is not read when printing data is created). Thus, this member variable can be used by the Preview.exe32for “preview setting”. Any value may be set in “dmDisplayFrequency”. However, since usually a numerical value is set there, the Preview.exe32may set in “dmDisplayFrequency” a character code (for example, “Prev”) or the like other than a numerical value.

Thus, in the printer driver30according to the first embodiment or the variant thereof, processing contents of the graphics part33can be controlled by using a member variable(s) of DEVMODE which is not used depending on a device.

Second Embodiment

As a second embodiment, a printer driver30will be described in which a graphics part33determines an application that has carried out calling without using DEVMODE.

At a time of printing document data, an application calls a GDI38with a StartDoc ( ) function. The format of the StartDoc ( ) function is, for example, as follows:

It is noted that “hdc” is included in a return value of a CreateDC ( ) function that the application31has already called. “DOCINFO” is called a DOCINFO structure. In the DOCINFO structure, a document name of document data and a document name of an output file are designated. “*lpdi” is a pointer to the DOCINFO structure.

FIG. 18Ashows one example of a format of the DOCINFO structure.

In “cbSize”, the size of the DOCINFO structure is designated.

In “lpszDocName”, the name of document data is designated.

In “lpszOutput”, a pointer to a character string that indicates the name of an output file is designated. It is also possible to designate NULL in “lpszOutput”.

In “lpszDataType”, a character string that indicates a data type for recording a printing job is designated.

In “fwType”, additional information of the printing job is designated.

The application31manages the document name of document data, and thus, the document name is known. Thus, it is possible to notify the GDI38of the document name of document data, by setting the document name in “lpszDocName” of the DOCINFO structure when carrying out a GDI call using the StartDoc ( ) function.

Then, the GDI38uses a DrvStartDoc function when calling the graphics part33with a DDI call.

FIG. 18Bshows one example of a format of the DrvStartDoc ( ) function.

In “*pso”, a pointer to a SURFOBJ structure is stored.

In “pwszDocName”, a pointer to the document name of document data to be printed is stored.

In “dwJobId”, JOBID for uniquely identifying the job is stored.

Thus, the graphics part33can obtain the document name of document data from an argument “pwszDocName” of the DrvStartDoc ( ) function.

Thus, by giving a specific name as the document name of document data that is thus set in “lpszDocName” when a specific application (i.e., a Preview.exe32) calls the StartDoc ( ) function, the graphics part33can determine that it has been called by the specific application (i.e., the Preview.exe32).

FIG. 19shows one example of the document name that the Preview.exe32gives. The Preview.exe32, for example, attaches a suffix such as “_PREVIEW” to the document name of document data, i.e., “memo pad-untitled-” (resulting in “memo pad-untitled-—PREVIEW”), and then, sets the thus obtained document name of document data in “lpszDocName”. It is noted that a document name that the application31such as document creation software manages is included in “Job int control data”.

It is noted that, inFIG. 19, the suffix is attached to the document name. However, it is also possible to attach a prefix instead. In this case, the Preview.exe32attaches a prefix “PREVIEW-” to the document name of document data, i.e., “memo pad-untitled” (resulting in “PREVIEW-memo pad-untitled”). Thus, in this case, in “lpszDocName”, the thus obtained document name “PREVIEW-memo pad-untitled” is set.

The above-mentioned “PREVIEW” is one example, and, any other word or term which a user rarely attaches at the beginning or the end of a document name may be used instead. For example, “Special_Application” or the like may be used. Further, it is not necessary to select such a word or term that has meaning. It is also possible to use a random combination of characters/letters, signs and/or numerals, of greater than or equal to a predetermined number of characters, digits, or the like.

FIG. 20is one example of a sequence diagram illustrating an operation procedure of the PC100. Of the processes ofFIG. 20, those from S1through S3.1.3are the same as those ofFIG. 16.

S1: As a result of a user's operation, the application31starts the UI part34, and the user carries out printing settings. The application31carries out the printing settings in the UI part34(i.e., creates DEVMODE).

S2: The application31calls the graphics part33via the GDI38, and starts printing.

S2.1: The rendering part301of the graphics part33reads DEVMODE, and carries out the pre-processing of generating the data of “(a)—general” through “(c)—general” to be generated when the rendering part301has been called by the general application31. DEVMODE and the thus created “int printing data” are stored as a file.

S3: The application31gives an instruction to the UI part34to finish printing when the “int printing data” has been thus generated.

S3.1: The UI part34starts the Preview.exe32since “to display printing preview screen page” has been set in DEVMODE.

S3.1.1: The Preview.exe32obtains the “int printing data” and DEVMODE.

S3.1.2: The Preview.exe32deletes the “int printing data” and DEVMODE from which the “int printing data” and DEVMODE have been thus obtained in S3.1.1. This is because, since the Preview.exe32has thus already secured the “int printing data” and DEVMODE, the “int printing data” and DEVMODE that have been previously stored are to be deleted so that existence of the two sets of the “int printing data” and DEVMODE will be avoided. It is noted that the deletion process of S3.1.2may be carried out after “preview displaying” instead of this timing.

S3.2: The Preview.exe32sets the document name, to which “PREVIEW-” has been attached, in “lpszDocName” until calling the GDI38.

S4: The Preview.exe32starts the UI part34and carries out printing settings. According to the second embodiment, DEVMODE is sent to the UI part34when the user has not changed printing settings.

S5: The Preview.exe32starts printing by calling the StartDoc ( ) function to the GDI38.

S5.1: The GDI38carries out a DDI call to the graphics part33with the DrvStartDoc ( ) function.

Thus, the rendering part301reads “pwszDocName”, obtains the document name, to which “PREVIEW-” has been attached in S3.2, determines that it has been called by the specific application (i.e., the Preview.exe32), thus generates the data of “(a)-specific” through “(c)-specific” and carries out the post-processing.

Thus, in the printer driver30according to the second embodiment, as a result of a specific application setting a specific document name to document data, the graphics part33detects that it has been called by the specific application, and can carry out specific processes.

According to the embodiments, it is possible to provide an information processing apparatus by which it is possible to carry out a different process depending on an application that has carried out a call.

The information processing apparatus, the computer readable information recording medium and the method of controlling the information processing apparatus have been described by the embodiments. However, the present invention is not limited to these embodiments, and variations and modifications may be made without departing from the scope of the present invention.

The present application is based on Japanese Priority Application No. 2011-196124, filed Sep. 8, 2011, the entire contents of which are hereby incorporated herein by reference.