Abstract:
A method and apparatus for printing a hyperspacial document with multiple pages. Each of the pages is composed in a markup language, and a respective printing element is included in each of the pages. The printing element for a given page is either an indicator of which of the pages is to print after the given page or an indicator that there is no page that prints next. When the header portion of a given page is transferred, it is checked to determine whether it contains a printing element. If the printing element is present, then a command to print the multiple pages is activated. The pages are printed in the order specified by the printing elements.

Description:
BACKGROUND OF THE INVENTION 
     This invention relates to hypertext. In particular, this invention relates to printing information located in hyperspace. 
     With the enormous popularity of the World Wide Web, the old paradigm of a computer as a self-contained resource of essentially linear information has fallen by the wayside. The new paradigm is that of a computer as a resource of hierarchical information, some of which may be resident on another computer that is similarly situated as a hierarchical resource. However, despite the increasing use of such hyperspacial information, some implementations of user services still adhere to the old paradigm. 
     For example, users often want to print out information that exists only in an on-line format. Printing linear information, such as an e-mail message or a single web page is done quite easily by sending the file containing the e-mail, single web page, etc., to whatever print function is available on the user&#39;s system. For hyperspacial information, this simple approach does not work. In fact, in the existing art, a user typically manually downloads every component of the hyperspacial information one at a time and issues a separate print command for each element. Such repetitive downloading and printing can be a substantial amount of work. For example, a hyperspacial document describing the design of the user interface of Sun Microsystems&#39; web site is located at http://www.sun.com/sun-on-net/uidesign and extends over 15 pages. Many users have complained that this document is too difficult to print. 
     Furthermore, in the existing art, the resulting printouts typically have substantial amounts of whitespace since the components of the hyperspacial document typically have lengths that are different from a whole multiple of the length of a printer page. 
     HyperCard, a program available from Apple Computer of Cupertino, Calif., includes a &#34;Print Stack&#34; command that prints an entire set of hypertext pages if those pages have been stored in the same file. The pages are printed in the order in which they occur in the file. 
     The Print Stack command has four weaknesses: First, Print Stack only works if all the elements of the hyperspacial document are present in the same storage file. This weakness implies that all information has to be stored on the same computer and, thus, harkens back to the old paradigm. Second, Print Stack prints every single information unit that is present in the hyperspacial document--even where the author does not intend all of them to be of primary interest to the user. Third, Print Stack works only if all of the hypertext elements have the same size since it prints a fixed number (exactly one, exactly two or exactly four, depending on the user&#39;s preference) on every sheet of paper. Finally, Print Stack assumes that all elements of all pages are available, which may not be the case when printing information accessed over the Internet. 
     SUMMARY OF THE INVENTION 
     Herein is disclosed a method and apparatus for printing a hyperspacial document with multiple pages. In one embodiment, each of the pages is composed in a markup language, and a respective printing element is included in each of the pages. The printing element for a given page is either an indicator of which of the pages is to print after the given page or an indicator that there is no page that prints next. When the header portion of a given page is transferred, it is checked to determine whether it contains a printing element. If the printing element is present, then a command to print the multiple pages is activated. The pages are printed in the order specified by the printing elements. 
     The present invention allows the author considerably more flexibility in arranging the storage of the individual hyperspacial document components, which can be stored in multiple directories across multiple servers. 
     The present invention allows the author to eliminate some of the pages in a web space from the printout sequence. 
     The present invention allows the various components of a hyperspacial document to have varying sizes, some being larger than a sheet of paper and others shorter. 
    
    
     BRIEF DESCRIPTION OF THE DRAWINGS 
     FIGS. 1A, 1B, 3, 4A and 4B illustrate the steps a browser takes when a user activates the &#34;Print Entire Flow of Pages&#34; command of the invention. 
     FIG. 2 illustrates a typical client-server environment. 
     FIGS. 5A through 5D illustrate various methods of printing out a hyperspacial document. 
    
    
     DESCRIPTION OF THE PREFERRED EMBODIMENT 
     Definitions 
     CONTENT: an attribute of a META tag, q.v. 
     element: a building block for HTML documents. 
     HEAD: an element of HTML; a container for information about the HTML document in which this element is embedded. 
     HTML: HyperText Markup Language, the language used to prepare HyperText documents. 
     HTTP: HyperText Transfer Protocol, a Internet protocol for the distribution of HyperText documents. 
     IMG: an tag of HTML, with WIDTH and HEIGHT attributes. The IMG tag identifies a image within a HyperText document. 
     META: an element of HTML, carrying information not accounted for by other HEAD elements. Its CONTENT attribute is mandatory as is one of its NAME and HTTP-EQUIV attributes. The NAME attribute describes the value of the CONTENT attribute. The browser (or other client software) must understand the NAME attribute. 
     NAME: an attribute of a META tag, q.v. 
     tag: a component of an element. 
     Uniform Resource Locator: a character string giving (expressly or impliedly) the protocol, domain name/IP address, port number, path and details of a resource available on the World-Wide Web. 
     FIG. 2 illustrates a typical client-server environment. As one of ordinary skill in the art will readily appreciate, a user&#39;s accessing a web page on the World Wide Web involves the cooperation of (at least) two pieces of software: the web browser 210, typically directly under the user&#39;s control as software on the workstation 250, and the server 220 for the web page. Responding in a manner predetermined by the author of the web page to transactions initiated by the browser 210, the server 220 typically resides on a separate processor 240. In the preferred embodiment, this invention involves modifications to the language used to construct such web pages, modifications to the process of authoring of web pages on the server 220, as well as modifications to the operation of the user&#39;s web browser 210. 
     (As the HyperText Markup Language (HTML) is the preferred language for authoring hyperspacial documents, the description below is in the terms of HTML. These terms are explained in I. S. Graham, The HTML Sourcebook, 1996 (John Wiley &amp; Sons, Inc., 2d Edition). Graham is incorporated herein by reference to the extent necessary to explain these terms. However, Graham is not prior art.) 
     Data Structures: 
     On the server 240, the author of a set of hypertext pages for distribution over the web adds a META tag to the HEAD section of each page, indicating what web page is the next web page to print in the hypertext of this web page. In one embodiment, the META tag is as follows: 
     &lt;META NAME=&#34;PRINT-NEXT&#34; CONTENT=&#34;http://www.server.com/directory/page.html&#34;&gt; 
     In this tag, the value of the CONTENT attribute is a Uniform Resource Locator (URL) that specifies the next page that should be printed. If a page is the last page, the author eliminates the PRINT-NEXT META tag. For clarity, however, the author preferably uses the following META tag: 
     &lt;META NAME=&#34;PRINT-NEXT&#34; CONTENT=&#34;&#34;&gt; 
     Note that the CONTENT attribute can be any valid URL, including a pointer to information in another directory or on another server 240. 
     Relative URLs are permissible. If the next page is stored in the same directory as the current page, the META tag could be: 
     &lt;META NAME=&#34;PRINT-NEXT&#34; CONTENT=&#34;page.html&#34;&gt; 
     Protocols: 
     When the user&#39;s web browser 210 (or other client software) retrieves a web page for display (in a well-known manner), it checks the header of the web page for the presence of a PRINT-NEXT META tag. If the browser 210 finds this tag (and the CONTENT attribute is not the empty string signifying the last page in a printout), then the software activates a &#34;Print Entire Flow of Pages&#34; command. 
     A preferred embodiment adds this command to the same menu as (or to a menu subordinate from) the one where the Print command is found (normally, the File menu) and places it immediately below the Print command. If no PRINT-NEXT META tag is found in the header for the current web page or if the CONTENT attribute is the empty string, then the software grays out the &#34;Print Entire Flow of Pages&#34; command in the menu. Alternative embodiments allow the user to select the &#34;Print Entire Flow of Pages&#34; command by pressing a function key on the keyboard, by speaking a voice-activated command, or by similar express method. 
     FIGS. 1A, 1B, 3, 4A and 4B illustrate the steps the browser 210 takes when the user selects the &#34;Print Entire Flow of Pages&#34; command (step 100). The browser 210 defines the &#34;active page&#34; as being the web page displayed in the active window at the time the &#34;Print Entire Flow of Pages&#34; command was selected; initializes a list of pages to print as empty; and initializes a set of all pages printed as the empty set (step 110). 
     The browser 210 cycles through the following steps one page at a time: 
     It checks whether the active page is already a member of the set of all pages printed (step 120). If so, the browser 210 adds a terminus indicator to the list of pages to print (step 130) and exits the loop. If not, the browser 210 adds the active page to the set of all pages printed (step 140). This step prevents infinite loops. 
     The browser 210 then adds the active page to the end of the list of pages to print (step 140). 
     The browser 210 waits until the HEAD section of the active page has been downloaded (step 150). In a preferred embodiment, the browser 210 sets a timeout timer to a timeout interval that a user can set (but is preferably one minute by default) (step 160). If the HEAD section is not downloaded before expiration of the timeout interval or if an error message is received (step 180), then the browser 210 adds a terminus indicator to the list of pages to print (step 130) and exits the loop. 
     If the HEAD section of the active page has been downloaded before the timeout interval expires, then the browser 210 checks whether it contains a PRINT-NEXT META tag with a CONTENT attribute that is not the empty string and is a valid URL (steps 105 and 125). If so, the browser 210 sets the active page to the page that the URL identifies and starts retrieving the active page (step 115). The browser 210 then continues the loop at step 120. 
     If the HEAD section does not contain a PRINT-NEXT META tag, the CONTENT attribute of the tag is an empty string or the attribute&#39;s value is an invalid URL (steps 105 and 125), the browser 210 adds a terminus indicator to the list of pages to print and exits the loop (step 130). 
     In parallel with the loop of steps 115 through 180, the browser 210 also executes the following loop, multithreading the two set of activities. In the preferred embodiment, the browser 210 uses the multithreading capabilities of the Solaris® operating system, available from Sun Microsystems, Inc., the assignee of the instant invention: 
     The browser 210 initializes printing using whatever prior art it uses for printing web pages (step 310). This initialization may involve showing a dialog box to the user to select the number of copies printed, the printer, color or monochrome, and many other options well-known in the art. Preferably, the initialization of printing for the Print Entire Flow of Pages command duplicates exactly the initialization of printing for the existing `Print` command. 
     The browser 210 defines the &#34;page to print next&#34; as the first element in the list of pages to print and removes the page to print next from the top of the list of pages to print (step 320). 
     The browser 210 then sets a timeout timer to a timeout interval that a user can set (but is preferably 5 minutes by default) (step 330). The browser 210 waits until either it receives the complete web page for the page to print next (step 305) or the waiting interval expires (step 340). 
     The browser 210 then sends as much of the page to print next as it has to the printer 230 (step 350). If it does not have the entire file, the browser 210 furthermore sends two line feeds, some error-indication text such as &#34;TRANSFER INTERRUPTED,&#34; and two more line feeds to the printer 230 (step 360). 
     The browser 210 checks whether the list of pages to print contains at least one element other than the terminus indicator (step 370). If so, it sends two line feeds, a horizontal rule, and two more line feeds to the printer 230 (step 380) and continues the loop at step 320. If the list of pages to print is empty (i.e., contains only the terminus indicator), the browser 210 closes printing (using whatever prior art it uses for finishing the printing of a web page) (step 390) and exits the loop. &#34;Retrieving a page&#34; as described in step 115 is performed using methods well-known in the art to retrieve a web page (most typically, a HyperText Transfer Protocol (HTTP) GET request)--with the exception that the page is not displayed on the screen. In particular, the browser 210 retrieves first the HTML text of the page and then any embedded images (indicated by an &lt;IMG&gt; tag). The browser 210 does not spend time retrieving page elements that would not be visible in a printout. For example, sound files are not retrieved, and background patterns are not retrieved unless the user has indicated a preference to have background patterns printed. 
     In step 350, if any embedded images have not been fully received at the time the page is printed, then the browser 210 takes the following steps to determine what to print: 
     If the browser 210 receives some part of an image (step 405), then it prints that part. If the HTML text with the page definition provides WIDTH and HEIGHT attributes for the image (step 420), then the image is printed in an area with the specified dimensions (step 410) and any part of the area for which no image data is available (step 450) is printed in a 20% gray (step 430). If WIDTH and HEIGHT dimensions are not available (step 420), then the available image data is printed followed by an icon showing a broken image (step 440). 
     If the browser 210 has received no part of the image (step 405), then the text given as an ALT attribute for the image is printed, if available (step 460). If no ALT text is available, then an icon showing a broken image is printed (step 480). The browser 210 prints the text (or icon) centered horizontally and vertically within a box with the dimensions given as WIDTH and HEIGHT attributes for the image (step 415). If WIDTH and HEIGHT dimensions are not available (step 490), then the text (or icon) is printed within a box that is sized as the bounding box for the text (or icon) (step 425). 
     FIGS. 5A through 5D illustrate various methods for printing a hyperspacial document. Assuming a four-page document consisting of pages A, B, C and D, a first method for printing the document is shown in FIG. 5A, wherein the pages are printed in the order in which they are viewed. In contrast, the invention described herein allows the document to print as shown in FIG. 5B, with one or more pages omitted. In yet another embodiment, the invention allows the hyperspacial document of FIG. 5A to print as shown in FIG. 5C, wherein one or more additional pages that are not seen on viewing nonetheless print out. Finally, the invention allows the printing of the hyperspacial document of FIG. 5A as shown in FIG. 5D, wherein one or more of the pages of the document print out of sequence. Of course, these printing methods may be variously combined. 
     Of course, the program text for such software as is herein disclosed can exist in its static form on a magnetic, optical or other disk, on magnetic tape or other medium requiring media movement for storage and/or retrieval, in ROM, in RAM, or in another data storage medium. That data storage medium may be integral to or insertable into a computer system.