Documentation Index

A Page contains information about the page size and links to rendering tasks. Typically, for each section a thumbnail is shown. So we can assume that a section's first page information is always needed. The information about next pages is typically needed in blocks, because then more thumbnails are shown.

There are cases when it is hard do determine page information (like in word files) and other cases where it is simple (PDF, multipaged bitmaps).

To cover all the cases, we use blocks of pages following this pattern:

  • When the server returns a Section data structure, the information of some pages are already embedded. The server decides how many pages are added. He can add only a single page, or a fixed number of pages or even all pages in case this is fast enough. So here the server solves the trade-off between a minimal number of server calls and the response time.
  • If the server does not return all pages then he provides a link which the client can use to get the information of the next pages. If the client follows this link he gets the next block of Pages and so on, until a block is returned without this link.

Example: The client opens a section with one page information and wants to display 8 thumbnails of a section with 10 pages. Then the client follows the provided link and gets then information about the next 3 pages. Since the client wants to see more pages, he follows the link of the structure and gets the next 2 pages. Now the client has 6 pages, hence he follows the link of the returned structure and gets the next, say, 3 pages. Then the client is ready. If the section would have only six pages, then the last request would not have been possible because the previously returned page information would not provide a link.

As you see in this example, the client should never rely that the server returns a fixed number of pages with every request. Rather the client should make consecutive requests until enough pages are downloaded.

Expensive information: Some page information are hard to calculate. For instance, the information about the text content area, which is needed to implement the Fit to text feature, needs an expensive analysis of a page. If such information is not available (e.g. because it resides in a cache) the information is not returned when pages are listed. Rather, to get such an information for a single page a client must follow the self link of a page.