Dynamic pagination of text and resizing of image to fit a document
Dynamic pagination for electronic documents, such as electronic books, is disclosed. In one embodiment, a computer-implemented method first processes a document made up of at least text, as a number of segments. Second, the method determines a number of page breaks within a predetermined segment. This segment, for example, may be entered into the memory of a viewing device, such as an electronic book device. Third, the method renders a predetermined page within the predetermined segment, and finally displays the predetermined page. For example, the page can be displayed on a display device such as a flat-panel display of an electronic book device.
Latest Microsoft Patents:
This application is a continuation of U.S. application Ser. No. 09/410,414, filed Oct. 1, 1999, entitled “Dynamic Pagination of Text and Resizing of Image to Fit a Document”. This application is related to U.S. Pat. No. 6,966,026 entitled “Balanced View Generation for Electronic Documents”. The entirety of each is hereby incorporated by reference.
FIELD OF THE INVENTIONThis invention relates generally to electronic documents such as electronic books, and more particularly dynamic pagination of such electronic documents.
BACKGROUND OF THE INVENTIONDocuments, such as books, magazines, etc., are increasingly being distributed in an electronic manner. For example, books distributed electronically are commonly referred to as electronic books. The terminology electronic document is used herein to refer to any type of document that is stored and/or distributed in an electronic manner. Such so-called electronic documents can be viewed on general-purpose desktop and laptop computers, as well as other devices, such as personal digital assistants (PDA's), palmtop computers, hand-held computers, set-top boxes for television sets, etc. Furthermore, one type of device on which electronic documents can be viewed is referred to as an electronic book device, which is a specialized device designed for the reading of electronic documents.
Especially for electronic book devices, electronic documents typically are paginated statically, specifically for a particular device. This means, however, that the electronic documents are not readily adaptable to other devices, or future devices. That is, static pagination ignores the very large installed base of desktop and laptop computers.
Although liquid crystal displays (LCD's) are improving in quality and decreasing in price, they are still the most expensive component in a laptop computer currently, so a specialized reader device based on these components will remain expensive, at least for a while. Furthermore, the best LCD available currently is at best only merely adequate to display a page originally formatted for paper distribution. Thus, a distribution format that is optimized for a fixed-size display is disadvantageous, since display technologies are evolving rapidly.
For these and other reasons, there is a need for the present invention.
SUMMARY OF THE INVENTIONThe invention relates to dynamic pagination for electronic documents. In one embodiment, a computer-implemented method performs four parts. First, the method processes a document made up of at least text, as a number of segments. For example, the method can assemble the document from the segments, or divide a document into segments. Second, the method determines a number of page breaks within a predetermined segment. This segment, for example, may be entered into the memory of a viewing device, such as an electronic book device. Third, the method renders a predetermined page within the predetermined segment, and finally displays the predetermined page. For example, the page can be displayed on a display device such as a flat-panel display of an electronic book device.
Embodiments of the invention provide for advantages not found in the prior art. For example, embodiments allow for quick pagination of electronic documents regardless of the host device on which they are being viewed. By having the document made up of a number of segments, which may, for example, correspond to chapters of a book, only one segment at a time has to be paginated on-the-fly. Furthermore, only the currently desired page of the segment needs to be rendered for display. The invention also provides for flexibility in different types of host devices on which the electronic documents may be viewed. By paginating pages dynamically, electronic books under embodiments of the invention can look quite good on devices ranging from palm-sized personal computers (PC's) to twenty-one inch monitors.
The invention includes electronic devices, computer-implemented methods, machine-readable media, computerized systems, and computers of varying scopes. Other aspects, embodiments and advantages of the invention, beyond those described here, will become apparent by reading the detailed description and with reference to the drawings.
BRIEF DESCRIPTION OF THE DRAWINGS
15
In the following detailed description of exemplary embodiments of the invention, reference is made to the accompanying drawings which form a part hereof, and in which is shown by way of illustration specific exemplary embodiments in which the invention may be practiced. These embodiments are described in sufficient detail to enable those skilled in the art to practice the invention, and it is to be understood that other embodiments may be utilized and that logical, mechanical, electrical and other changes may be made without departing from the spirit or scope of the present invention. The following detailed description is, therefore, not to be taken in a limiting sense, and the scope of the present invention is defined only by the appended claims.
Some portions of the detailed descriptions which follow are presented in terms of algorithms and symbolic representations of operations on data bits within a computer memory. These algorithmic descriptions and representations are the means used by those skilled in the data processing arts to most effectively convey the substance of their work to others skilled in the art. An algorithm is here, and generally, conceived to be a self-consistent sequence of steps leading to a desired result. The steps are those requiring physical manipulations of physical quantities. Usually, though not necessarily, these quantities take the form of electrical or magnetic signals capable of being stored, transferred, combined, compared, and otherwise manipulated.
It has proven convenient at times, principally for reasons of common usage, to refer to these signals as bits, values, elements, symbols, characters, terms, numbers, or the like. It should be borne in mind, however, that all of these and similar terms are to be associated with the appropriate physical quantities and are merely convenient labels applied to these quantities. Unless specifically stated otherwise as apparent from the following discussions, it is appreciated that throughout the present invention, discussions utilizing terms such as processing or computing or calculating or determining or displaying or the like, refer to the action and processes of a computer system, or similar electronic computing device, that manipulates and transforms data represented as physical (electronic) quantities within the computer system's registers and memories into other data similarly represented as physical quantities within the computer system memories or registers or other such information storage, transmission or display devices.
OverviewIn this section, an overview of embodiments of the invention is provided. The overview is meant to provide a general description of at least some embodiments of the invention. In subsequent sections, more detailed embodiments of the invention are presented.
Referring first to
A predetermined segment 104 of the document 100 is paginated into pages 106a, 106b, . . . , 106n. The segment 104 may be, for example, the segment containing a page desired to be viewed by a user. When an electronic document is first opened, the segment 104 may be the first segment of the document, such that it contains the first page of the document. The invention is not limited to the manner by which the predetermined segment 104 is chosen.
The pagination of the predetermined segment 104 of the document 100 into pages 106a, 106b, . . . , 106n is referred to as dynamic pagination in that the document 100 desirably does not itself having internal page breaks denoted, which may correspond to a static definition of a page for a particular display device. Thus, the document 100 is independent of the display device on which it will be viewed, so that it can be dynamically paginated for any type of display device on which it happens to currently be viewed. In one embodiment, dynamic pagination is accomplished as described in a succeeding section of the detailed description.
In paginating the segment 104 into different pages, it is noted that embodiments of the invention do not lay out, or render, each individual page within the segment, but rather only determine where the page breaks within the segment 104 lie. Once a predetermined page 108 is selected from the segment 104, it is at that time that the page is rendered, and displayed on a display device such as a flat-panel display. The invention is also not limited to the manner by which the predetermined page 108 is chosen.
Furthermore, in one embodiment, the document 100 itself is stored on a storage device, which is desirably a non-volatile storage device such as a hard disk drive, flash memory device, PC card hard drive, read-only memory (ROM), etc. In this embodiment, only the predetermined segment 104 is entered into memory, which is typically volatile memory such as types of random-access memory (RAM). Then, only the predetermined page 108 is rendered, or laid out, also in the memory, for display on a display device such as a flat-panel display, a cathode-ray tube, etc.
By partitioning the document 100 into different segments 102a, 102b, . . . , 10211, only paginating a predetermined segment 104 into pages 106a, 106b, . . . , 106n, and only rendering a predetermined page 108 to be displayed on a display device, embodiments of the invention provide for advantages not found in the prior art. For example, where an embodiment of the invention is implemented in conjunction with an electronic book device, such a device is likely to have a limited amount of volatile memory, and a relatively slow processor. By only entering one predetermined segment 104 into memory at a given time (as opposed to the entire document 100, for example), memory is conserved. Furthermore, by only paginating one predetermined segment 104 into pages 106a, 106b, . . . , 10611 (as opposed to paginating the entire document 100, for example), and only rendering one predetermined page 108 of the segment 104 at one time (as opposed to rendering all the pages 106a, 106b, . . . , 106n of the segment 104, for example), processing time is reduced.
A method corresponding to the above overview of embodiments of the invention is now described. Referring to
In 152, a number of page breaks within a predetermined segment of the document is determined. Desirably, this does not involve rendering each individual page of the segment, but rather only determining the page breaks within the segment. In one embodiment, 152 can involve first entering the predetermined segment of the document into memory, such as volatile memory, as has been described, such that the page breaks within the predetermined segment are also stored in the memory. In 154, a predetermined page within the predetermined segment is rendered, then displayed in 156, for example, on a display device.
It is noted that this and other methods described in the detailed description are desirably computer-implemented methods. Such computer-implemented methods are desirably realized at least in part as one or more programs running on a computer—that is, as a program made up of instructions and executed from a computer-readable medium such as a memory by a processor of a computer. The programs are desirably storable on a machine-readable medium such as a floppy disk or a CD-ROM, for distribution and installation and execution on another computer.
Specific Embodiment for Dynamic PaginationIn this section of the detailed description, a specific embodiment of the invention for performing the dynamic pagination as described in the preceding section of the detailed description is presented. It is noted that the invention is not limited to this specific embodiment, however. As described herein, the specific embodiment pertains to electronic documents that are electronic books. However, embodiments of the invention are not so limited to documents that are books, as can be appreciated by those of ordinary skill within the art.
Referring first to
Thus, to determine how much text fits onto a given page, an embodiment of the invention determines how much text fits into each slot of the page, and proceeds from slot to slot and column to column as described. To determine how much text fits into each slot, the determination may be performed as to complete words (viz., how many complete words fit into the slot, where “word” can denote a symbol e.g. in non-western-languages), or may be performed utilizing hyphenation (viz., hyphenating a last word to make a portion of the word fit into the slot). The invention is not so limited.
Embodiments of the invention provide for dynamic pagination in that the structure of a given page, such as the page 200 of
In one embodiment of the invention, the width and height of a slot is fixed and measured by a number of pixels. The font size of the font utilized in rendering the text in each slot is also fixed. The invention is not necessarily so limited, however.
It is noted that dynamic pagination as to a page such as the page of
Two special cases also deserve description in this overview section of the detailed description. While the diagram of
This is shown by reference to
There are two variations in accommodating footnotes not shown by reference to
The special case of images is shown with reference to
In the case of
As has been noted, if room cannot be made for a graphic, then it is postponed in a manner similar to the way footnotes are postponed, either to a next column of the current page, or to a next page altogether. For example, as shown in
In other words, accommodation for footnotes and images is made on a given page only when such accommodation does not involve changing any slot into which text has already been poured. In the case just described in the previous paragraph, this means that placement of the graphic has to be postponed to a next page, because the only way the graphic can be accommodated on the current page is to change the number of slots in the first column—but these slots have already had text poured there into, so they cannot be adjusted. This general rule is applicable in at least some embodiments of the invention—that accommodation of footnotes and images is allowed only when empty slots need adjustment or modification, and not slots into which text has already been poured—and provides for quicker dynamic pagination, in that such pagination is a one-pass process, and not a multi-pass process.
A computer-implemented method for dynamic pagination, consistent with the preceding description within this section of the detailed description follows. What is meant by a paginatable segment of electronic book text (where the text may include footnotes, and refer to graphics) is first described by reference to
However, a segment does not necessarily refer to a specific file. Rather, a segment can refer to a series of files, as is shown in
Referring next to
Thus, in 306, the method, starting at a current position in the text defined by the paginatable segment, determines a maximum number of words that fit into a current slot of a series of predetermined slots of the current page, organized into one or more columns on the page. Once the maximum number of words that fit into the current slot of the current page has been determined, in 308, the current position in the text is advanced to the next word after the last word that has been determined to fit into the current slot of the current page. It is noted that if there is no more text left in the paginatable segment, then the method ends at 308.
Otherwise, in 310, it is determined whether there are any more slots within the current page. If there are, then in 312, the current slot is advanced to the next slot, in a predetermined manner—for example, from top to bottom within a column, where the columns of slots are proceeded to from left to right, as has been described. Then the method continues in 306 again, determining the maximum number of words that fit into the new current slot, etc.
If there are no more slots left in the current page, then the method instead proceeds from 310 to 314, where a page break is marked. In one embodiment, the page break is marked, or denoted, in an internal representation of the plurality of text defined by the paginatable segment. For example, the internal representation may include reference to each file within the paginatable segment, such that a page break is marked by indicating the paginatable segment, the file within the paginatable segment, and the position within that file. The invention is not so limited, however. LU 316, the current page is advanced to a next page (the first slot thereof), and then the method continues in 306 again, as has been explained.
The specific embodiment of the invention of
As described in the previous section of the detailed description, special cases are made for dynamic pagination when graphics or footnotes are encountered (the latter, in the case where the footnotes are desired to be displayed as footnotes on a page, as opposed to endnotes at the end of the text). These special cases are now described in conjunction with specific embodiments of the invention. In these specific embodiments, the plurality of text is defined as a series of lines, such that each line within the plurality of text includes text to be poured, or a footnote, or reference to a graphic. However, as used herein, the term line does not necessarily have to relate to a specific line within the text. Rather, the temi line can also relate to a specific position within the text, for example, if the text is so organized. For example, in one embodiment, each line corresponds to a slot, as has been described previously in the detailed description. The invention is not so limited.
In 324, it is determined that a current line (where the term line can also refer to a current position or other manner by which a give place within the text is indicated) refers to an image or a footnote. In 326, it is determined whether the image or the footnote has sufficient room on the page to fit—given the already filled slots on the page, as has been described in the previous section of the detailed description (i.e., such that the dynamic pagination process is a one-pass—and not a two-pass—process). With respect to images specifically, the scale of the image may be resized as necessary if so desired. If there is sufficient room on the page, then in 328, the page is adjusted as necessary. For example, subsequent slots on the page may be decreased in size, or the number of slots on the page may be decreased in number, as has been described in the overview of embodiments of the invention previously in the detailed description.
Otherwise, in 330, accommodation of the footnote or graphic on the page is postponed to the next page (or, to a next column of the current page, in one embodiment of the invention), such that as soon as that next page is being processed, accommodation of the footnote or graphic is made before any text is poured into the slots of the page.
Representative Device for Viewing Electronic DocumentsAs described, the methods of the previous sections of the detailed description can be implemented on any type of computerized device, such as a general-purpose laptop or desktop computer, a personal digital assistant (PDA), a palm-top computer, a hand-held computer, a specialized electronic book device, etc. However, one such representative device is described in this section of the detailed description. Those of ordinary skill within the art can appreciate that the invention is not limited to this representative device for viewing electronic documents.
Referring to
Thus, the processor 400 executes a computer program to determine a number of page breaks within the one segment of the document stored in the memory device 404, after entering the segment into the device 404 from the storage device 402. The page breaks are also stored in the memory device 404 in one embodiment. The processor 400 also executes a second computer program to render one of the pages of the segment stored in the memory device 404, and display that page on the display device 406. Each of these programs may be separate, or part of a larger computer program, in which latter case the individual programs are typically referred to as software objects, or software components, as known in the art.
ConclusionAlthough specific embodiments have been illustrated and described herein, it will be appreciated by those of ordinary skill in the art that any arrangement which is calculated to achieve the same purpose may be substituted for the specific embodiments shown. This application is intended to cover any adaptations or variations of the present invention. For example, in some embodiments of the invention, the embodiments described herein can be utilized in conjunction with the subject matter described in the related applications, which have been described at the beginning of this application, and which have been incorporated by reference. The invention is not so limited, however. Therefore, it is manifestly intended that this invention be limited only by the following claims and equivalents thereof.
Claims
1. A machine implemented method that facilitates dynamically adaptive pagination, comprising:
- deconstructing an electronic document into at least one segment;
- ascertaining a location of at least one page break within the at least one segment;
- disposing a plurality of predetermined slots on a page to form a two dimensional grid;
- inserting text included in the at least one segment into a first of the predetermined slots;
- determining whether a current line of the text makes reference to an image;
- ascertaining whether sufficient subsequent predetermined slots exist in order to accommodate placement of the image on the page;
- recalibrating each of the subsequent predetermined slots to facilitate placement of the image on the page;
- placing the image on the page based at least in part on the recalibration of the subsequent predetermined slots;
- rendering a predetermined page within the at least on segment; and
- displaying the predetermined page.
2. The method of claim 1, further comprises receiving an electronic document that includes at least text.
3. The method of claim 1, ascertaining a location of at least one page break effectuated without rendering the at least one segment on a display device.
4. The method of claim 1, the two dimensional grid comprises one or more rows and one or more columns.
5. The method of claim 1, the predetermined slots adjustable based at least in part of a font size selected in order to render the predetermined page.
6. The method of claim 1, the predetermined slots measured by a number of display pixels.
7. The method of claim 1, the ascertaining a location of the at least one page break based at least in part on a display capability.
8. The method of claim 1, further comprising inserting text included in the at least one segment into a plurality of subsequent predetermined slots.
9. The method of claim 1, further comprising determining whether a footnote is associated with a current line of the text.
10. The method of claim 9, determining whether sufficient subsequent predetermined slots exist in order to accommodate placement of the footnote on the page.
11. The method of claim 1, placing the image on the page based at least in part on a predetermined position, the predetermined position includes at least one of: in-line, left justified in relation to the predetermined page, right justified in relation to the predetermined page, horizontally centered in the predetermined page, and vertically centered in the predetermined page.
12. A machine implemented system that facilitates dynamically adaptive pagination, comprising:
- means for storing an electronic document comprising a plurality of segments;
- means for disassembling the plurality of segments into an identifiable segment;
- means for locating one or more page break within the identifiable segment;
- means for generating fixed sized slots, the fixed sized slots arranged on a page in a two dimensional pattern;
- means for inserting text and one or more images that comprise the electronic document into the fixed sized slots;
- means for identifying the one or more images and recalibrating subsequent fixed sized slots to accommodate insertion of the one or more images; and
- means for displaying the page comprising the inserted text and one or more images.
13. The system of claim 12, the means for locating identifies the one or more page break without employing the means for displaying.
14. The system of claim 12, the means for inserting accommodates insertion of the one or more images based at least in part on a predetermined position that includes one or more of: in-line and horizontally and vertically centered in relation to the fixed sized slots.
15. The system of claim 12, the means for identifying recalibrates the subsequent fixed sized slots based on an identification that one or more images comprise a current line.
16. The system of claim 12, the means for identifying recalibrates the subsequent fixed sized slots based on a display capability of the means for displaying.
17. A machine-readable medium including instructions for execution on a machine to perform a dynamic adaptive pagination method comprising:
- receiving a predetermined segment of a document in machine memory;
- identifying one or more page break within the predetermined segment;
- inserting text associated with the predetermined segment into a plurality of slots arranged to comprise a two dimensional grid;
- locating a footnote within the predetermined segment;
- rearranging the plurality of slots to selectively position the footnote; and
- displaying the plurality of slots and the footnote on a display device.
18. The method of claim 17, identifying the one or more page break effectuated without employing the display device.
19. The method of claim 17, selectively positioning the footnote based at least upon whether sufficient subsequent slots within the plurality of slots exist to accommodate the positioning.
20. The method of claim 17, further comprising identifying an image within the predetermined segment and rearranging a plurality of subsequent slots to selectively accommodate the image.
Type: Application
Filed: Mar 6, 2006
Publication Date: Jul 6, 2006
Applicant: Microsoft Corporation (Redmond, WA)
Inventors: Charles Thacker (Palo Alto, CA), Ralph Sommerer (Cambridge)
Application Number: 11/369,075
International Classification: G06F 17/21 (20060101);