1. Field of the Invention
The present invention relates to a technique of rendering structured data.
2. Description of the Related Art
In recent years, cases in which information used for displaying or printing is expressed by structured data, such as Extensible Markup Language (XML), are increased. For example, cases in which an application for personal computers (PCs) which can display and edit an office document employs XML format as a file format of an office document are increased.
In the Word Wide Web (WWW), structured documents such as Hypertext Markup Language (HTML) or scalable vector graphics (SVG) are widely being used. In the case of using image data such as a photograph in structured data, a method of writing link information to image data in structured data is commonly being used.
A conventional apparatus can perform displaying or printing of structured data. In this apparatus, after structured data is analyzed, rendering is performed to generate rendering data used for displaying or printing. There are display apparatuses or printing apparatuses which can deal with various types of structured data. In these apparatuses, as a method of reducing a rendering time, there is a method of storing image data, as a rendering result, obtained by analyzing structured data in the apparatus (Japanese Patent Application Laid-Open Nos. 2002-278719 and 2004-266470).
However, in a processing module which performs analysis processing of structured data, as a specification of structured data is complicated, the size of the processing module itself is increased, and a required processing time is also increased.
Structured data of various formats are being distributed in the world, but there is a problem in that to cope with structured data of many types, the size of the processing module itself is increased as much. In particular, in an apparatus in which a storage area such as a read only memory (ROM) or a random access memory (RAM) is small or an apparatus in which the processing ability of a central processing unit (CPU) is not enough, the problems in the processing time or the size of the processing module are remarkable.
The present invention is directed to an information processing apparatus capable of reducing the processing time and the size of a processing module for performing rendering processing of data.
According to an aspect of the present invention, an information processing apparatus includes a determination unit configured to determine whether structured data including layout information and image information is in a predetermined format, and a rendering unit configured to perform rendering of the image information without using the layout information when the determination unit determines that the structured data is in the predetermined format, and to perform rendering of the image information using the layout information when the determination unit determines that the structured data is not in the predetermined format.
Further features and aspects of the present invention will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings.
The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate exemplary embodiments, features, and aspects of the invention and, together with the description, serve to explain the principles of the invention.
Various exemplary embodiments, features, and aspects of the invention will be described in detail below with reference to the drawings.
In
A scanner unit 104 optically reads a print to generate rendering data. The printing unit 105 prints image data on a recording paper using an ink jet technique. A display unit 106 provides a display to view by an operator, using a liquid crystal display (LCD) or a light emitting diode (LED). An operation unit 107 includes a hard button or a pointing device, and the operator can perform various input operations via the operation unit 107.
A network communication unit 108 is connected to a local area network (LAN) and performs various communications such as reception of print data. A memory card in which document data is stored can be inserted into an external storage device connection unit 109. The external storage device connection unit 109 reads various data from the inserted memory card. A plurality of memory cards may be inserted into the external storage device connection unit 109. A system bus 110 connects the respective units 101 to 109 to be communicated with each other.
As illustrated in
In the present exemplary embodiment, a case in which an archive file transmitted from the computer device 201 or the scanner device 204 to the printer device 203 is printed by the printer device 203 is described as an example. The printer device 203 is a configuration as an application example of the information processing apparatus of the present invention.
In
An XML file (a layout file) representing a rendering content (layout information) of each page is stored in a directory 603 with a name of Pages. A rendering content (layout information) of the first page of the document is described in XML format in an XML file 604 with a name of P1.xml. A rendering content of the second page of the document is described in XML format in an XML file 605 with a name of P2.xml. As the rendering contents described in the XML files 604 and 605, text data, graphic data, or arrangement information of image or text data is included. Link information to image data is also included in the XML files 604 and 605.
Since
The XML files 604 and 605 also include information such as types of fonts for rendering the text data, font sizes, link information to a font file, and a rendering position of each data. The graphic data included in the XML files 604 and 605 is data described in a vector format.
Image data or font data necessary for rendering of the document is stored in a directory 606 with a name of Resources. Image data necessary for rendering of the document is stored in a directory 607 with a name of Images. An image file 608 with a name of Image1.jpg corresponds to the image data 402 illustrated in
Glyph information of fonts used for rendering the text data stored in the XML files 604 and 605 is included in a font file NewFont.ttf. Link information to the font file 611 is described in the XML files 604 and 605. A font used here is an outline font.
Various types of metadata or a thumbnail image of the document is stored in a directory 612 with a name of DocProps. Various types of metadata such as a creation date, an edit date, and a creator of the document is stored in an XML file 613 with a name of Core.xml. An image file 614 with a name of Thumbnail.jpg is a thumbnail image in which a rendering result of the first page of the document is reduced.
As illustrated in
In the present exemplary embodiment, the archive file in which the file group of the configuration illustrated in
In step S701, the printer device of a comparative example acquires the XML file Main.xml 602 from the content section 502 of the archive file and analyzes the XML file Main.xml 602. Link information to an XML file describing rendering information of each page is described in the XML file Main.xml 602. Thus, in step S702, the printer device acquires the XML files (P1.xml 604 and P2.xml 605) from the content section 502 and analyzes the XML files.
In the XML files P1.xml 604 and P2.xml 605, link information to an image file or a font file is described. Thus, in step S703, the printer device acquires the image files (Image1.jpg 608, Image2.jpg 609, and Image3.jpg 610) and the font file (NewFont.ttf 611) from the content section 502 as needed and analyzes the image files and the font file.
Subsequently, in step S704, the printer device generates print data based on analysis results acquired by processing in steps S701 to S703. Then, in step S705, the printer device prints the print data.
As illustrated in
Since the document illustrated in
In
When the archive file of the document is generated with the configuration illustrated in
In step S1001, the printer device 203 reads the header section 501 of the archive file and acquires archive file information.
The archive file information includes information about whether the configuration of the content section 502 is in the simple document format, and then in step S1002, the printer device 203 determines the document format of the archive file based on the information.
When it is determined in step S1002 that the archive file is in the simple document format (YES in step S1002), then in step S1003, the printer device 203 does not perform analysis of the XML file, but acquires an image file in the Images directory 907 and generates print data. Thus, the printer device 203 generates the print data without using the layout information. On the other hand, when it is determined in step S1002 that the archive file is not in the simple document format (NO in step S1002), then in step S1004, the printer device analyzes the XML files starting with the XML file Main.xml 902 in order and generates print data. Thus, the printer device 203 generates the print data using the layout information. Processing in step S1004 is similar to processing insteps S701 to 5704 illustrated in
Subsequently, in step S1005, the printer device 203 prints the printing date generated by processing in step S1003 or S1004.
Due to execution of processing illustrated in
In
In
Information about whether the archive file is in the simple document format may not be included in the archive file information, but whether the archive file is in the simple document format may be determined based on information acquired from a transmission source of the archive file according to a communication protocol.
Next, a second exemplary embodiment of the invention will be described. In the second exemplary embodiment, similarly to the first exemplary embodiment described above, the printer device is described as an example. In the second exemplary embodiment, a printer configuration, a system configuration, and an archive file configuration are similar to the configurations of the first exemplary embodiment illustrated in
Even though not illustrated, among files illustrated in
In step S1301, the printer device 203 reads the header section 501 of the archive file and acquires archive file information. Information about whether the configuration of the content section 502 is in the second simple document format is included in the archive file information, and then in step S1302, the printer device 203 determines the document format of the archive file based on the information.
When it is determined in step S1302 that the archive file is in the second simple document format (YES in step S1302), then in step S1303, the printer device 203 reads and analyzes the XML file Core.xml 1212. The printer device 203 acquires page number information in which each image file included in the archive file is disposed and rendering position information of each image file.
Subsequently, in step S1304, the printer device 203 acquires each image file present in the Image directory 1207 and generates print data based on the information acquired in step S1303.
On the other hand, when it is determined in step S1302 that the archive file is not in the second simple document format (NO in step S1302), then in step S1305, the printer device 203 analyzes the archive file starting with the XML file Main.xml 1202 in order and generates print data. Processing in step S1305 is similar to processing in steps S701 to 5704 illustrated in
In step S1306, the printer device 203 prints the print data generated by processing in step S1304 or S1305.
In the present exemplary embodiment, page number information in which each image file is disposed and rendering position information of each image file are described in the XML file Core.xml 1212. The information may be described in the header section 501 of the archive file or a header section (not illustrated) of each image file instead of the XML file. The information may be included in a character string of a file name of each image file.
In the exemplary embodiments described above, printing by the printer device has been described as an example, but the present invention is not limited to the printer device but may be applied even when document data is displayed on a display device such as a television or an image viewer or a computer device with a rendering unit. In the exemplary embodiments described above, the case in which the archive file for printing is transmitted from the computer device 201 or the scanner device 204 to the printer device 203 has been described as an example. In addition, the exemplary embodiments may be applied even when the memory card including the archive file is inserted into the external storage device connection unit 109, and printing or displaying of the archive file present in the memory card is performed. In the exemplary embodiments described above, image data of Joint Photographic Experts Group (JPEG) format has been described as an example of resource data. The resource data is not limited to data of JPEG format but may include data of Portable Network Graphics (PNG) format or a bit map format or may be graphic data of vector format such as SVG.
Aspects of the present invention can also be realized by a computer of a system or apparatus (or devices such as a CPU or MPU) that reads out and executes a program recorded on a memory device to perform the functions of the above-described embodiment (s), and by a method, the steps of which are performed by a computer of a system or apparatus by, for example, reading out and executing a program recorded on a memory device to perform the functions of the above-described embodiment (s). For this purpose, the program is provided to the computer for example via a network or from a recording medium of various types serving as the memory device (e.g., computer-readable medium).
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 modifications, equivalent structures, and functions.
This application claims priority from Japanese Patent Application No. 2008-311295 filed Dec. 5, 2008, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2008-311295 | Dec 2008 | JP | national |