The present invention relates to an information processing apparatus for processing a structured document, an information processing method, and a storage medium storing a program thereof.
Acquiring various information by accessing web pages on the Internet is now common. These web pages are displayed on a display by software called a browser, based on a structured document written in a structured language such as HTML (HyperText Markup Language) or XHTML (Extensible HyperText Markup Language).
Also, using FRAME elements or IFRAME (Inline FRAME) elements in a web page enables other structured documents to be embedded in the web page and displayed in the browser. Thus, in the case where a structured document is embedded in a web page using a FRAME element or an IFRAME element, another web page can be displayed as a partial area of the web page.
On the other hand, in the case of printing a web page with a printing apparatus, depending on the user, he or she may want to print a partial area of the web page rather than the entire web page. In view of this, Japanese Patent No. 3588337 describes a technique for designating an area to be printed within a web page in accordance with an instruction by the user, and extracting and printing the designated area as an image. This enables the user to, for example, select an area within a web page displayed in the browser using a pointing device or the like, and extract and print the selected area as an image.
In the case of designating an area to be printed within a web page, as with the technique described in the abovementioned Japanese Patent No. 3588337, for example, the user is able to view the web page displayed on the display screen, and check the contents of the web page. Also, as described above, in the case where the structured document contains a FRAME element or an IFRAME element, another web page is displayed in a partial area within the web page. The user is able to check the contents of a web page that has been inserted into a web page, and designate an area to be printed within the web page that has been inserted. However, since the inserted web page is displayed as a partial area within a web page, the user has to check the contents of the web page in a small display area.
An aspect of the present invention is to eliminate the above-mentioned problems with the conventional technology. The present invention provides an information processing apparatus that enables a user to easily check a partial area of a web page, an information processing method, and a storage medium storing a program thereof.
The present invention in its first aspect provides an information processing apparatus comprising: first acquiring means for acquiring a first structured document, the first structured document having designated a second structured document to be inserted into a prescribed area within the web page that is based on the first structured document; second acquiring means for acquiring the second structured document designated in the first structured document acquired by the first acquiring means; and outputting means for outputting the second structured document acquired by the second acquiring means in a manner that is distinguishable from the first structured document acquired by the first acquiring means.
The present invention in its second aspect provides an information processing method comprising: acquiring a first structured document, the first structured document having designated a second structured document to be inserted into a prescribed area within the web page that is based on the first structured document; acquiring the second structured document designated in the acquired first structured document; and outputting the acquired second structured document in a manner that is distinguishable from the acquired first structured document.
The present invention in its third aspect provides a computer-readable storage medium storing a program for causing a computer to execute: acquiring a first structured document, the first structured document having designated a second structured document to be inserted into a prescribed area within the web page that is based on the first structured document; acquiring the second structured document designated in the acquired first structured document; and outputting the acquired second structured document in a manner that is distinguishable from the acquired first structured document.
According to the present invention, the user is able to easily check a partial area of a web page.
Further features of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.
Preferred embodiments of the present invention will now be described hereinafter in detail, with reference to the accompanying drawings. It is to be understood that the following embodiments are not intended to limit the claims of the present invention, and that not all of the combinations of the aspects that are described according to the following embodiments are necessarily required with respect to the means to solve the problems according to the present invention. Note that the same reference numerals are given to constituent elements that are the same, and description thereof will be omitted.
A display apparatus 206 includes a CRT or a liquid crystal display and a graphics controller, and displays web pages downloaded from the WWW servers 103, print preview images, GUIs and the like. An input apparatus 207 is for the user to give various instructions to the PC 101, and is, for example, a pointing device or a keyboard. A system bus 209 connects the CPU 201, the RAM 202, the ROM 203, the hard disk 204 and the like, and data to be processed in the PC 101 is communicated over the system bus 209. A LAN interface 208 is an interface for having a LAN cable connected thereto. Data communication by the LAN cable can be performed with the external WWW servers 103 via a router (not shown) and the network 102, using the LAN interface 208. A configuration may also be adopted in which wireless data communication is performed by configuring the PC 101 with a wireless interface. Also, the PC 101 shown in
A structured document print module 302 is plug-in software that is called by the browser 301 with a structured document 303 as a parameter, and acquires the structured document 303 when called by the browser 301. This module acquires a first structured document or a second structured document that are described below. The structured document print module 302 is executed in the case where the user gives an instruction for performing area selection to the browser 301. Here, area selection refers to processing for selecting an area in a web page to be printed, for example. Note that while the following description relates to processing for printing an image of an area selected in the web page, the present invention is not limited thereto, and can be applied in the case where various processing such as display, storage or transfer of an image of a selected area is performed.
A partial display element detection unit 304 detects partial display elements such as IFRAME elements by analyzing the structured document 303 and determining whether any partial display elements are contained therein. Note that a partial display element is an element whose display is partially restricted when a web page is displayed based on the structured document 303. Elements for inserting a structured document, such as IFRAME elements, for example, may be detected, or elements for which scroll display is designated by an overflow attribute may be detected. A partial display element rendering unit 306 displays images based only on partial display elements detected by the partial display element detection unit 304, among the elements contained in the structured document 303.
A display area changing unit 308 switches the display in a structured document display area in which a web page is displayed in the browser 301, in the case where it is determined by the partial display element detection unit 304 that the structured document 303 contains a partial display element. In the present embodiment, the display area changing unit 308 switches display in the structured document display area of the browser 301 between display of the entire web page based on the entire structured document using a structured document rendering unit 305, and display based only on the partial display element detected by the partial display element rendering unit 306. In other words, when the entire web page is displayed, an element that is partially displayed in the web page can be enlarged. This switching of the display is performed in response to an instruction being input by the user, for example.
Note that at this time the structured document rendering unit 305 performs rendering in a storage area (not shown) of the RAM 202 based on the entire structured document, and creates an intermediate data file. The partial display element rendering unit 306 renders the entire partial display element including hidden areas of the element in the structured document that are not displayed in the web page, based on the storage area (not shown), and creates an intermediate data file. At this time, since the entire partial display element is rendered, areas that are not displayed (hidden areas) when the web page is displayed based on the structured document 303 are also rendered. Also, whether an intermediate data file is created in the structured document rendering unit 305 or the partial display element rendering unit 306 is dependent on the switching by the display area changing unit 308.
Note that an intermediate data file is a file that holds character information and graphics information as vector data rather than bitmap data, and is created in order to display or print a web page, for example. In particular, with the present embodiment, in order to enable a given area within a web page to be selected and extracted, that is, in order to enable part of an element in a structured document to be extracted, the intermediate data file desirably is capable of extracting part of the vector data. A PDF (Portable Document Format) file, an EMF (Enhanced Metafile Format) file, an XPS (XML Paper Specification) file or the like, for example, can be used as such an intermediate data file.
An area selection child window control unit 307 performs rendering based on an intermediate data file created by the structured document rendering unit 305, and displays a web page in the browser 301. At this time the area selection child window control unit 307 displays a web page that is based on the entire structured document in the structured document display area of the browser 301, and enables an arbitrary area of the web page to be selected by the user. Also, the area selection child window control unit 307 displays an intermediate data file created by the partial display element rendering unit 306 as a partial display element in the structured document display area of the browser 301, and enables an arbitrary area thereof to be selected by the user. Note that whether the area selection child window control unit 307 performs display on the browser 301 based on the entire structured document or a partial display element is dependent on the switching by the display area changing unit 308.
A selected area data extraction unit 309 is executed in the case where the user has selected an area within a web page and given a print or print preview start instruction targeting the selected area to the browser 301. The selected area data extraction unit 309 acquires the coordinates and size, in the web page, of an area selection rectangle 502 set by the area selection child window control unit 307, and extracts the element included in this area selection rectangle 502 within the structured document as an intermediate data file. Note that the coordinates and size of the area selection rectangle 502 acquired by the selected area data extraction unit 309 are the absolute coordinates and absolute size in the entire web page. Alternatively, the coordinates and size within the window displayed by the browser 301 in the area in which the web page is displayed may be acquired. In this case, the coordinates and size, in the web page, of the window displayed by the browser 301 are specified. Then, by converting the coordinates and size of the area selected by the user in the window to the coordinates and size in the entire web page based on the coordinates and size of the window, the coordinates and size of the area selected by the user in the entire web page can be acquired. Also, the selected area data extraction unit 309 extracts the element based on the coordinates and size of the area selection rectangle 502 in the entire web page, when the entire structured document is displayed by the area selection child window control unit 307. Incidentally, it may be the case that a partial area of a web page is displayed by the area selection child window control unit 307 based on a partial display element such as an IFRAME element. At this time, the selected area data extraction unit 309 extracts an element contained in the partial display element, based on the coordinates and size of the area selection rectangle 502 in the partial display element.
A print layout unit 311 determines the layout of the intermediate data file extracted by the selected area data extraction unit 309 to correspond to the paper on which the printer will print in accordance with the print settings. Here, print settings include information such as paper size, resolution, and the printable area of the paper, and are acquired from a printer driver 314 via an OS 313. A print preview unit 310 performs rendering in accordance with the element laid out by the print layout unit 311, and displays the rendered image on the display apparatus 206 as a print preview. A print processing unit 312, on receipt of a print start instruction from the user, executes rendering in accordance with placement information of the element laid out by the print layout unit 311. The OS 313 provides an API (Application Programming Interface) for the structured document print module 302 and the printer driver 314 to perform transmission/reception of print settings data and rendering. Also, the OS 313 includes a spooler system for managing print jobs and various control software such as a port monitor for outputting printer commands to a port, although a detailed description thereof is omitted. The printer driver 314 generates print data in accordance with the rendering executed by the print processing unit 312, converts the print data to a printer command, and transmits the printer command to the printer 104. The printer 104 prints an image on paper based on the printer command received from the printer driver 314.
As shown in
As shown in
Also, as shown in
Also, as shown in
Note that in the present embodiment an example was described in the case where one partial display element such as an IFRAME element is included. However, in the case where a plurality of IFRAME elements are included, the IFRAME element corresponding to the largest area in the web page, among the plurality of IFRAME elements, may be enlarged in the case where the Enlarge Frame button 506 of
The area selection child window control unit 307 renders the structured document 303 acquired from the browser in the area selection child window 701. The area selection child window 701 displays a scroll bar 702, in the case where the web page based on the first structured document 407 is larger than the child window. The user is able to display all areas of the structured document by scrolling the scroll bar 702.
The area selection child window 701 further displays the area selection rectangle 502 as a translucent rectangle. The area selection child window control unit 307 performs re-rendering after changing the coordinates and size of the area selection rectangle 502 in the web page that is based on the structured document 303, as the result of an instruction to change the size of the area selection rectangle 502 given by the user using an input apparatus 207 such as a pointing device. The user is able to designate an arbitrary rectangular area of the structured document as a selected area using an input apparatus 207 such as a pointing device. Note that the area selection child window 701 shown in
Here, the data structure of a structured document used in the present embodiment will be described.
Each element node holds data such as a pointer to a parent element node, a pointer to a sibling node, a pointer to a list of child nodes, attribute information, and text information. The display state and layout information of each element is defined in a CSS file, and the CSS files are stored in a temporary storage area as information on the element nodes of the DOM tree. For example, the font type, font size, character color and display position of the element are stored as such information on the element nodes. In the present embodiment, only elements are treated as nodes, and attribute and text information are treated as information on the element nodes. However, attribute and text information may also be treated as nodes of the DOM tree.
As shown in
In S803, partial display elements within the structured document are detected by the partial display element detecting unit 304. Here, when a partial display element is detected, the Enlarge Frame button 506 is displayed in an enabled state in the browser 301 by the display area changing unit 308. Note that, in the present embodiment, the number of detected partial display elements is stored in the storage area of the RAM 202 or the like. Note also that the View Full Page button 507 is displayed in the browser 301 in a disabled state.
In S804, the structured document display area is rendered by the structured document rendering unit 305 to create an intermediate data file in EMF format. At this time, in the present embodiment, an EMF intermediate data file for the entire structured document is created by repeating the rendering process for different display areas while scrolling through the <body> element.
In S805, the intermediate data file for the entire structured document created at S804 is displayed in the area selection child window 701, as shown in
In S806, the processing waits for input of a pointing device operation by the user. Here, in the case where the Cancel button 505 is pressed, the processing proceeds to S817, where the process of capturing an event of the pointing device is cancelled, and the processing shown in
In S806, in the case where the Enlarge Frame button 506 is pressed, the processing proceeds to S808, where the number of detected partial display elements is determined. Here, in the case where it is determined that two or more partial display elements were detected, a screen for prompting the user to select a partial display element to be enlarged is displayed in S809. Thereafter, the processing proceeds to S810 once the user has selected an element to be enlarged to a larger area. On the other hand, the processing also proceeds to S810 in the case where it is determined that one partial display element was detected, with that partial display element targeted for enlargement. In S810, the display area of the selected partial display element is rendered by the partial display element rendering unit 306 to create an intermediate data file in EMF format. At this time, in the present embodiment, an EMF intermediate data file for the target partial display element is created by repeating the rendering process for different areas in the partial display element that are to be displayed, while scrolling through the partial display element in the state shown in
In the case where the View Full Page button 507 is pressed in S806, the processing of S812 and S813 is executed, and the entire structured document is displayed in the area selection child window 701. The processing of S812 and S813 is respectively similar to the processing of S804 and S805. It may be the case that the View Full Page button 507 is pressed to again display the full page after a single partial display element has been enlarged in S805 to S811.
In the case where the Print button 503 is pressed in S806, the print processing of S814, S815 and S816 is executed, and the processing returns to S806. In S814, the coordinates of the area selection rectangle 502 displayed in the area selection child window 701 are acquired by the selected area data extraction unit 309. At this time, when the entire web page is displayed based on the first structured document, the coordinates in the entire web page are acquired. In the case where part of the web page that is based on the first structured document has been enlarged based on the second structured document, the coordinates in the web page that is based on the second structured document are acquired. In S815, the element corresponding to the area, in the first structured document or the second structured document, having the coordinates acquired at S814 by the selected area data extraction unit 309 is rendered to create an intermediate data file in EMF format. In S816, the layout of the intermediate data file created at S815 is determined by the print layout unit 311 as the layout of the print area, and the print processing unit 312 executes print processing.
The processing shown in
In the present embodiment, processing to display only the partial display element of a structured document in the entire structured document display area of the browser, and select an arbitrary area in the displayed element, on a display screen of the browser, is possible. Also, in the present embodiment, an intermediate data file is created by repeatedly scrolling and rendering an element selected as a second structured document on
Also, in the present embodiment, the case was described where an IFRAME element of a structured document is displayed in the entire structured document display area of the browser. However, an element having an overflow attribute attached or a FRAME element within a structured document can also be similarly displayed in the entire structured document display area of the browser. Also, in the present embodiment, an example implemented with a plug-in for printing a structured document was given, although the present invention is similarly applicable in the case where a structured document is only displayed. Note that in the above description an example was illustrated in which the user selects an area to be printed within a web page, and prints an image by outputting print data to a printer based on the selected area. However, the present invention is not limited thereto, and an image of an area selected by the user within a web page may be displayed on a display apparatus or stored in a storage apparatus.
A browser 301 is the same as the browser 301 described in Embodiment 1. A structured document display module 901 shown in
With regard to the structured document display module 901, a partial display element detection unit 304, a structured document rendering unit 305, a partial display element rendering unit 306 and a display area changing unit 308 are the same as described in
In the present embodiment, unlike Embodiment 1, the module provided separately to the browser does not necessarily require the function of selecting an area of a structured document and printing the selected area. Also, the present embodiment is not limited to switching between display of a partial display element of a structured document and display of the entire structured document, and display of a partial display element of a structured document and display of the entire structured document may be performed simultaneously in different windows.
In Embodiment 1 and Embodiment 2, the structured document print module 302 and the structured document display module 901 are realized as plug-in modules of the browser 301. The present embodiment is described in the case where a structured document display module is provided in the browser 301.
The browser 301 has a structured document acquisition unit 1001 for acquiring a structured document 303 from a web server and a structured document display unit 1002 that controls display of the structured document. In the case where the user instructs the browser 301 to display a partial display element, the structured document display module 1003 is executed, with the structured document 303 as a parameter. Here, the instruction to display a partial display element is the same as described in
With regard to the structured document display module 1003, a partial display element detection unit 304, a structured document rendering unit 305, a partial display element rendering unit 306 and a display area changing unit 308 are the same as described in
In the present embodiment, plug-in software is not required, because the browser 301 incorporates the structured document display module 1003. Also, in the above embodiments, processing for detecting a partial display element within a structured document, and displaying the partial display element was performed. However, the present invention is not limited thereto, and processing for outputting a partial display element detected in a web page that is based on a structured document to a storage apparatus to be stored thereon, or processing for transferring a detected partial display element to an external apparatus via a network such as the Internet may be performed, for example. Further, even in the case of printing a partial display element, the present invention is not limited to the case where the user selects an area to be printed as described above, and may be applied in the case where, in response to a partial display element being detected, the entire partial display element or a prescribed area thereof is output to a printer and printed thereon.
Also, in the above embodiments, an example was illustrated in which a link to another structured document is described as an IFRAME element of a structured document, and the linked HTML file is inserted. However, the present invention is not limited thereto, and the user is also able select an element to be output in the case where an HTML file is inserted as a FRAME element, similarly to the case of the above IFRAME element.
Further, in the above embodiments, an example was illustrated in which a structured document is inserted into the frame within a web page. However, the present invention is not limited thereto, and is also applicable in the case where, for example, a link to a document file created by a word processing application or a spreadsheet file created by a spreadsheet application is designated in a structured document, and inserted into a web page. Thus, when extracting a partial area of a document file or a spreadsheet file inserted into a web page, the partial area is extracted as an intermediate data file, similarly to the case where a partial area of a structured document inserted into a web page is extracted. Therefore, even if the partial area is magnified after being extracted, the magnification process is performed on vector data, enabling degradation of the image following magnification to be suppressed in comparison to the case where magnification is performed on bitmap data.
Note that in the above embodiments, HTML and XHTML documents were described as examples of structured documents, although the present invention is also applicable to various types of structured documents such as XML. Further, in the above embodiments, an example was illustrated in which a partial display element contained in a web page is displayed separately to the web page, although the present invention is not limited thereto, and a configuration may be adopted in which a partial display element in a web page is displayed in a manner distinguishable from other elements. In this case, various methods are conceivable, including coloring the area of the partial display element in the web page, for example. Also, in the case where a partial display element within a web page is thus displayed in a manner distinguishable from other elements, the partial display element may be enlarged, in response to an instruction being input by the user.
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 such modifications and equivalent structures and functions.
This application claims the benefit of Japanese Patent Application No. 2010-232783, filed Oct. 15, 2010, which is hereby incorporated by reference herein in its entirety.
Number | Date | Country | Kind |
---|---|---|---|
2010-232783 | Oct 2010 | JP | national |
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/JP2011/071774 | 9/16/2011 | WO | 00 | 3/14/2013 |