Pages of a document.
Use Document.pages to obtain instances of this class.
Page indexing is zero-based, i.e. pages[0] stands for the very first page.
len(pages) might return 1 when called before receiving a DocInfoMessage.
Page of a document.
Use Document.pages[N] to obtain instances of this class.
Returns: | the page number. |
---|
Page indexing is zero-based, i.e. 0 stands for the very first page.
Attempt to obtain information about the page without decoding the page.
If wait is true, wait until the information is available.
If the information is not available, raise NotAvailable exception. Then, start fetching the page data, which causes emission of PageInfoMessage messages with empty page_job.
Raises: |
|
---|
Returns: | the page width, in pixels. |
---|---|
Raises: |
|
Returns: | the page height, in pixels. |
---|---|
Raises: |
|
Returns: | (page.width, page.height) |
---|---|
Raises: |
|
Returns: | the page resolution, in pixels per inch. |
---|---|
Raises: |
|
Returns: | the initial page rotation, in degrees. |
---|---|
Raises: |
|
Returns: | the page version. |
---|---|
Raises: |
|
Returns: | a text describing the contents of the page using the same format as the djvudump command. |
---|
If the information is not available, raise NotAvailable exception. Then PageInfoMessage messages with empty page_job may be emitted.
Raises NotAvailable: | |
---|---|
see above. |
Initiate data transfer and decoding threads for the page.
If wait is true, wait until the job is done.
Return type: | |
---|---|
Raises: |
|
Return type: | PageAnnotations |
---|
Inheritance diagram:
digraph inheritancee9783457ea { rankdir=LR; size="8.0, 12.0"; "Job" [style="setlinewidth(0.5)",URL="event-model.html#djvu.decode.Job",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A job.",height=0.25,shape=box,fontsize=10]; "PageJob" [style="setlinewidth(0.5)",URL="#djvu.decode.PageJob",fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",tooltip="A page decoding job.",height=0.25,shape=box,fontsize=10]; "Job" -> "PageJob" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
A page decoding job.
Use Page.decode() to obtain instances of this class.
Returns: | the page width in pixels. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the page height in pixels. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | (page_job.width, page_job.height) |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the page resolution in pixels per inch. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the gamma of the display for which this page was designed. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the version of the DjVu file format. |
---|---|
Raises NotAvailable: | |
before receiving a PageInfoMessage. |
Returns: | the type of the page data. |
---|
Possible values are:
Raises NotAvailable: | |
---|---|
before receiving a PageInfoMessage. |
Returns: | the counter-clockwise page rotation angle (in degrees) specified by the orientation flags in the DjVu file. |
---|
Warning
This is useful because maparea coordinates in the annotation chunks are expressed relative to the rotated coordinates whereas text coordinates in the hidden text data are expressed relative to the unrotated coordinates.
Returns: | the counter-clockwise rotation angle (in degrees) for the page. |
---|
The rotation is automatically taken into account by render() method and width and height properties.
Render a segment of a page with arbitrary scale. mode indicates which image layers should be rendered:
Conceptually this method renders the full page into a rectangle page_rect and copies the pixels specified by rectangle render_rect into a buffer. The actual code is much more efficient than that.
pixel_format (a PixelFormat instance) specifies the expected pixel format. Each row will start at row_alignment bytes boundary.
Data will be saved to the provided buffer or to a newly created string.
This method makes a best effort to compute an image that reflects the most recently decoded data.
Raises NotAvailable: | |
---|---|
to indicate that no image could be computed at this point. |
Thumbnail for a page.
Use Page.thumbnail to obtain instances of this class.
Returns: | the page. |
---|
Determine whether the thumbnail is available.
Returns: | a JobException subclass indicating the current job status. |
---|
Determine whether the thumbnail is available. If it’s not, initiate the thumbnail calculating job. Regardless of its success, the completion of the job is signalled by a subsequent ThumbnailMessage.
Return a JobException subclass indicating the current job status.
Render the thumbnail:
Returns: | a ((w1, h1, row_size), data) tuple. |
---|
Raises NotAvailable: | |
---|---|
when no thumbnail is available. |