Field of Art
The present disclosure relates to a technique for communication between an application and a printer driver.
Description of the Related Art
Techniques for communicating arbitrary data other than print data between an application and a printer driver have been conventionally discussed. Japanese Patent Application Laid-Open No. 10-248014 discusses a technique for performing a system call using ExtEscape, as a method for allowing an application to determine whether a printer driver supports an image server interface.
According to an aspect of the present disclosure, an information processing apparatus includes a printer driver. The printer driver includes a receiving unit configured to receive document data, a determination unit configured to determine whether a meta image is present in the document data, wherein the meta image in which metadata is saved in an area for storing information different from information about rendering an image, and an acquisition unit configured to acquire the metadata included in the meta image from the document data, in a case where the determination unit determines that the meta image is present in the document data.
Further features will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
The exchange of arbitrary data using ExtEscape discussed in Japanese Patent Application Laid-Open No. 10-248014 is not supported by a module for print processing, in some version of a print system in which the printer driver operates. In this case, necessary communication cannot be performed between the application and the printer driver, and therefore a desired function cannot be implemented.
The present disclosure is directed to communication of arbitrary data, performed between an application and a printer driver, regardless of the version of a print system.
An exemplary embodiment will be described in detail below with reference to the drawings.
In Windows® 8 of Microsoft®, a printer driver can be developed based on a new architecture called a V4 printer driver in addition to a V3 printer driver.
In the V4 printer driver, a Microsoft-predefined document format called eXtensible Markup Language (XML) Paper Specification (XPS) is used for rendering data.
Graphics Driver Interface (GDI) and XPS are different in terms of a rendering system. However, since a conversion module called Microsoft XPS Document Converter (MXDC) for converting GDI into XPS is provided, an application can perform printing in the V4 printer driver while keeping GDI.
The V3 printer driver has a capability of processing not only a rendering command as application programming interface (API) of GDI, but also API of ExtEscape for transmitting arbitrary data. However, as will be described in detail below, MXDC serving as the conversion module cannot receive arbitrary data using ExtEscape.
In other words, an application may perform communication control using ExtEscape in combination with the V3 printer driver, but cannot perform this communication control in combination with the V4 printer driver.
Therefore, a method for performing communication between the application and the V4 printer driver without using ExtEscape will be described below.
Now, there will be described a difference between these two cases, in terms of communication between the application and the printer driver. The V3 graphics module 307 described with reference to
In step S102, the application 301 generates a meta image in a Portable Network Graphics (PNG) format including information about the encryption certificate. In the V3 printer driver, an encryption certificate can be transmitted from the application side to the printer driver side using ExtEscape of GDI. In the V4 printer driver, however, an encryption certificate cannot be transmitted using ExtEscape. Therefore, in the present exemplary embodiment, transmission is performed via data referred to as “meta image” in place of ExtEscape. In the meta image, the arbitrary data (metadata) is saved in an area (referred to as “expanded area” in the present specification) for storing information other than information about rendering in an image format. The meta image is image data not affecting a print result. Not affecting the print result means that, when print processing is performed based on print data converted from document data in the printer 20, no print processing is performed based on the meta image included in the document data. This will be described in detail below. In addition, a format not to be converted by the conversion module (the MXDC 302) of the document data is used as the format of the meta image. This will also be described in detail below. In the present exemplary embodiment, a PNG format is used. However, an expanded area for other formats such as Joint Photographic Experts Group (JPEG) is provided, and an image format not to be converted by the MXDC 302 as with PNG can be used as appropriate. The meta image is generated conforming to a format to be described with reference to
Assume that, in the present exemplary embodiment, an ancillary chunk referred to as naNo is uniquely defined to allow storage of the arbitrary data. Assume that, however, information of the arbitrary data (here, the encryption certificate, which is approximately 1 KB) is temporarily stored in a different package format (to be described below) and then stored into the naNo chunk. The meta image in the present exemplary embodiment is intended to transmit the arbitrary data. For the meta image, a size of 1×1 pixel and 24-bit color of 100% transmittance are specified so as not to affect a print result and print performance, while maintaining a minimum appearance as an image. In other words, the meta image is transparent image data. Therefore, even if the document data including the meta image is converted into the print data and then transmitted to a printer, the meta image is not rendered by the printer. Information about rendering contents, such as size and color, is stored into IDAT. An area of IDAT in the meta image is therefore a data area not affecting the print result. In the case where the 24-bit color is specified, the critical chunk PLTE is omitted. Accordingly, the meta image in the present exemplary embodiment includes the four chunks of IHDR, IDAT, naNo, and IEND.
Therefore, the package format of a flexible length as illustrated in
The description will continue returning to
To enable support of the meta image function in various types of applications, generation processing (step S102) and transmission processing (step S103) for the meta image may be developed as an independent library component, and called from an application.
The parts for defining the document structure include FixedDocumentSequence, FixedDocument, and FixedPage, each expressing an hierarchical structure of a document. Specifically, the documents expressed in the hierarchical structure by FixedDocumentSequence, FixedDocument, and FixedPage are a job, a document, and a page, respectively. In addition, a part called PrintTicket, in which a print setting is expressed in the XML format, is associated with each of the parts of the document structure. PrintTicket is referred to as Job-level PrintTicket, Document-level PrintTicket, or Page-level PrintTicket, depending on which part of the document structure is associated with PrintTicket.
Here, FixedPage is data in the XML format, in which various rendering commands predefined in XPS such as a text, graphics, and an image are described. FixedPage is associated with parts of a rendering resource to which the rendering command described in FixedPage refers. Specifically, the parts include a font, image data, and a color profile (the parts each referred to as “page part”). Jpeg, PNG, and HD Photo formats are defined for the image data in XPS. When a format different from these formats is input through GDI, the MXDC 302 converts the input format into Jpeg or PNG, and stores the result of this conversion into XPS as parts. Examples of the other formats include device independent bitmap (DIB). However, when Jpeg or PNG is input using API of GDI+, conversion to other formats is unnecessary, and therefore the MXDC 302 stores the input format as-is into XPS. For this reason, the metadata in the meta image input from the application 301 is stored into XPS without being lost.
When the filter pipeline manager 303 receives the document data in the XPS format from the conversion module (the MXDC 302), processing of the filter pipeline manager 303 starts. The filter pipeline manager 303 receives the document data in the XPS format and loads the filter 304. Then, the filter pipeline manager 303 transmits the received document data in the XPS format to the filter 304. The filter 304 of the printer driver therefore receives the document data from the application 301, via the MXDC 302 and the filter pipeline manager 303.
In step S301, upon receiving document data in the XPS format, the filter 304 acquires FixedDocumentSequence at the highest level of the document structure from within XPS by a receiving unit. In step S302, the filter 304 acquires FixedDocument at a level immediately below the highest level. Subsequently, in step S303 and step S304, the filter 304 acquires FixedPage at a level below FixedDocument for all the existing parts (for all the number of pages). Specifically, in step S303, the filter 304 determines whether the next FixedPage is present. When the next FixedPage is present (YES in step S303), the processing proceeds to step S304, and if not (NO in step S303), the processing ends. In step S304, the filter 304 acquires the next FixedPage.
The filter 304 as a determination unit determines whether a meta image is present in the document data, and performs processing for acquiring metadata as an acquisition unit from the meta image when the meta image is determined to be present. Specifically, after acquiring FixedPage in step S304, the filter 304 performs the following. In step S305, the filter 304 determines whether a next page part is present. If the next page part is present (YES in step S305), then in step S306, the filter 304 acquires a page part associated with the next FixedPage. In step S307, the filter 304 determines whether an image is the meta image if the acquired page part is an image in the PNG format. Specifically, in step S307, the filter 304 determines whether the image is the meta image by checking whether the ancillary chunk naNo is present. If the image is the meta image (YES in step S307), the processing proceeds to step S308. In step S308, the filter 304 acquires the package format described with reference to
In step S309, the filter 304 converts FixedPage and the page part into PDL, after acquiring all the page parts. In step 3310, the filter 304 determines whether the encryption certificate is already extracted. If the filter 304 determines that the encryption certificate is already extracted (YES in step S310), i.e., if step S308 is executed, the processing proceeds to step S311. In step S311, the filter 304 encrypts the PDL based on the extracted encryption certificate. Subsequently, in step S312, the filter 304 transmits the encrypted PDL to the spooler 305. When the encryption certificate is not yet extracted (NO in step S310), the filter 304 transmits the PDL to the spooler 305 without encrypting the PDL. In this way, the printer driver converts the document data into the print data, and transmits the print data to the printer 20 via the spooler 305 and the port monitor 306. This ends the description of the print processing in the present exemplary embodiment.
In the present exemplary embodiment, the processing for transmitting the encryption certificate is described. In communication using a meta image, an application can transmit arbitrary information to a printer driver, and control printing. For example, the present embodiment is applicable to PostScript Pass-Through in the V3 printer driver. The present embodiment is also applicable to a use case of transmitting API for a rendering instruction of GDI such as a halftone copy-forgery-inhibited pattern image, and information incapable of being expressed in XPS.
In addition, the meta image may be transmitted a plurality of times in one job or in one page. In a case where the meta image is transmitted a plurality of times in one page, a different rendering attribute may be provided to each meta image to prevent the meta image from being eliminated by the MXDC 302 as a redundant image during the conversion to XPS. Specifically, control is performed to change a rendering position and a color (RGB components except for transparent components) of each meta image. Alternatively, the size of the meta image may be freely changed within a range of, for example, about ten pixels.
The meta image has been described above as an image having pixels of a transparent color. However, a system can be configured using other schemes for preventing an influence on a print result regardless of a pixel color. For example, the meta image may be placed in an area where the document data is not rendered. Specifically, the rendering position of the meta image may fall outside an area of a print sheet without fail, or a clip may be specified to prevent the meta image from being rendered. Alternatively, when the page part is determined to be the meta image in step S307, the meta image may be deleted from the document data in the XPS format, after the metadata has been acquired from the meta image in step S308. This prevents the conversion into PDL.
The method for preventing the printer from performing printing based on the meta image has been described above. However, other images that hardly affect the print result may be adopted. Specifically, the size of the meta image may be a 1×1 pixel of yellow close to white, and this pixel may be placed in a white background in a rendering area of the document data.
Moreover, in the present exemplary embodiment, the print system for transmitting PDL to the printer and causing the printer to perform printing has been described as an example. However, the embodiment is also applicable to an information system on which other types of printer drivers is installed. For example, the embodiment may be applied to a system such as a document system including a virtual V4 printer driver that converts a print instruction from an application into PDF, and stores the PDF into a file.
According to the present exemplary embodiment, communication of arbitrary data between an application and a printer driver can be implemented regardless of the version of the print system.
Embodiment(s) can also be realized by a computer of a system or apparatus that reads out and executes 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 includes 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 computer 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 computer may comprise one or more processors (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 computer, 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. The various units of an embodiment can be implemented by one or more processors, a processor executing instructions in a software module associated with each unit, or a software module associated with each unit. Examples of such include but are not limited to: a receiving unit; a determination unit; an acquisition unit; a generation unit; a transmission unit; and other units which implement a instructions for performing portions of a method.
While the present invention has been described with reference to exemplary embodiments, it is to be understood that the invention 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 Japanese Patent Application No. 2016-034835, filed Feb. 25, 2016, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2016-034835 | Feb 2016 | JP | national |